drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Venkata krishnan Sowrirajan (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-2738) Offset with casting a column to timestamp not working
Date Fri, 10 Apr 2015 21:34:12 GMT

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

Venkata krishnan Sowrirajan commented on DRILL-2738:

May I know why SQL doesn't guarantee this query? Should this query be re-written like below
(casting column[0] as timestamp with a subquery offsetting the first row)

"select cast(columns[0] as timestamp) `t`, * from (select * from `guts-csv/CSV/guts_run_lab-app002.csv`
offset 1);"

> Offset with casting a column to timestamp not working
> -----------------------------------------------------
>                 Key: DRILL-2738
>                 URL: https://issues.apache.org/jira/browse/DRILL-2738
>             Project: Apache Drill
>          Issue Type: Bug
>    Affects Versions: 0.7.0
>            Reporter: Venkata krishnan Sowrirajan
> In the below query, it should skip the first row which is a header and want to cast one
of the column to timestamp. But it is trying to parse the first row to cast it to timestamp.
Without casting it to timestamp, simple offset query works fine.
> "select cast(columns[0] as timestamp) from `guts-csv/CSV/guts_run_lab-app002.csv` offset
> So I did explain plan on the above query
> explain plan without implementation for select cast(columns[0] as timestamp) from `guts-csv/CSV/guts_run_lab-app002.csv`
offset 1;
> DrillScreenRel
>   DrillLimitRel(offset=[1])
>     DrillProjectRel(EXPR$0=[CAST(ITEM($0, 0)):TIMESTAMP(0)])
>       DrillScanRel(table=[[fs, drill, guts-csv/CSV/guts_run_lab-app002.csv]], groupscan=[EasyGroupScan
[selectionRoot=/mapr/yarn-test/drill/guts-csv/CSV/guts_run_lab-app002.csv, numFiles=1, columns=[`columns`[0]],
> In the plan, it looks like it tries to do casting to timestamp and then the offset operation
which is why its failing.

This message was sent by Atlassian JIRA

View raw message