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 2020/02/27 23:14:45 UTC

[GitHub] [druid] clintropolis commented on a change in pull request #9429: fix issue when distinct grouping dimensions are optimized into the same virtual column expression

clintropolis commented on a change in pull request #9429: fix issue when distinct grouping dimensions are optimized into the same virtual column expression
URL: https://github.com/apache/druid/pull/9429#discussion_r385425359
 
 

 ##########
 File path: sql/src/main/java/org/apache/druid/sql/calcite/aggregation/DimensionExpression.java
 ##########
 @@ -28,6 +28,7 @@
 
 public class DimensionExpression
 {
+  private final String inputDimension;
 
 Review comment:
   Heh, I initially had it named `inputColumn` but changed to `inputDimension` to match the `DimensionSpec` which it creates.
   
   However, since this field _actually_ is only used when creating a `DimensionSpec` when the `DimensionExpression` is for a virtual column, I have renamed the field to `virtualColumn`. When a `DimensionExpression` is a direct access or simple extraction, we use `expression.getSimpleExtraction().toDimensionSpec` to craft the `DimensionSpec` instead, so this field is ignored.
   
   To help clarify this, i collapsed the constructors into a single private constructor and made static methods `DimensionExpression.ofSimpleColumn` and `DimensionExpression.ofVirtualColumn` for creating the two types of `DimensionExpression` we have, as per your other comment, which I think helps clear up usage.

----------------------------------------------------------------
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@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org