[SPARK-56045][SQL][4.1] Add flag for ignoring Parquet UNKNOWN type annotation and revert to old behavior#54885
Closed
ZiyaZa wants to merge 2 commits intoapache:branch-4.1from
Closed
[SPARK-56045][SQL][4.1] Add flag for ignoring Parquet UNKNOWN type annotation and revert to old behavior#54885ZiyaZa wants to merge 2 commits intoapache:branch-4.1from
ZiyaZa wants to merge 2 commits intoapache:branch-4.1from
Conversation
…e annotation and revert to old behavior" This reverts commit fd2d262.
dongjoon-hyun
approved these changes
Mar 18, 2026
Member
dongjoon-hyun
left a comment
There was a problem hiding this comment.
+1, LGTM (Pending CIs). Thank you, @ZiyaZa .
dongjoon-hyun
pushed a commit
that referenced
this pull request
Mar 18, 2026
…notation and revert to old behavior ### What changes were proposed in this pull request? This PR introduces a new flag `spark.sql.parquet.reader.respectUnknownTypeAnnotation.enabled` for Parquet reader to control the behavior when it reads an external file with `UNKNOWN` logical type annotation: - (Default) When false, we infer the Spark type based on the physical type used in the Parquet file, as we did before Spark 4.1. - When true, we use NullType as the Spark type. ### Why are the changes needed? To fix the regression introduced by #52922, as we have been reading files differently since then. ### Does this PR introduce _any_ user-facing change? Yes. With default flag value, when we read a Parquet file written by an external engine: - Before, we inferred NullType - Now, we'll infer a type based on the physical type (e.g. IntegerType) ### How was this patch tested? Added tests. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #54885 from ZiyaZa/unknown-type-flag-4.1. Authored-by: Ziya Mukhtarov <ziya5muxtarov@gmail.com> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
Member
|
Merged to branch-4.1. |
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?
This PR introduces a new flag
spark.sql.parquet.reader.respectUnknownTypeAnnotation.enabledfor Parquet reader to control the behavior when it reads an external file withUNKNOWNlogical type annotation:Why are the changes needed?
To fix the regression introduced by #52922, as we have been reading files differently since then.
Does this PR introduce any user-facing change?
Yes. With default flag value, when we read a Parquet file written by an external engine:
How was this patch tested?
Added tests.
Was this patch authored or co-authored using generative AI tooling?
No.