richardstartin opened a new issue #8409:
URL: https://github.com/apache/pinot/issues/8409


   e.g. on airline stats when a dictionary can be used the operator just 
assumes the metadata is numeric, which causes a hard to diagnose NPE:
   
   ```sql
   select max(Carrier) from airlineStats
   ```
   
   ```
   [
     {
       "errorCode": 200,
       "message": "QueryExecutionError:\njava.lang.NumberFormatException: For 
input string: \"WN\"\n\tat 
java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)\n\tat
 
java.base/jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110)\n\tat
 java.base/java.lang.Double.parseDouble(Double.java:543)\n\tat 
org.apache.pinot.core.operator.query.DictionaryBasedAggregationOperator.toDouble(DictionaryBasedAggregationOperator.java:129)"
     },
     {
       "errorCode": 200,
       "message": "QueryExecutionError:\njava.lang.NumberFormatException: For 
input string: \"AA\"\n\tat 
java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)\n\tat
 
java.base/jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110)\n\tat
 java.base/java.lang.Double.parseDouble(Double.java:543)\n\tat 
org.apache.pinot.core.operator.query.DictionaryBasedAggregationOperator.toDouble(DictionaryBasedAggregationOperator.java:129)"
     }
   ]
   ```
   
   It's actually worse when the dictionary can't be used because it does some 
work before failing:
   
   ```sql
   select max(Carrier) from airlineStats where AirTime > 10
   ```
   
   
   ```
   [
     {
       "errorCode": 200,
       "message": "QueryExecutionError:\njava.lang.IllegalStateException: 
Cannot compute max for non-numeric type: STRING\n\tat 
org.apache.pinot.core.query.aggregation.function.MaxAggregationFunction.aggregate(MaxAggregationFunction.java:96)\n\tat
 
org.apache.pinot.core.query.aggregation.DefaultAggregationExecutor.aggregate(DefaultAggregationExecutor.java:47)\n\tat
 
org.apache.pinot.core.operator.query.AggregationOperator.getNextBlock(AggregationOperator.java:70)\n\tat
 
org.apache.pinot.core.operator.query.AggregationOperator.getNextBlock(AggregationOperator.java:38)"
     },
     {
       "errorCode": 200,
       "message": "QueryExecutionError:\njava.lang.NumberFormatException: For 
input string: \"MQ\"\n\tat 
java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)\n\tat
 
java.base/jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110)\n\tat
 java.base/java.lang.Double.parseDouble(Double.java:543)\n\tat 
org.apache.pinot.core.operator.query.DictionaryBasedAggregationOperator.toDouble(DictionaryBasedAggregationOperator.java:129)"
     }
   ]
   ```
   
   Postgres can produce the max over a string column so aggregation functions 
should not assume the result is a double, but while it does make this 
assumption, type checking should be done early.


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