[ 
https://issues.apache.org/jira/browse/DRILL-2388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17368733#comment-17368733
 ] 

benj commented on DRILL-2388:
-----------------------------

It's painful to do 
{noformat}
SELECT extract(hour FROM a) * 3600 + extract(minute FROM a) * 60 + 
extract(second FROM a) AS seconds
FROM CAST('00:02:03' AS time)
{noformat}

instead of 
{noformat}
SELECT extract(epoch FROM a) AS seconds
FROM CAST('00:02:03' AS time)
{noformat}

maybe epoch is a good solution or why not seconds (with a "s")


> support extract(epoch) 
> -----------------------
>
>                 Key: DRILL-2388
>                 URL: https://issues.apache.org/jira/browse/DRILL-2388
>             Project: Apache Drill
>          Issue Type: Improvement
>          Components: SQL Parser
>    Affects Versions: 0.8.0
>            Reporter: Chun Chang
>            Priority: Minor
>             Fix For: Future
>
>
> Postgres supports the following:
> {code}
> SELECT extract(epoch FROM now());
> {code}
> Drill will error:
> {code}
> 0: jdbc:drill:schema=dfs.drillTestDirComplexJ> SELECT extract(epoch FROM 
> now()) from sys.drillbits;
> Query failed: ParseException: Encountered "epoch" at line 1, column 16.
> Was expecting one of:
>     "YEAR" ...
>     "MONTH" ...
>     "DAY" ...
>     "HOUR" ...
>     "MINUTE" ...
>     "SECOND" ...
> Error: exception while executing query: Failure while executing query. 
> (state=,code=0)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to