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



##########
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:
       What's the rationale behind doing this instead of 
`multiConstant(Collections.singletonList(extractionFn.apply(null))`?




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