[SPARK-58864][SQL] Add remediation hint to UNRECOGNIZED_SQL_TYPE error - #58113
Open
ganeshashree wants to merge 1 commit into
Open
[SPARK-58864][SQL] Add remediation hint to UNRECOGNIZED_SQL_TYPE error#58113ganeshashree wants to merge 1 commit into
ganeshashree wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
When the JDBC data source reads a column whose SQL type it cannot map to a Catalyst type, it fails with the
UNRECOGNIZED_SQL_TYPEerror. This PR appends a remediation hint to that error condition (in common/utils/src/main/resources/error/error-conditions.json), pointing users at the two supported ways to handle an unmapped type:Unrecognized SQL type - name: <typeName>, id: <jdbcType>.To read this column, map it explicitly with the
customSchemaoption, or register a customJdbcDialectthat handles this type. Only the message text of theUNRECOGNIZED_SQL_TYPEcondition changes; the error class, condition name, SQL state (42704), and message parameters are untouched.Why are the changes needed?
The existing message states what failed but not what to do about it.
UNRECOGNIZED_SQL_TYPEis thrown only from the JDBC read path (JdbcUtils.getCatalystType), and both remedies already exist: thecustomSchemaread option and a user-registeredJdbcDialect. Surfacing them lets users self-serve unmapped or vendor-specific types instead of reading source or filing a support request.Does this PR introduce any user-facing change?
Yes. The
UNRECOGNIZED_SQL_TYPEerror message now includes a second sentence with remediation guidance. There is no change to the error class, condition, SQL state, parameters, or behavior; only the human-readable text changes.How was this patch tested?
No new tests are needed. Existing coverage (QueryExecutionErrorsSuite - "
UNRECOGNIZED_SQL_TYPE: unrecognized SQL type DATALINK", and JDBCSuite) asserts on the error condition and its parameters via checkError, not on literal message text, so it continues to pass. docs/sql-error-conditions.md is generated from error-conditions.json at doc-build time, so no golden file needs regenerating. The JSON was validated as well-formed.Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 4.8)