Skip to content

Conversation

@zhangshenghang
Copy link
Member

@zhangshenghang zhangshenghang commented Jan 8, 2026

Purpose of this pull request

This feature is compatible with the previous logic. If it is not configured, the execution logic will be the same as before.

Effect

========================================
Error Records from: orders_transform_error_both
========================================
Error Record #1
  ├─ Error Stage      : TRANSFORM
  ├─ Plugin Type      : TRANSFORM
  ├─ Plugin Name      : Sql
  ├─ Source Table     : orders_raw
  ├─ Error Message    : ErrorCode:[TRANSFORM_COMMON-06], ErrorDescription:[The expression 'cast(raw_name AS int)' of SQL transform execute failed]
  ├─ Exception Class  : org.apache.seatunnel.transform.exception.TransformException
  ├─ Original Data    : SeaTunnelRow{tableId=orders_raw, kind=+I, fields=[2, bad, ok2, 20]}
  └─ Occur Time       : 2026-01-08 06:50:00.0
----------------------------------------
========================================
========================================
Error Records from: orders_sink_error_both
========================================
Error Record #1
  ├─ Error Stage      : SINK
  ├─ Plugin Type      : SINK
  ├─ Plugin Name      : MultiTableSink
  ├─ Source Table     : orders_raw
  ├─ Error Message    : ErrorCode:[COMMON-08], ErrorDescription:[Sql operation failed, such as (execute,addBatch,close) etc...] - Writing records to JDBC failed.
  ├─ Exception Class  : org.apache.seatunnel.connectors.seatunnel.jdbc.exception.JdbcConnectorException
  ├─ Original Data    : SeaTunnelRow{tableId=orders_raw, kind=+I, fields=[3, too_long_name_1, 25]}
  └─ Occur Time       : 2026-01-08 06:50:00.0
----------------------------------------
Error Record #2
  ├─ Error Stage      : SINK
  ├─ Plugin Type      : SINK
  ├─ Plugin Name      : MultiTableSink
  ├─ Source Table     : orders_raw
  ├─ Error Message    : ErrorCode:[COMMON-08], ErrorDescription:[Sql operation failed, such as (execute,addBatch,close) etc...] - Writing records to JDBC failed.
  ├─ Exception Class  : org.apache.seatunnel.connectors.seatunnel.jdbc.exception.JdbcConnectorException
  ├─ Original Data    : SeaTunnelRow{tableId=orders_raw, kind=+I, fields=[4, too_long_name_2, 30]}
  └─ Occur Time       : 2026-01-08 06:50:00.0
----------------------------------------
========================================

Does this PR introduce any user-facing change?

How was this patch tested?

Check list

Copy link
Contributor

@chl-wxp chl-wxp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is recommended to move "cross-plugin type" abstractions such as RowErrorEvent / RowErrorCollector / RowErrorPhase up to the common/event/error field of seatunnel-api (such as api/common/error) to avoid "reverse dependence" on either sink/transform.

* @param row the row being processed
* @return true if row-level error, false if system-level error
*/
boolean isRowError(Throwable t, T row);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is recommended to return an enumeration type to deal with different error classifications for subsequent expansion.

* Marker interface for connectors/transforms that can classify exceptions as row-level or
* system-level errors.
*/
public interface SupportRowLevelError<T> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommended name SupportRowLevelErrorClassifier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature][Core] Error Data Bypass Capability for Transform & Sink (Dead Letter Queue)

2 participants