deniskuzZ commented on code in PR #5512:
URL: https://github.com/apache/hive/pull/5512#discussion_r1813281712


##########
ql/src/java/org/apache/hadoop/hive/ql/parse/ImportSemanticAnalyzer.java:
##########
@@ -772,10 +772,7 @@ we use isExternal and not tableType() method since that 
always gives type as man
         tgtPath = new Path(table.getDataLocation().toString(),
             Warehouse.makePartPath(partSpec.getPartSpec()));
       } else {
-        Database parentDb = x.getHive().getDatabase(tblDesc.getDatabaseName());
-        tgtPath = new Path(
-            wh.getDefaultTablePath( parentDb, tblDesc.getTableName(), 
tblDesc.isExternal()),
-            Warehouse.makePartPath(partSpec.getPartSpec()));
+        tgtPath = new Path(getTableDataLocation(wh, tblDesc, x), 
Warehouse.makePartPath(partSpec.getPartSpec()));

Review Comment:
   why don't you store data location into `tablePath` and extract from all the 
brances method for building the part path
   ````
   tgtPath = new Path(tablePath, Warehouse.makePartPath(partSpec.getPartSpec()))
   ````
   



-- 
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: gitbox-unsubscr...@hive.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to