suneet-s commented on a change in pull request #9337: Fix timestamp extract fn
to match postgreSQL
URL: https://github.com/apache/druid/pull/9337#discussion_r377862471
##########
File path:
processing/src/main/java/org/apache/druid/query/expression/TimestampExtractExprMacro.java
##########
@@ -141,13 +141,13 @@ public ExprEval eval(final ObjectBinding bindings)
return ExprEval.of(dateTime.year().get());
case DECADE:
// The year field divided by 10, See
https://www.postgresql.org/docs/10/functions-datetime.html
- return ExprEval.of(Math.floor(dateTime.year().get() / 10));
+ return ExprEval.of(dateTime.year().get() / 10);
Review comment:
I decided it might be better not to support BC.
Since in ISO format, the date needs to be specified like `-0100-12-31` to
signify the year `0101-12-31 BC` This would make the code complicated for a use
case that is likely never to happen 🤞
----------------------------------------------------------------
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]