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


##########
ql/src/java/org/apache/hadoop/hive/ql/parse/RewriteSemanticAnalyzer.java:
##########
@@ -117,18 +117,24 @@ protected void analyzeRewrittenTree(ASTNode 
rewrittenTree, Context rewrittenCtx)
    */
   protected void checkValidSetClauseTarget(ASTNode colName, Table targetTable) 
throws SemanticException {
     String columnName = normalizeColName(colName.getText());
-
     // Make sure this isn't one of the partitioning columns, that's not 
supported.
+    boolean foundColumnInTargetTable = false;
     for (FieldSchema fschema : targetTable.getPartCols()) {
       if (fschema.getName().equalsIgnoreCase(columnName)) {
+        if (targetTable.hasNonNativePartitionSupport()) {
+          foundColumnInTargetTable = true;
+          break;
+        }
         throw new 
SemanticException(ErrorMsg.UPDATE_CANNOT_UPDATE_PART_VALUE.getMsg());
       }
     }
     //updating bucket column should move row from one file to another - not 
supported
     if (targetTable.getBucketCols() != null && 
targetTable.getBucketCols().contains(columnName)) {
       throw new SemanticException(ErrorMsg.UPDATE_CANNOT_UPDATE_BUCKET_VALUE, 
columnName);
     }
-    boolean foundColumnInTargetTable = false;
+    if (foundColumnInTargetTable) {
+      return;
+    }
     for (FieldSchema col : targetTable.getCols()) {

Review Comment:
   targetTable.getAllCols()



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