[SPARK-21529][SQL] Improve the error message for unsupported Hive union type#56775
Open
AgenticSpark wants to merge 3 commits into
Open
[SPARK-21529][SQL] Improve the error message for unsupported Hive union type#56775AgenticSpark wants to merge 3 commits into
AgenticSpark wants to merge 3 commits into
Conversation
uros-b
reviewed
Jun 25, 2026
|
|
||
| def timestampNanosEpochNanosOverflowError( | ||
| value: TimestampNanosVal, isNtz: Boolean, sink: String): SparkArithmeticException = { | ||
| def parquetTimestampNanosOverflowError( |
Member
There was a problem hiding this comment.
The PR renames timestampNanosEpochNanosOverflowError(value, isNtz, sink) -> parquetTimestampNanosOverflowError(value, isNtz) and hardcodes "Parquet INT64", but does NOT update its 3 call sites (ArrowWriter.scala:406, :426; ParquetWriteSupport.scala:199). The build will likely NOT compile. Also, this rename is entirely unrelated to SPARK-21529; pure scope creep / accidental edit; should very likely be reverted.
…on type Hive uniontype<...> is not supported by Spark SQL. Detect it on the Hive type parse-failure path and raise UNSUPPORTED_HIVE_TYPE so the unsupported type and column are reported directly. Tests: - SPARK_GENERATE_GOLDEN_FILES=1 build/sbt "core/testOnly *SparkThrowableSuite -- -t \"Error conditions are correctly formatted\"" - build/sbt "hive/testOnly *HiveClientImplSuite"
48f49ec to
ee5fb78
Compare
Apply the unsupported Hive union type check in HiveClientImpl so uniontype<...> raises UNSUPPORTED_HIVE_TYPE instead of falling through to the generic parser error. Tests: - build/sbt "hive/testOnly *HiveClientImplSuite"
Keep the generic Hive type parse fallback on its own line after the uniontype check.
Contributor
Author
|
Thanks, fixed. I rebuilt the branch on current upstream master and removed the accidental unrelated QueryExecutionErrors.scala changes; the PR diff is back to the Hive union type change only. |
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?
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.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?
SPARK_GENERATE_GOLDEN_FILES=1 build/sbt "core/testOnly *SparkThrowableSuite -- -t \"Error conditions are correctly formatted\""build/sbt "hive/testOnly *HiveClientImplSuite"Was this patch authored or co-authored using generative AI tooling?
Yes. GitHub Copilot assisted with preparing and validating this change.