Skip to content

Conversation

@zsxwing
Copy link
Member

@zsxwing zsxwing commented Mar 3, 2021

What changes were proposed in this pull request?

Backport #31669 to branch-3.0. Add a new test in DDLParserSuite.scala since SQLInsertTestSuite.scala doesn't exist in branch-3.0.

… respect case sensitive conf

This PR makes partition spec parsing respect case sensitive conf.

When parsing the partition spec, Spark will call `org.apache.spark.sql.catalyst.parser.ParserUtils.checkDuplicateKeys` to check if there are duplicate partition column names in the list. But this method is always case sensitive and doesn't detect duplicate partition column names when using different cases.

Yep. This prevents users from writing incorrect queries such as `INSERT OVERWRITE t PARTITION (c='2', C='3') VALUES (1)` when they don't enable case sensitive conf.

The new added test will fail without this change.

Closes apache#31669 from zsxwing/SPARK-34556.

Authored-by: Shixiong Zhu <[email protected]>
Signed-off-by: HyukjinKwon <[email protected]>
@dongjoon-hyun dongjoon-hyun changed the title [SPARK-34556][SQL] Checking duplicate static partition columns should respect case sensitive conf (3.0) [SPARK-34556][SQL][3.0] Checking duplicate static partition columns should respect case sensitive conf Mar 3, 2021
Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM (Pending CIs).

@HyukjinKwon
Copy link
Member

Merged to branch-3.0.

HyukjinKwon pushed a commit that referenced this pull request Mar 3, 2021
…hould respect case sensitive conf

### What changes were proposed in this pull request?

Backport #31669 to branch-3.0. Add a new test in DDLParserSuite.scala since SQLInsertTestSuite.scala doesn't exist in branch-3.0.

Closes #31714 from zsxwing/SPARK-34556-3.0.

Authored-by: Shixiong Zhu <[email protected]>
Signed-off-by: HyukjinKwon <[email protected]>
@HyukjinKwon HyukjinKwon closed this Mar 3, 2021
@zsxwing zsxwing deleted the SPARK-34556-3.0 branch March 3, 2021 03:52
@SparkQA
Copy link

SparkQA commented Mar 3, 2021

Test build #135679 has finished for PR 31714 at commit bf244b6.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants