You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2022/02/10 05:04:26 UTC

[GitHub] [druid] clintropolis commented on a change in pull request #12251: use virtual columns for sql simple aggregators instead of inline expressions

clintropolis commented on a change in pull request #12251:
URL: https://github.com/apache/druid/pull/12251#discussion_r803304066



##########
File path: sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/AvgSqlAggregator.java
##########
@@ -115,9 +115,13 @@ public Aggregation toDruidAggregation(
           project,
           Iterables.getOnlyElement(aggregateCall.getArgList())
       );
-      String vc = virtualColumnRegistry.getVirtualColumnByExpression(arg, resolutionArg.getType());
-      fieldName = vc != null ? vc : null;
-      expression = vc != null ? null : arg.getExpression();
+      if (arg.getType() == DruidExpression.NodeType.LITERAL) {

Review comment:
       i did consolidate this into a static method in `SimpleSqlAggregator` while you were typing this comment, I haven't really decided on baking it into `VirtualColumnRegistry` in some way yet though, will think about it some more.




-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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