[SPARK-21529][SQL] Improve the error message for unsupported Hive union type#56929
Open
AgenticSpark wants to merge 1 commit into
Open
[SPARK-21529][SQL] Improve the error message for unsupported Hive union type#56929AgenticSpark wants to merge 1 commit into
AgenticSpark wants to merge 1 commit into
Conversation
…on type Detect unsupported Hive `uniontype<...>` values when converting Hive `FieldSchema` types to Spark SQL types and raise a dedicated `UNSUPPORTED_HIVE_TYPE` error instead of the generic `CANNOT_RECOGNIZE_HIVE_TYPE` parser error. Spark SQL does not support Hive union types. Today the failure message comes from the parser path and does not clearly identify that the Hive union type is unsupported. Yes. Reading a Hive table column that uses `uniontype<...>` now reports `UNSUPPORTED_HIVE_TYPE` with the offending Hive type and column name. - `SPARK_GENERATE_GOLDEN_FILES=1 build/sbt "core/testOnly *SparkThrowableSuite -- -t \"Error conditions are correctly formatted\""` - `build/sbt "hive/testOnly *HiveClientImplSuite"` Yes. GitHub Copilot assisted with preparing and validating this change. Closes apache#56775 from AgenticSpark/agenticspark/SPARK-21529-uniontype-error. Authored-by: AgenticSpark <jianglie2023@gmail.com> Signed-off-by: Max Gekk <max.gekk@gmail.com> (cherry picked from commit c90cad6)
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?
Backport of #56775 to
branch-4.x, requested by @MaxGekk in #56775 (comment) because the original change conflicts on this branch.Detect unsupported Hive
uniontype<...>values when converting HiveFieldSchematypes to Spark SQL types and raise a dedicatedUNSUPPORTED_HIVE_TYPEerror instead of the genericCANNOT_RECOGNIZE_HIVE_TYPEparser error.This is a cherry-pick of the merged master commit c90cad6. The only conflict was in
error-conditions.json:branch-4.xdoes not have theUNSUPPORTED_HIVE_FUNCTION_TYPE/UNSUPPORTED_HIVE_METASTORE_VERSION_FOR_JAVAentries that exist on master, so the newUNSUPPORTED_HIVE_TYPEentry is placed directly betweenUNSUPPORTED_GROUPING_EXPRESSIONandUNSUPPORTED_INSERT. The Scala changes apply unchanged.Why are the changes needed?
Spark SQL does not support Hive union types. Today the failure message comes from the parser path and does not clearly identify that the Hive union type is unsupported.
Does this PR introduce any user-facing change?
Yes. Reading a Hive table column that uses
uniontype<...>now reportsUNSUPPORTED_HIVE_TYPEwith the offending Hive type and column name.How was this patch tested?
Cherry-picked from the merged master commit c90cad6, which passed CI and review as #56775. The production Scala hunks apply unchanged on
branch-4.x; only theerror-conditions.jsonentry placement differed and was re-validated (valid JSON, alphabetical ordering, one structural token per line). CI here runsHiveClientImplSuiteand theSparkThrowableSuite"Error conditions are correctly formatted" golden check.Was this patch authored or co-authored using generative AI tooling?
Yes. GitHub Copilot assisted with preparing and validating this change.