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



##########
File path: 
processing/src/main/java/org/apache/druid/segment/incremental/IncrementalIndex.java
##########
@@ -1135,21 +1117,21 @@ public MetricDesc(int index, AggregatorFactory factory)
       this.index = index;
       this.name = factory.getName();
 
-      String typeInfo = factory.getTypeName();
-      if ("float".equalsIgnoreCase(typeInfo)) {
-        capabilities = 
ColumnCapabilitiesImpl.createSimpleNumericColumnCapabilities(ValueType.FLOAT);
-        this.type = typeInfo;
-      } else if ("long".equalsIgnoreCase(typeInfo)) {
-        capabilities = 
ColumnCapabilitiesImpl.createSimpleNumericColumnCapabilities(ValueType.LONG);
-        this.type = typeInfo;
-      } else if ("double".equalsIgnoreCase(typeInfo)) {
-        capabilities = 
ColumnCapabilitiesImpl.createSimpleNumericColumnCapabilities(ValueType.DOUBLE);
-        this.type = typeInfo;
+      ValueType valueType = factory.getType();
+
+      if (valueType.isPrimitive()) {

Review comment:
       Maybe throw an error that this kind of AggregatorFactory isn't supported 
at ingestion time?
   
   I don't think there's a use case for it with any of the builtin aggregators. 
So we can worry about it when one comes up.

##########
File path: 
processing/src/main/java/org/apache/druid/segment/incremental/IncrementalIndex.java
##########
@@ -1135,21 +1117,21 @@ public MetricDesc(int index, AggregatorFactory factory)
       this.index = index;
       this.name = factory.getName();
 
-      String typeInfo = factory.getTypeName();
-      if ("float".equalsIgnoreCase(typeInfo)) {
-        capabilities = 
ColumnCapabilitiesImpl.createSimpleNumericColumnCapabilities(ValueType.FLOAT);
-        this.type = typeInfo;
-      } else if ("long".equalsIgnoreCase(typeInfo)) {
-        capabilities = 
ColumnCapabilitiesImpl.createSimpleNumericColumnCapabilities(ValueType.LONG);
-        this.type = typeInfo;
-      } else if ("double".equalsIgnoreCase(typeInfo)) {
-        capabilities = 
ColumnCapabilitiesImpl.createSimpleNumericColumnCapabilities(ValueType.DOUBLE);
-        this.type = typeInfo;
+      ValueType valueType = factory.getType();
+
+      if (valueType.isPrimitive()) {

Review comment:
       How about throwing an error that this kind of AggregatorFactory isn't 
supported at ingestion time?
   
   I don't think there's a use case for it with any of the builtin aggregators. 
So we can worry about it when one comes up.




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