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/06/16 22:39:33 UTC

[GitHub] [druid] suneet-s commented on a change in pull request #10026: All aggregators should check if column can be vectorize

suneet-s commented on a change in pull request #10026:
URL: https://github.com/apache/druid/pull/10026#discussion_r441181294



##########
File path: processing/src/main/java/org/apache/druid/query/aggregation/DoubleSumAggregatorFactory.java
##########
@@ -79,8 +81,12 @@ protected VectorValueSelector vectorSelector(VectorColumnSelectorFactory columnS
   }
 
   @Override
-  public boolean canVectorize()
+  public boolean canVectorize(ColumnCapabilitiesProvider columnCapabilitiesProvider)
   {
+    if (fieldName != null) {
+      final ColumnCapabilities originalCapabilities = columnCapabilitiesProvider.getColumnCapabilities(fieldName);
+      return expression == null && (originalCapabilities == null || originalCapabilities.getType().isNumeric());

Review comment:
       ColumnCapabilities#type is annotated as nullable. `originalCapabilities.getType().isNumeric()` could throw an NPE




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



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