-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-33511][SQL] Respect case sensitivity while resolving V2 partition specs #30454
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
Conversation
|
Test build #131479 has finished for PR 30454 at commit
|
|
Test build #131480 has started for PR 30454 at commit |
|
Kubernetes integration test starting |
|
Kubernetes integration test status success |
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.
Thank you, @MaxGekk . According to JIRA, this is only for 3.1.0, right?
|
Kubernetes integration test starting |
|
Kubernetes integration test status failure |
@dongjoon-hyun Yes, 3.0 doesn't support V2 |
|
@HyukjinKwon @cloud-fan Could you look at this PR, please. |
| import org.apache.spark.sql.AnalysisException | ||
| import org.apache.spark.sql.catalyst.analysis.Resolver | ||
|
|
||
| object PartitioningUtils { |
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.
nit: private[sql]
|
GA passed, merging to master! |
What changes were proposed in this pull request?
ResolvePartitionSpec, and convert partition names according to the partition schema and the SQL configspark.sql.caseSensitive. In the PR, I propose to invokenormalizePartitionSpecfor that. The function is used in DSv1 commands, so, the behavior will be similar to DSv1.normalizePartitionSpec()fromsql/core/.../datasources/PartitioningUtilstosql/catalyst/.../util/PartitioningUtilsto use it in Catalyst's ruleResolvePartitionSpecWhy are the changes needed?
DSv1 commands like
ALTER TABLE .. ADD PARTITIONandALTER TABLE .. DROP PARTITIONrespect the SQL configspark.sql.caseSensitivewhile resolving partition specs. For example:The same command fails on V2 Table catalog with error:
Does this PR introduce any user-facing change?
Yes. After the changes, partition spec resolution works as for DSv1 (without the exception showed above).
How was this patch tested?
By running
AlterTablePartitionV2SQLSuite.