You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2019/08/22 18:50:21 UTC

[GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #4550: Support transform functions with AVG aggregation function

Jackie-Jiang commented on a change in pull request #4550:  Support transform functions with AVG aggregation function
URL: https://github.com/apache/incubator-pinot/pull/4550#discussion_r316830401
 
 

 ##########
 File path: pinot-core/src/main/java/org/apache/pinot/core/operator/transform/function/AdditionTransformFunction.java
 ##########
 @@ -48,14 +49,33 @@ public void init(@Nonnull List<TransformFunction> arguments, @Nonnull Map<String
       throw new IllegalArgumentException("At least 2 arguments are required for ADD transform function");
     }
 
-    for (TransformFunction argument : arguments) {
-      if (argument instanceof LiteralTransformFunction) {
-        _literalSum += Double.parseDouble(((LiteralTransformFunction) argument).getLiteral());
+    checkOperands(arguments);
+  }
+
+  private void checkOperands(List<TransformFunction> operands) {
+    for (TransformFunction operand : operands) {
+      if (operand instanceof MapValueTransformFunction) {
 
 Review comment:
   Why it cannot work on map? When map returns single value, it should work right?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org