-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-25132][SQL][DOC] Add migration doc for case-insensitive field resolution when reading from Parquet #22184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a behavior change. I am not sure whether we should backport it to 2.3.2. How about sending a note to the dev mailing list?
BTW, this only affects data source table. How about hive serde table? Are they consistent?
Could you add a test case? Create a table by the syntax like
CREATE TABLE ... STORED AS PARQUET. You also need to turn offspark.sql.hive.convertMetastoreParquetin the test case.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following your advice, I did a thorough comparison between data source table and hive serde table.
Parquet data and tables are created via the following code:
spark.sql.hive.convertMetastoreParquetis set to false:Below are the comparison results both without #22148 and with #22148.
The comparison result without #22148:
The comparison result with #22148 applied:
We can see that data source table and hive serde table have two major differences about parquet field resolution
WRT parquet field resolution, shall we make hive serde table behavior consistent with data source table behavior? What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should respect
spark.sql.caseSensitivein both modes, but also add a legacy SQLConf to enable users to revert back to the previous behavior.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a test case for the one you did?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First, we should not change the behavior of hive tables. It inherits many behaviors from Hive and let's keep it as it was.
Second, why we treat it as a behavior change? I think it's a bug that we don't respect
spark.sql.caseSensitivein field resolution. In general we should not add a config to restore a bug.I don't think this document is helpful. It explains a subtle and unreasonable behavior to users, which IMO just make them confused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making 1, 2 consistent is enough. : )
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, the parquet files could be generated by our DataFrameWriter. Thus, the physical schema and logical schema could still have different cases.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gatorsmile I think 1 and 2 are always consistent. They both use Spark reader. Am I wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#22184 (comment) already shows they are not consistent, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The testing is based on
spark.sql.hive.convertMetastoreParquetis set false, so it should use Hive serde reader instead of Spark reader, sorry if it is too confusing here.I guess you mean 1 and 3 :). I understand now.
If we are not going to backport the PR to 2.3, I can close SPARK-25206 also?