You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Venkata krishnan Sowrirajan (JIRA)" <ji...@apache.org> on 2015/04/10 23:34:12 UTC

[jira] [Commented] (DRILL-2738) Offset with casting a column to timestamp not working

    [ 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 1;"
> 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]], files=[file:/mapr/yarn-test/drill/guts-csv/CSV/guts_run_lab-app002.csv]]])
> 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
(v6.3.4#6332)