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 2021/12/06 19:35:12 UTC

[GitHub] [druid] clintropolis commented on a change in pull request #12025: fix issues with multi-value string constant expressions

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



##########
File path: processing/src/main/java/org/apache/druid/segment/DimensionSelector.java
##########
@@ -164,6 +166,27 @@ static DimensionSelector constant(@Nullable final String value, @Nullable final
     }
   }
 
+  static DimensionSelector multiConstant(@Nullable final List<String> values)
+  {
+    if (values == null || values.isEmpty()) {
+      return NullDimensionSelectorHolder.NULL_DIMENSION_SELECTOR;
+    } else {
+      return new ConstantMultiValueDimensionSelector(values);
+    }
+  }
+
+  static DimensionSelector multiConstant(@Nullable final List<String> values, @Nullable final ExtractionFn extractionFn)
+  {
+    if (extractionFn == null) {
+      return multiConstant(values);
+    } else {
+      if (values == null) {
+        return constant(extractionFn.apply(null));

Review comment:
       i originally had it like that, but am unsure if `null` and `[null]` are _actually_ the same thing. From the perspective of grouping, they are identical I guess so it probably doesn't matter. To me the most correct thing would be to _not_ apply the extraction at all and just make it a constant null and not a list with a null, but those are sort of the same thing for string columns currently...




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