You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/05/10 15:17:00 UTC

[jira] [Work logged] (HIVE-24920) TRANSLATED_TO_EXTERNAL tables may write to the same location

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

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

                Author: ASF GitHub Bot
            Created on: 10/May/21 15:16
            Start Date: 10/May/21 15:16
    Worklog Time Spent: 10m 
      Work Description: nrg4878 commented on a change in pull request #2191:
URL: https://github.com/apache/hive/pull/2191#discussion_r629433082



##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetastoreDefaultTransformer.java
##########
@@ -85,6 +86,7 @@ public MetastoreDefaultTransformer(IHMSHandler handler) throws HiveMetaException
     this.hmsHandler = handler;
     this.defaultCatalog = MetaStoreUtils.getDefaultCatalog(handler.getConf());
     this.isTenantBasedStorage = hmsHandler.getConf().getBoolean(MetastoreConf.ConfVars.ALLOW_TENANT_BASED_STORAGE.getVarname(), false);
+    //    this.xMode = hmsHandler.getConf

Review comment:
       nit: delete please.

##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetastoreDefaultTransformer.java
##########
@@ -558,6 +566,39 @@ public MetastoreDefaultTransformer(IHMSHandler handler) throws HiveMetaException
     return ret;
   }
 
+  static enum TableLocationStrategy {
+    seqsuffix {
+      @Override
+      Path getLocation(IHMSHandler hmsHandler, Database db, Table table, int idx) throws MetaException {
+        if (idx == 0) {
+          return getDefaultPath(hmsHandler, db, table.getTableName());
+        }
+        return getDefaultPath(hmsHandler, db, table.getTableName() + "-" + idx);

Review comment:
       I have a mild concern about this convention. It might be confusing to use a suffix. would a prefix serve us better? with the latter scheme, the original table name can still be preserved?
   create table test;
   alter table rename test to test1;
   create table test; --> test is now at location test-0
   create table test-0; --> test-0 is now at location test-1 (would using 0_test-0 be better than using test-1?)

##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetastoreDefaultTransformer.java
##########
@@ -527,7 +532,9 @@ public MetastoreDefaultTransformer(IHMSHandler handler) throws HiveMetaException
               Partition newPartition = new Partition(partition);
               StorageDescriptor newSd = new StorageDescriptor(partition.getSd());
               if (!processorCapabilities.contains(ACCEPTSUNMODIFIEDMETADATA))
+               {

Review comment:
       nit: extra leading space.




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


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

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

> TRANSLATED_TO_EXTERNAL tables may write to the same location
> ------------------------------------------------------------
>
>                 Key: HIVE-24920
>                 URL: https://issues.apache.org/jira/browse/HIVE-24920
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Zoltan Haindrich
>            Assignee: Zoltan Haindrich
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> {code}
> create table t (a integer);
> insert into t values(1);
> alter table t rename to t2;
> create table t (a integer); -- I expected an exception from this command (location already exists) but because its an external table no exception
> insert into t values(2);
> select * from t;  -- shows 1 and 2
> drop table t2;    -- wipes out data location
> select * from t;  -- empty resultset
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)