abhishekagarwal87 commented on a change in pull request #10338:
URL: https://github.com/apache/druid/pull/10338#discussion_r483478720



##########
File path: 
processing/src/main/java/org/apache/druid/query/aggregation/any/StringAnyAggregatorFactory.java
##########
@@ -77,6 +81,33 @@ public BufferAggregator 
factorizeBuffered(ColumnSelectorFactory metricFactory)
     return new 
StringAnyBufferAggregator(metricFactory.makeColumnValueSelector(fieldName), 
maxStringBytes);
   }
 
+  @Override
+  public StringAnyVectorAggregator factorizeVector(VectorColumnSelectorFactory 
selectorFactory)
+  {
+
+    ColumnCapabilities capabilities = 
selectorFactory.getColumnCapabilities(fieldName);
+    if (capabilities == null || 
capabilities.hasMultipleValues().isMaybeTrue()) {
+      return new StringAnyVectorAggregator(
+          null,
+          
selectorFactory.makeMultiValueDimensionSelector(DefaultDimensionSpec.of(fieldName)),
+          maxStringBytes
+      );
+    } else {
+      return new StringAnyVectorAggregator(
+          
selectorFactory.makeSingleValueDimensionSelector(DefaultDimensionSpec.of(fieldName)),
+          null,
+          maxStringBytes
+      );
+    }
+  }
+
+  @Override
+  public boolean canVectorize(ColumnInspector columnInspector)
+  {
+    ColumnCapabilities capabilities = 
columnInspector.getColumnCapabilities(fieldName);
+    return capabilities == null || capabilities.getType() == ValueType.STRING;

Review comment:
       out of curiosity, when can `capabilities` be 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.

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