You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/10/19 07:37:22 UTC

[GitHub] [druid] dulu98k edited a comment on issue #11695: SQL with "timestamp - interval '100' day" returns 400 error

dulu98k edited a comment on issue #11695:
URL: https://github.com/apache/druid/issues/11695#issuecomment-946443058


   I found something interesting before submit my PR to override default precision, the precision of the query is actually tunable in the query
   First to reproduce the issue:
   <img width="1315" alt="image" src="https://user-images.githubusercontent.com/14854898/137840214-bbc7e5c8-6d6f-4442-b91a-aa56f899a40f.png">
   In short simply specify the precision to 3 when you have three digits would solve the problem.
   <img width="1532" alt="image" src="https://user-images.githubusercontent.com/14854898/137840344-70daebae-55d0-43ca-aea8-bc142dcc2a58.png">
   
   To change the default precision in `DruidTypeSystem` seems more complicated , calcite does not seems to provide a good way for others to inject a typesystem, it is expecting the singleton `RelDataTypeSystemImpl` everywhere, for example:
   https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/sql/parser/SqlParserUtil.java#L240
   https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/jdbc/CalciteConnectionImpl.java#L135
   I got similar errors even though I overrided `getDefaultPrecision` in `DruidTypeSystem` because `DruidTypeSystem` does not always get picked up in Calcite, it sounds more like a issue in Calcite than in Druid though.
   
   Maybe I`m not familiar enough with calcite behaviors,  any suggestion would be appreciate! @FrankChen021 


-- 
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-unsubscribe@druid.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org