bziobrowski commented on code in PR #14388:
URL: https://github.com/apache/pinot/pull/14388#discussion_r1829262997


##########
pinot-core/src/main/java/org/apache/pinot/core/operator/query/NonScanBasedAggregationOperator.java:
##########
@@ -153,26 +154,30 @@ protected AggregationResultsBlock getNextBlock() {
   private static Double getMinValue(DataSource dataSource) {
     Dictionary dictionary = dataSource.getDictionary();
     if (dictionary != null) {
-      return toDouble(dictionary.getMinVal());
+      return toDouble(dictionary.getMinVal(), dataSource);
     }
-    return toDouble(dataSource.getDataSourceMetadata().getMinValue());
+    return toDouble(dataSource.getDataSourceMetadata().getMinValue(), 
dataSource);
   }
 
   private static Double getMaxValue(DataSource dataSource) {
     Dictionary dictionary = dataSource.getDictionary();
     if (dictionary != null) {
-      return toDouble(dictionary.getMaxVal());
+      return toDouble(dictionary.getMaxVal(), dataSource);
     }
-    return toDouble(dataSource.getDataSourceMetadata().getMaxValue());
+    return toDouble(dataSource.getDataSourceMetadata().getMaxValue(), 
dataSource);
   }
 
-  private static Double toDouble(Comparable<?> value) {
-    if (value instanceof Double) {
-      return (Double) value;
-    } else if (value instanceof Number) {
-      return ((Number) value).doubleValue();
-    } else {
-      return Double.parseDouble(value.toString());
+  private static Double toDouble(Comparable<?> value, DataSource dataSource) {

Review Comment:
   I guess so but I'm not sure how sensitive the place and tried to minimize 
potential overhead. 



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