lthoulon-locala opened a new issue, #12681:
URL: https://github.com/apache/druid/issues/12681

   ### Affected Version
   
   0.22.1
   
   ### Description
   
   All the following queries work
   ```
   SELECT CAST(13370000 AS DOUBLE) * '1e-7'
   SELECT CAST(13370000 AS DOUBLE) / '1e6'
   SELECT CAST(13370000 AS DOUBLE) / 10000000.0
   ```
   
   This one doesn't
   ```
   SELECT CAST(13370000 AS DOUBLE) / '1e7'
   ```
   
   The druid query UI gives me:
   ```
   Error: Unknown exception
   
   For input string: "1.0E"
   
   java.lang.NumberFormatException
   ```
   
   With another query using an actual datasource:
   ```
   SELECT CAST(SUM(my_field) AS DOUBLE) / '1e7'
   FROM "my-datasource"
   ```
   I get this error:
   
   ```
   Error: Unknown exception
   
   Error while applying rule DruidQueryRule(AGGREGATE_PROJECT), args 
[rel#35369:LogicalProject.NONE.[](input=RelSubset#35368,EXPR$0=/(CAST($0):DOUBLE,
 1.0E7)), 
rel#35381:DruidQueryRel.NONE.[](query={"queryType":"timeseries","dataSource":{"type":"table","name":"my-datasource"},"intervals":{"type":"intervals","intervals":["-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z"]},"descending":false,"virtualColumns":[],"filter":null,"granularity":{"type":"all"},"aggregations":[{"type":"longSum","name":"a0","fieldName":"my_field","expression":null}],"postAggregations":[],"limit":2147483647,"context":{"sqlOuterLimit":101,"sqlQueryId":"a8b4f43d-44b2-4419-bfc0-edefde1a2bb1"}},signature={a0:LONG})]
   
   java.lang.RuntimeException
   ```
   
   Not sure what is happening here. I have a workaround but still, seems fishy.
   Thanks


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