ayushtkn commented on code in PR #4453:
URL: https://github.com/apache/hive/pull/4453#discussion_r1245350582


##########
ql/src/java/org/apache/hadoop/hive/ql/parse/LoadSemanticAnalyzer.java:
##########
@@ -291,18 +291,43 @@ private void analyzeLoad(ASTNode ast) throws 
SemanticException {
           ErrorMsg.INVALID_PATH.getMsg(), fromTree, e.getMessage()), e);
     }
 
+    Map<String, String> tmpPartSpec = null;
+    Table table;
+    try {
+      table = 
db.getTable(HiveTableName.withNoDefault(getUnescapedName((ASTNode) 
tableTree.getChild(0))));
+    } catch (HiveException e) {
+      throw new SemanticException(
+          
ASTErrorUtils.getMsg(ErrorMsg.CANNOT_RETRIEVE_TABLE_METADATA.getMsg(), 
tableTree.getChild(0), e.getMessage()),
+          e);
+    }
+
+    if (tableTree.getChildCount() == 2 && table.isNonNative() && 
table.getStorageHandler() != null &&
+        table.getStorageHandler().supportsAppendData(table.getTTable(), true)) 
{
+      ASTNode partspec = (ASTNode) tableTree.getChild(1);
+      // partSpec is a mapping from partition column name to its value.
+      tmpPartSpec = new HashMap<String, String>(partspec.getChildCount());
+      for (int i = 0; i < partspec.getChildCount(); ++i) {
+        ASTNode partspec_val = (ASTNode) partspec.getChild(i);
+        String val = null;
+        String colName = 
unescapeIdentifier(partspec_val.getChild(0).getText().toLowerCase());
+        val = stripQuotes(partspec_val.getChild(1).getText());
+        tmpPartSpec.put(colName, val);
+        tableTree.deleteChild(1);

Review Comment:
   I was looking at some different stuff, thanx, have refactored to use the 
same. I wrote it myself, If I found it before, would have saved efforts :-( 



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to