mmcentre opened a new issue #11441:
URL: https://github.com/apache/druid/issues/11441


   An SQL query (generated by Tableau), translated into timeseries native 
query, returns an invalid value for a column. When used with Avatica Calcite 
JDBC driver, causes (java.lang.ClassCastException) getting value for: 1/1 
(java.lang.Double: X): java.lang.ClassCastException
   
   ### Affected Version
   
   0.20.2, 0.21.1
   
   ### Description
   
   We use a single VM deployment with a custom configuration, however we have 
reproduced the issue in multiple versions and configurations, including nano. 
We believe the problem is independent of the cluster size.
   
   The following SQL query, simplified from a query generated by Tableau, 
returns an invalid value for the column:
   
   ```
   SELECT
       AVG (CASE
           WHEN 60000 = 0
               THEN NULL
           ELSE 
                CAST (__time AS FLOAT)/60000
           END) AS X
   FROM 
       any_table
   ```
   
   returns invalid value (Infinity) for the column. Any attempt to further 
simplify the query eliminates the error.
   
   Modifying the query as:
   
   ```
   SELECT
       AVG (CASE 
           WHEN 60000 = 0 
           THEN 0
           ELSE CAST (__time AS FLOAT) / 60000
       END) AS X
   FROM
       any_table
   
   ``` 
   returns valid value, though changing NULL to 0 should not affect the result 
(because 60000 never equals to 0).
   
   
   
   


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