You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/02/27 07:12:31 UTC

[GitHub] [spark] MaxGekk opened a new pull request #31672: [SPARK-34543][SQL][3.0] Respect the `spark.sql.caseSensitive` config while resolving partition spec in v1 `SET LOCATION`

MaxGekk opened a new pull request #31672:
URL: https://github.com/apache/spark/pull/31672


   ### What changes were proposed in this pull request?
   Preprocess the partition spec passed to the V1 `ALTER TABLE .. SET LOCATION` implementation `AlterTableSetLocationCommand`, and normalize the passed spec according to the partition columns w.r.t the case sensitivity flag  **spark.sql.caseSensitive**.
   
   ### Why are the changes needed?
   V1 `ALTER TABLE .. SET LOCATION` is case sensitive in fact, and doesn't respect the SQL config **spark.sql.caseSensitive** which is false by default, for instance:
   ```sql
   spark-sql> CREATE TABLE tbl (id INT, part INT) PARTITIONED BY (part);
   spark-sql> INSERT INTO tbl PARTITION (part=0) SELECT 0;
   spark-sql> SHOW TABLE EXTENDED LIKE 'tbl' PARTITION (part=0);
   Location: file:/Users/maximgekk/proj/set-location-case-sense/spark-warehouse/tbl/part=0
   spark-sql> ALTER TABLE tbl ADD PARTITION (part=1);
   spark-sql> SELECT * FROM tbl;
   0	0
   ```
   Create new partition folder in the file system:
   ```
   $ cp -r /Users/maximgekk/proj/set-location-case-sense/spark-warehouse/tbl/part=0 /Users/maximgekk/proj/set-location-case-sense/spark-warehouse/tbl/aaa
   ```
   Set new location for the partition part=1:
   ```sql
   spark-sql> ALTER TABLE tbl PARTITION (part=1) SET LOCATION '/Users/maximgekk/proj/set-location-case-sense/spark-warehouse/tbl/aaa';
   spark-sql> SELECT * FROM tbl;
   0	0
   0	1
   spark-sql> ALTER TABLE tbl ADD PARTITION (PART=2);
   spark-sql> SELECT * FROM tbl;
   0	0
   0	1
   ```
   Set location for a partition in the upper case:
   ```
   $ cp -r /Users/maximgekk/proj/set-location-case-sense/spark-warehouse/tbl/part=0 /Users/maximgekk/proj/set-location-case-sense/spark-warehouse/tbl/bbb
   ```
   ```sql
   spark-sql> ALTER TABLE tbl PARTITION (PART=2) SET LOCATION '/Users/maximgekk/proj/set-location-case-sense/spark-warehouse/tbl/bbb';
   Error in query: Partition spec is invalid. The spec (PART) must match the partition spec (part) defined in table '`default`.`tbl`'
   ```
   
   ### Does this PR introduce _any_ user-facing change?
   Yes. After the changes, the command above works as expected:
   ```sql
   spark-sql> ALTER TABLE tbl PARTITION (PART=2) SET LOCATION '/Users/maximgekk/proj/set-location-case-sense/spark-warehouse/tbl/bbb';
   spark-sql> SELECT * FROM tbl;
   0	0
   0	1
   0	2
   ```
   
   ### How was this patch tested?
   By running the modified test suite:
   ```
   $ build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly *CatalogedDDLSuite"
   ```
   
   Authored-by: Max Gekk <ma...@gmail.com>
   Signed-off-by: Wenchen Fan <we...@databricks.com>
   (cherry picked from commit 5c7d019)
   Signed-off-by: Max Gekk <ma...@gmail.com>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #31672: [SPARK-34543][SQL][3.0] Respect the `spark.sql.caseSensitive` config while resolving partition spec in v1 `SET LOCATION`

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31672:
URL: https://github.com/apache/spark/pull/31672#issuecomment-787044012


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/40117/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #31672: [SPARK-34543][SQL][3.0] Respect the `spark.sql.caseSensitive` config while resolving partition spec in v1 `SET LOCATION`

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31672:
URL: https://github.com/apache/spark/pull/31672#issuecomment-787044012


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/40117/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun commented on pull request #31672: [SPARK-34543][SQL][3.0] Respect the `spark.sql.caseSensitive` config while resolving partition spec in v1 `SET LOCATION`

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #31672:
URL: https://github.com/apache/spark/pull/31672#issuecomment-787395400


   cc @cloud-fan , too.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #31672: [SPARK-34543][SQL][3.0] Respect the `spark.sql.caseSensitive` config while resolving partition spec in v1 `SET LOCATION`

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31672:
URL: https://github.com/apache/spark/pull/31672#issuecomment-787033009


   **[Test build #135536 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/135536/testReport)** for PR 31672 at commit [`961e851`](https://github.com/apache/spark/commit/961e8513a0287324a39b0ed7597676cf04cf0952).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #31672: [SPARK-34543][SQL][3.0] Respect the `spark.sql.caseSensitive` config while resolving partition spec in v1 `SET LOCATION`

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31672:
URL: https://github.com/apache/spark/pull/31672#issuecomment-787061728


   **[Test build #135536 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/135536/testReport)** for PR 31672 at commit [`961e851`](https://github.com/apache/spark/commit/961e8513a0287324a39b0ed7597676cf04cf0952).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #31672: [SPARK-34543][SQL][3.0] Respect the `spark.sql.caseSensitive` config while resolving partition spec in v1 `SET LOCATION`

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31672:
URL: https://github.com/apache/spark/pull/31672#issuecomment-787066258


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/135536/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun commented on pull request #31672: [SPARK-34543][SQL][3.0] Respect the `spark.sql.caseSensitive` config while resolving partition spec in v1 `SET LOCATION`

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #31672:
URL: https://github.com/apache/spark/pull/31672#issuecomment-787029615


   Thank you, @MaxGekk .


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #31672: [SPARK-34543][SQL][3.0] Respect the `spark.sql.caseSensitive` config while resolving partition spec in v1 `SET LOCATION`

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #31672:
URL: https://github.com/apache/spark/pull/31672#issuecomment-787033009


   **[Test build #135536 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/135536/testReport)** for PR 31672 at commit [`961e851`](https://github.com/apache/spark/commit/961e8513a0287324a39b0ed7597676cf04cf0952).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #31672: [SPARK-34543][SQL][3.0] Respect the `spark.sql.caseSensitive` config while resolving partition spec in v1 `SET LOCATION`

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31672:
URL: https://github.com/apache/spark/pull/31672#issuecomment-787066258


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/135536/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun closed pull request #31672: [SPARK-34543][SQL][3.0] Respect the `spark.sql.caseSensitive` config while resolving partition spec in v1 `SET LOCATION`

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun closed pull request #31672:
URL: https://github.com/apache/spark/pull/31672


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org