Jackie-Jiang commented on issue #4740: [New Transformation function] Presto compatible DateTrunc URL: https://github.com/apache/incubator-pinot/pull/4740#issuecomment-547159128 @agrawaldevesh Thanks for the explanation. IMO, `date_trunc()` should not have any knowledge of the timezone, but only truncate the time based on the given timestamp. Given the input value, `date_trunc()` should be able to figure out the input granularity automatically, and truncate it to the specified truncation interval. With these, we can achieve the standard `date_trunc()` semantic with only 2 arguments, e.g. `date_trunc('DAYS', timestamp)`. Then the missing part is a timezone conversion function from arbitrary timezone & value to a timestamp in another timezone. The time value can be of numeric type or string type (e.g. DateTimeFormat). With these 2 functions de-coupled and chain-able, it becomes much more flexible. We can support timestamp/DateTimeFormat input in any timezone, and return truncated timestamp in another timezone. Also, we have the standard semantic for `date_trunc()` function. What do you think? Does this proposal meet all the requirements for the Presto connector?
---------------------------------------------------------------- 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: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
