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 2022/02/21 05:14:59 UTC

[GitHub] [spark] bozhang2820 opened a new pull request #35591: [SPARK-38236][SQL][3.2] Treat table location as absolute when the first letter of its path is slash in create/alter table

bozhang2820 opened a new pull request #35591:
URL: https://github.com/apache/spark/pull/35591


   ### What changes were proposed in this pull request?
   After https://github.com/apache/spark/pull/28527, we change to create table under the database location when the table location is relative. However the criteria to determine if a table location is relative/absolute is `URI.isAbsolute`, which basically checks if the table location URI has a scheme defined. So table URIs like `/table/path` are treated as relative and the scheme and authority of the database location URI are used to create the table. For example, when the database location URI is `s3a://bucket/db`, the table will be created at `s3a://bucket/table/path`, while it should be created under the file system defined in `SessionCatalog.hadoopConf` instead.
   
   This change fixes that by treating table location as absolute when the first letter of its path is slash.
   
   This also applies to alter table.
   
   ### Why are the changes needed?
   This is to fix the behavior described above. 
   
   ### Does this PR introduce _any_ user-facing change?
   Yes. When users try to create/alter a table with a location that starts with a slash but without a scheme defined, the table will be created under/altered to the file system defined in `SessionCatalog.hadoopConf`, instead of the one defined in the database location URI.
   
   ### How was this patch tested?
   Updated unit tests.


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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] bozhang2820 commented on pull request #35591: [SPARK-38236][SQL][3.2][3.1] Check if table location is absolute by "new Path(locationUri).isAbsolute" in create/alter table

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


   @cloud-fan should we merge this?


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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] cloud-fan closed pull request #35591: [SPARK-38236][SQL][3.2][3.1] Check if table location is absolute by "new Path(locationUri).isAbsolute" in create/alter table

Posted by GitBox <gi...@apache.org>.
cloud-fan closed pull request #35591:
URL: https://github.com/apache/spark/pull/35591


   


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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] cloud-fan commented on pull request #35591: [SPARK-38236][SQL][3.2][3.1] Check if table location is absolute by "new Path(locationUri).isAbsolute" in create/alter table

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on pull request #35591:
URL: https://github.com/apache/spark/pull/35591#issuecomment-1049555448


   thanks, merging to 3.2/3.1!


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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] bozhang2820 commented on pull request #35591: [SPARK-38236][SQL][3.2][3.1] Treat table location as absolute when the first letter of its path is slash in create/alter table

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


   The test failed with the linter issue described in https://issues.apache.org/jira/browse/SPARK-38279. 


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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] cloud-fan commented on pull request #35591: [SPARK-38236][SQL][3.2][3.1] Treat table location as absolute when the first letter of its path is slash in create/alter table

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on pull request #35591:
URL: https://github.com/apache/spark/pull/35591#issuecomment-1048368289


   can we rebase to trigger test again?


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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