SourabhBadhya commented on code in PR #4571:
URL: https://github.com/apache/hive/pull/4571#discussion_r1299688049


##########
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java:
##########
@@ -7493,9 +7507,17 @@ protected Operator genFileSinkPlan(String dest, QB qb, 
Operator input)
 
       // Add NOT NULL constraint check
       input = genConstraintsPlan(dest, qb, input);
+      if (destinationTable.getStorageHandler() != null && 
destinationTable.getStorageHandler().alwaysUnpartitioned()) {
+        partSpec = qbm.getPartSpecForAlias(dest);
+      }
 
       if (!qb.getIsQuery()) {
-        input = genConversionSelectOperator(dest, qb, input, 
destinationTable.getDeserializer(), dpCtx, null, destinationTable);
+        if (!updating(dest) && !deleting(dest)) {
+          input = genConversionSelectOperatorByAddPartition(dest, qb, input,
+                  destinationTable.getDeserializer(), destinationTable, 
partSpec);
+        }
+        input = genConversionSelectOperator(dest, qb, input, 
destinationTable.getDeserializer(), dpCtx, null,
+                destinationTable);

Review Comment:
   @kasakrisz The idea is to isolate the addition of partition column into the 
operator with other set of conditions.



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