saurabhd336 opened a new pull request, #12524:
URL: https://github.com/apache/pinot/pull/12524

   For a json column `myJsonCol` with values like
   ```
   {"values": [1, 2, 3, 4, 5]}
   ```
   
   ```
   select summv(json_extract_scalar(myJsonCol, '$.values[0:3]', 'INT_ARRAY')) 
from wxcc_agent_activity limit 10
   ```
   
   Fails with
   ```
   Error Code: 200
   
   QueryExecutionError:
   java.lang.ClassCastException: class java.lang.Integer cannot be cast to 
class java.lang.Double (java.lang.Integer and java.lang.Double are in module 
java.base of loader 'bootstrap')
        at 
org.apache.pinot.core.common.evaluators.DefaultJsonPathEvaluator.processList(DefaultJsonPathEvaluator.java:633)
        at 
org.apache.pinot.core.common.evaluators.DefaultJsonPathEvaluator.evaluateBlock(DefaultJsonPathEvaluator.java:381)
        at 
org.apache.pinot.core.common.DataFetcher$ColumnValueReader.readDoubleValuesMV(DataFetcher.java:724)
        at 
org.apache.pinot.core.common.DataFetcher.fetchDoubleValues(DataFetcher.java:385)
   ```
   
   This is because the implicit cast to `List<>` class when performing the 
`read(_jsonPath)` operation is not enough to correctly convert the data types. 
This PR fixes this behaviour by passing explicit TypeRef objects to `read` when 
reading json arrays.


-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to