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 2019/07/28 05:48:28 UTC
[GitHub] [incubator-druid] sashidhar opened a new issue #8180: Druid SQL
FLOOR time function should support all the time units it shows in error
messages
sashidhar opened a new issue #8180: Druid SQL FLOOR time function should support all the time units it shows in error messages
URL: https://github.com/apache/incubator-druid/issues/8180
### Affected Version
Druid version 0.15.0 (and probably all other previous versions)
### Description
Run the below query
`SELECT FLOOR(CURRENT_TIMESTAMP TO XYZ) from wikipedia limit 1;`
It returns the following error message:
`Unknown exception / Encountered "TO XYZ" at line 1, column 47. Was expecting one of: ")" ... "NOT" ... "IN" ... "<" ... "<=" ... ">" ... ">=" ... "=" ... "<>" ... "!=" ... "BETWEEN" ... "LIKE" ... "SIMILAR" ... "+" ... "-" ... "*" ... "/" ... "%" ... "||" ... "AND" ... "OR" ... "IS" ... "MEMBER" ... "SUBMULTISET" ... "CONTAINS" ... "OVERLAPS" ... "EQUALS" ... "PRECEDES" ... "SUCCEEDS" ... "IMMEDIATELY" ... "MULTISET" ... "[" ... "(" ... "TO" "MICROSECOND" ... "TO" "MILLISECOND" ... "TO" "SECOND" ... "TO" "MINUTE" ... "TO" "HOUR" ... "TO" "DAY" ... "TO" "DOW" ... "TO" "DOY" ... "TO" "ISODOW" ... "TO" "ISOYEAR" ... "TO" "WEEK" ... "TO" "MONTH" ... "TO" "QUARTER" ... "TO" "YEAR" ... "TO" "EPOCH" ... "TO" "DECADE" ... "TO" "CENTURY" ... "TO" "MILLENNIUM" ... / org.apache.calcite.sql.parser.SqlParseException`
FLOOR function doesn't support these time units mentioned in the above error message - MICROSECOND, MILLISECOND, DOW, DOY, ISODOW, ISOYEAR, EPOCH, DECADE, CENTURY and MILLENNIUM
For example,
`SELECT FLOOR(CURRENT_TIMESTAMP TO MICROSECOND) from wikipedia limit 1;`
returns
Unknown exception / Cannot build plan for query: SELECT * FROM (SELECT FLOOR(CURRENT_TIMESTAMP TO MICROSECOND) from wikipedia limit 1) LIMIT 5000 / org.apache.druid.java.util.common.ISE
`SELECT FLOOR(CURRENT_TIMESTAMP TO ISOYEAR) from wikipedia limit 1;`
returns
`Unknown exception / ISOYEAR / org.apache.calcite.sql.parser.SqlParseException`
Found this while playing around with FLOOR function on the lines of #7935.
----------------------------------------------------------------
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
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org