Skip to content

Conversation

@zhilinli123
Copy link
Contributor

Purpose of this pull request

Does this PR introduce any user-facing change?

How was this patch tested?

Check list

@zhilinli123
Copy link
Contributor Author

Previous abnormal information
org.apache.seatunnel.connectors.seatunnel.jdbc.exception.JdbcConnectorException: ErrorCode:[COMMON-08], ErrorDescription:[Sql operation failed, such as (execute,addBatch,close) etc...] - Couldn't read data - Stream has already been closed

hailin0
hailin0 previously approved these changes May 28, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves the exception messages in JdbcInputFormat#nextRecord by including the table identifier in the error output.

  • SQLException error message now displays the table id along with the original error details
  • NullPointerException message is updated to include table id for better context
Comments suppressed due to low confidence (2)

seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/JdbcInputFormat.java:159

  • The updated SQLException message improves clarity by including the table identifier. Consider reviewing the phrasing for consistency across similar messages in the codebase.
String.format("Failed to read data from table '%s': %s", splitTableId, se.getMessage()),

seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/JdbcInputFormat.java:167

  • The NullPointerException message could be made a bit more descriptive by stating 'NullPointerException occurred' instead of 'NullPointer encountered' to improve consistency and clarity.
String.format("Failed to access resultSet for table '%s': NullPointer encountered", splitTableId),

CommonErrorCodeDeprecated.SQL_OPERATION_FAILED,
"Couldn't access resultSet",
String.format(
"Failed to access resultSet for table '%s': NullPointer encountered",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"Failed to access resultSet for table '%s': NullPointer encountered",
"Failed to access resultSet for table '%s': NullPointerException occurred",

@Hisoka-X
Copy link
Member

Hisoka-X commented Jun 3, 2025

waiting test case passes.

@zhilinli123 zhilinli123 requested review from Hisoka-X and hailin0 June 3, 2025 07:05
@hailin0 hailin0 merged commit 484aef5 into apache:dev Jun 3, 2025
6 checks passed
dybyte pushed a commit to dybyte/seatunnel that referenced this pull request Jul 23, 2025
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.

3 participants