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 2020/10/26 11:00:25 UTC

[GitHub] [druid] FrankChen021 edited a comment on issue #10530: Allow zero period for TIMESTAMPADD to help make Tableau operable

FrankChen021 edited a comment on issue #10530:
URL: https://github.com/apache/druid/issues/10530#issuecomment-716472662


   I made some investigation about this problem, and I think it should be a bug. 
   
   It's interesting that `TIMESTAMPADD` works fine with `DAY`, `MINUTE` when the 2nd parameter is zero, while `MONTH`, `YEAR` fail.
   
   Druid's internal implementation converts calling of `TIMESTAMPADD` to `TIME_SHIFT`, and its parameters are also converted to a type of `Period` which is accepted by the latter function. And the code dealing with `Period`, which checks period should not be zero mainly for query granularity,  are shared across the whole project. 
   
   While for the cases of `DAY` or `MINUTE`, Druid converts it to an integer value in milliseconds, which does not involve a `Period` object. This is also why the existing [UT test case](https://github.com/apache/druid/blob/f3a2903218573f5d336b082b1c9b8a60a19e8c54/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java#L11393) don't help to expose this bug.  
   
   @gianm what do you think ?


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

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