kgyrtkirk commented on a change in pull request #2872:
URL: https://github.com/apache/hive/pull/2872#discussion_r769317236



##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/views/HiveAggregateInsertDeleteIncrementalRewritingRule.java
##########
@@ -139,7 +139,14 @@ protected IncrementalComputePlanWithDeletedRows 
createJoinRightInput(RelOptRuleC
       switch (aggregateCall.getAggregation().getKind()) {
         case COUNT:
           aggFunction = SqlStdOperatorTable.SUM;
-          argument = relBuilder.literal(1);
+
+          // count(*)
+          if (aggregateCall.getArgList().isEmpty()) {
+            argument = relBuilder.literal(1);
+          } else {
+            // count(<column_name>)
+            argument = genArgumentForCountColumn(relBuilder, rexBuilder, 
aggInput, aggregateCall);

Review comment:
       notes: I think you could access `rexBuilder` from `relBuilder`
   
   I think you could also push the encolsing `if` into this function; or inline 
the whole function - but right now you have some "count argument" related logic 
here and there too




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