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/11/23 06:49:15 UTC

[GitHub] [spark] wankunde opened a new pull request, #38765: [SPARK-35531][SQL][FOLLOWUP] Support alter table command with CASE_SENSITIVE is true

wankunde opened a new pull request, #38765:
URL: https://github.com/apache/spark/pull/38765

   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
     2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
     7. If you want to add a new configuration, please read the guideline first for naming configurations in
        'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
     8. If you want to add or modify an error type or message, please read the guideline first in
        'core/src/main/resources/error/README.md'.
   -->
   
   ### What changes were proposed in this pull request?
   
   Restore dbName and tableName in `HiveShim.getTable()` method.
   
   When we create a hive table, hive will convert the dbName and tableName in lower case: https://github.com/apache/hive/blob/release-2.3.9-rc0/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java#L1446-L1482
   
   And then throw an exception in `Hive. alterTable()`:
   
   https://github.com/apache/hive/blob/release-2.3.9-rc0/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java#L623
   
   ### Why are the changes needed?
   
   Bug fix for alter table command.
   
   
   ### Does this PR introduce _any_ user-facing change?
   
   No
   
   ### How was this patch tested?
   
   Add UT
   


-- 
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 #38765: [SPARK-41355][SQL] Workaround hive table name validation issue

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

   @wankunde can you put https://github.com/apache/spark/pull/38765#issuecomment-1332326017 in the PR description? This helps people to understand what the bug is.


-- 
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] wankunde commented on pull request #38765: [SPARK-41355][SQL] Workaround hive table name validation issue

Posted by GitBox <gi...@apache.org>.
wankunde commented on PR #38765:
URL: https://github.com/apache/spark/pull/38765#issuecomment-1335373834

   > @wankunde can you put [#38765 (comment)](https://github.com/apache/spark/pull/38765#issuecomment-1332326017) in the PR description? This helps people to understand what the bug is.
   
   Done, Thanks for your review.


-- 
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 #38765: [SPARK-41355][SQL] Workaround hive table name validation issue

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

   thanks, merging to master!


-- 
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] wankunde commented on pull request #38765: [SPARK-35531][SQL][FOLLOWUP] Support alter table command with CASE_SENSITIVE is true

Posted by GitBox <gi...@apache.org>.
wankunde commented on PR #38765:
URL: https://github.com/apache/spark/pull/38765#issuecomment-1326187449

   Hi, @cloud-fan @AngersZhuuuu Could you help me to review this PR? Thanks


-- 
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 #38765: [SPARK-35531][SQL][FOLLOWUP] Support alter table command with CASE_SENSITIVE is true

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

   > And then throw an exception in Hive.alterTable():
   
   Can you explain more on this part?


-- 
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 #38765: [SPARK-41355][SQL] Workaround hive table name validation issue

Posted by GitBox <gi...@apache.org>.
cloud-fan closed pull request #38765: [SPARK-41355][SQL] Workaround hive table name validation issue
URL: https://github.com/apache/spark/pull/38765


-- 
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] AmplabJenkins commented on pull request #38765: [SPARK-35531][SQL][FOLLOWUP] Support alter table command with CASE_SENSITIVE is true

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

   Can one of the admins verify this patch?


-- 
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] wankunde commented on pull request #38765: [SPARK-35531][SQL][FOLLOWUP] Support alter table command with CASE_SENSITIVE is true

Posted by GitBox <gi...@apache.org>.
wankunde commented on PR #38765:
URL: https://github.com/apache/spark/pull/38765#issuecomment-1332326017

   For example:
   * We want to create a table called `tAb_I`
   * Hive metastore will check if the table name is valid by `MetaStoreUtils.validateName(tbl.getTableName())`
   * Hive will call `HiveStringUtils.normalizeIdentifier(tbl.getTableName())` and then save the save the table name to lower case, **but after setting the local to "tr", it will be `tab_ı` which is not a valid table name**
   * When we run alter table command, we will first get the hive table from hive metastore which is not a valid table name.
   * Update some properties or other, and then try to save it to hive metastore.
   * Hive metastore will check if the table name is valid and then throw exception `org.apache.hadoop.hive.ql.metadata.HiveException: [tab_ı]: is not a valid table name`


-- 
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 #38765: [SPARK-35531][SQL][FOLLOWUP] Support alter table command with CASE_SENSITIVE is true

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

   @wankunde thanks for the explanation! I think this is rather a hive bug but we need to work around it in Spark. Is this a long-standing issue or a new regression? You marked the PR as a followup but I can't relly tell how they are related.


-- 
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] wankunde commented on pull request #38765: [SPARK-41355][SQL] Workaround hive table name validation issue

Posted by GitBox <gi...@apache.org>.
wankunde commented on PR #38765:
URL: https://github.com/apache/spark/pull/38765#issuecomment-1334656437

   This is a long-standing issue, create a new ticket to track this issue.


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