[ 
https://issues.apache.org/jira/browse/HIVE-24949?focusedWorklogId=728698&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-728698
 ]

ASF GitHub Bot logged work on HIVE-24949:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 17/Feb/22 04:36
            Start Date: 17/Feb/22 04:36
    Worklog Time Spent: 10m 
      Work Description: dengzhhu653 commented on a change in pull request #2910:
URL: https://github.com/apache/hive/pull/2910#discussion_r808668174



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java
##########
@@ -9768,7 +9767,8 @@ private void writeMPartitionColumnStatistics(Table table, 
Partition partition,
 
       for (ColumnStatisticsObj statsObj : statsObjs) {
         MPartitionColumnStatistics mStatsObj =
-            
StatObjectConverter.convertToMPartitionColumnStatistics(mPartition, statsDesc, 
statsObj, colStats.getEngine());
+            
StatObjectConverter.convertToMPartitionColumnStatistics(mPartition, statsDesc, 
statsObj,
+                colStats.getEngine(), getDefaultCatalog(conf));

Review comment:
       you are right, fix as suggested, the `MPartition` is nullable here due 
to 
https://github.com/apache/hive/blob/baf8247af78f35a68fab0756f9d571c73cdf5f96/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/DirectSqlUpdateStat.java#L188-L192,
 fill the statsDesc with the catalog in this case: 
https://github.com/apache/hive/pull/2910/files#diff-f832bc7a00499f47169832b5ab5339dc879c994bfb955bd0c4b3ece6c236d9dcR186-R188
   Thank you for the 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 728698)
    Time Spent: 0.5h  (was: 20m)

> Fail to rename a partition with customized catalog
> --------------------------------------------------
>
>                 Key: HIVE-24949
>                 URL: https://issues.apache.org/jira/browse/HIVE-24949
>             Project: Hive
>          Issue Type: Bug
>          Components: Metastore, Standalone Metastore
>    Affects Versions: 3.1.2
>            Reporter: Yufei Gu
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> How to trigger it? 
>  1. Create a customized catalog in HMS 3.x
>  2. Run a sql like "ALTER TABLE student PARTITION (age='12') RENAME TO 
> PARTITION (age='15');"
> Error message:
> {code:java}
> spark-sql> ALTER TABLE student PARTITION (age='12') RENAME TO PARTITION 
> (age='15');
> Error in query: org.apache.hadoop.hive.ql.metadata.HiveException: Unable to 
> rename partition. Unable to alter partition because table or database does 
> not exist.;
> {code}
> We can fix if by replacing {{DEFAULT_CATALOG_NAME}} with {{catName}} in the 
> following 
> line([https://github.com/apache/hive/blob/a00621b49657da3d14bcb20bf9e49fea10dc9273/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveAlterHandler.java#L604])
> {code:java}
>  Table tbl = msdb.getTable(DEFAULT_CATALOG_NAME, dbname, name, null);
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to