You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Kunal Khatua (JIRA)" <ji...@apache.org> on 2018/01/16 00:25:00 UTC

[jira] [Updated] (DRILL-4611) Date plus interval fails with "failed to preserve datatype"

     [ https://issues.apache.org/jira/browse/DRILL-4611?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kunal Khatua updated DRILL-4611:
--------------------------------
    Summary: Date plus interval fails with "failed to preserve datatype"  (was: Date plus interval fails with "failed to preserve datatye")

> Date plus interval fails with "failed to preserve datatype"
> -----------------------------------------------------------
>
>                 Key: DRILL-4611
>                 URL: https://issues.apache.org/jira/browse/DRILL-4611
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Execution - Relational Operators
>            Reporter: Krystal
>            Priority: Major
>
> git.commit.id.abbrev=e4725ea
> Adding date with interval using + operator fails.
> {code}
> select to_date('2017-02-01', 'YYYY-MM-dd') +  interval '1' MONTH from `dfs.drillTestDirP1`.voter limit 1;
> Error: SYSTEM ERROR: AssertionError: Internal error: Conversion to relational algebra failed to preserve datatypes:
> validated type:
> RecordType(TIMESTAMP(0) NOT NULL EXPR$0) NOT NULL
> converted type:
> RecordType(DATE NOT NULL EXPR$0) NOT NULL
> rel:
> LogicalSort(fetch=[1])
>   LogicalProject(EXPR$0=[DATETIME_PLUS(TO_DATE('2017-02-01', 'YYYY-MM-dd'), 1)])
>     LogicalTableScan(table=[[dfs.drillTestDirP1, voter]])
> [Error Id: db89b909-22ff-401f-82fe-a57df955c426 on qa-node115.qa.lab:31010]
>   (org.apache.drill.exec.work.foreman.ForemanException) Unexpected exception during fragment initialization: Internal error: Conversion to relational algebra failed to preserve datatypes:
> validated type:
> RecordType(TIMESTAMP(0) NOT NULL EXPR$0) NOT NULL
> converted type:
> RecordType(DATE NOT NULL EXPR$0) NOT NULL
> rel:
> LogicalSort(fetch=[1])
>   LogicalProject(EXPR$0=[DATETIME_PLUS(TO_DATE('2017-02-01', 'YYYY-MM-dd'), 1)])
>     LogicalTableScan(table=[[dfs.drillTestDirP1, voter]])
>     org.apache.drill.exec.work.foreman.Foreman.run():262
>     java.util.concurrent.ThreadPoolExecutor.runWorker():1145
>     java.util.concurrent.ThreadPoolExecutor$Worker.run():615
>     java.lang.Thread.run():745
>   Caused By (java.lang.AssertionError) Internal error: Conversion to relational algebra failed to preserve datatypes:
> validated type:
> RecordType(TIMESTAMP(0) NOT NULL EXPR$0) NOT NULL
> converted type:
> RecordType(DATE NOT NULL EXPR$0) NOT NULL
> rel:
> LogicalSort(fetch=[1])
>   LogicalProject(EXPR$0=[DATETIME_PLUS(TO_DATE('2017-02-01', 'YYYY-MM-dd'), 1)])
>     LogicalTableScan(table=[[dfs.drillTestDirP1, voter]])
>     org.apache.calcite.util.Util.newInternal():777
>     org.apache.calcite.sql2rel.SqlToRelConverter.checkConvertedType():435
>     org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery():541
>     org.apache.drill.exec.planner.sql.SqlConverter.toRel():246
>     org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.convertToRel():616
>     org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateAndConvert():195
>     org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan():164
>     org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan():94
>     org.apache.drill.exec.work.foreman.Foreman.runSQL():927
>     org.apache.drill.exec.work.foreman.Foreman.run():251
>     java.util.concurrent.ThreadPoolExecutor.runWorker():1145
>     java.util.concurrent.ThreadPoolExecutor$Worker.run():615
>     java.lang.Thread.run():745 (state=,code=0)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)