drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rahul Raj (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-5578) Drill fails on date functions in 'where clause' when queried on a JDBC Storage plugin
Date Fri, 16 Feb 2018 12:02:00 GMT

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

Rahul Raj commented on DRILL-5578:
----------------------------------

I tried on drill-java-exec-1.13.0-SNAPSHOT which has the latest calcite changes and the stack
trace is below:

org.apache.drill.common.exceptions.UserException: SYSTEM ERROR: UnsupportedOperationException:
class org.apache.calcite.sql.SqlSyntax$6: SPECIAL [Error Id: d3399f0a-fac2-44d1-832a-e3c762825767
on rahul-Latitude-E5440:31010] at org.apache.drill.common.exceptions.UserException$Builder.build(UserException.java:633)
~[drill-common-1.13.0-SNAPSHOT.jar:1.13.0-SNAPSHOT] at org.apache.drill.exec.work.foreman.Foreman$ForemanResult.close(Foreman.java:761)
[drill-java-exec-1.13.0-SNAPSHOT.jar:1.13.0-SNAPSHOT] at org.apache.drill.exec.work.foreman.QueryStateProcessor.checkCommonStates(QueryStateProcessor.java:327)
[drill-java-exec-1.13.0-SNAPSHOT.jar:1.13.0-SNAPSHOT] at org.apache.drill.exec.work.foreman.QueryStateProcessor.planning(QueryStateProcessor.java:223)
[drill-java-exec-1.13.0-SNAPSHOT.jar:1.13.0-SNAPSHOT] at org.apache.drill.exec.work.foreman.QueryStateProcessor.moveToState(QueryStateProcessor.java:83)
[drill-java-exec-1.13.0-SNAPSHOT.jar:1.13.0-SNAPSHOT] at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:281)
[drill-java-exec-1.13.0-SNAPSHOT.jar:1.13.0-SNAPSHOT] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[na:1.8.0_151] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[na:1.8.0_151] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_151] Caused by: org.apache.drill.exec.work.foreman.ForemanException:
Unexpected exception during fragment initialization: class org.apache.calcite.sql.SqlSyntax$6:
SPECIAL at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:282) [drill-java-exec-1.13.0-SNAPSHOT.jar:1.13.0-SNAPSHOT]
... 3 common frames omitted Caused by: java.lang.UnsupportedOperationException: class org.apache.calcite.sql.SqlSyntax$6:
SPECIAL at org.apache.calcite.util.Util.needToImplement(Util.java:925) ~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
at org.apache.calcite.sql.SqlSyntax$6.unparse(SqlSyntax.java:116) ~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
at org.apache.calcite.sql.SqlOperator.unparse(SqlOperator.java:332) ~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
at org.apache.calcite.sql.SqlDialect.unparseCall(SqlDialect.java:332) ~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
at org.apache.calcite.sql.dialect.MysqlSqlDialect.unparseCall(MysqlSqlDialect.java:154) ~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
at org.apache.calcite.sql.SqlCall.unparse(SqlCall.java:103) ~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
at org.apache.calcite.sql.SqlUtil.unparseBinarySyntax(SqlUtil.java:323) ~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
at org.apache.calcite.sql.SqlSyntax$3.unparse(SqlSyntax.java:65) ~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
at org.apache.calcite.sql.SqlOperator.unparse(SqlOperator.java:332) ~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
at org.apache.calcite.sql.SqlDialect.unparseCall(SqlDialect.java:332) ~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
at org.apache.calcite.sql.dialect.MysqlSqlDialect.unparseCall(MysqlSqlDialect.java:154) ~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
at org.apache.calcite.sql.SqlCall.unparse(SqlCall.java:103) ~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
at org.apache.calcite.sql.SqlNodeList.andOrList(SqlNodeList.java:142) ~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
at org.apache.calcite.sql.SqlOperator.unparseListClause(SqlOperator.java:347) ~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
at org.apache.calcite.sql.SqlSelectOperator.unparse(SqlSelectOperator.java:197) ~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
at org.apache.calcite.sql.SqlSelect.unparse(SqlSelect.java:240) ~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
at org.apache.calcite.sql.SqlNode.toSqlString(SqlNode.java:152) ~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
at org.apache.calcite.sql.SqlNode.toSqlString(SqlNode.java:158) ~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
at org.apache.drill.exec.store.jdbc.JdbcPrel.<init>(JdbcPrel.java:65) ~[drill-jdbc-storage-1.13.0-SNAPSHOT.jar:1.13.0-SNAPSHOT]
at org.apache.drill.exec.store.jdbc.JdbcIntermediatePrel.finalizeRel(JdbcIntermediatePrel.java:66)
~[drill-jdbc-storage-1.13.0-SNAPSHOT.jar:1.13.0-SNAPSHOT] at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler$PrelFinalizer.visit(DefaultSqlHandler.java:309)
~[drill-java-exec-1.13.0-SNAPSHOT.jar:1.13.0-SNAPSHOT] at org.apache.calcite.rel.AbstractRelNode.accept(AbstractRelNode.java:279)
~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0] at org.apache.calcite.rel.RelShuttleImpl.visitChild(RelShuttleImpl.java:55)
~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0] at org.apache.calcite.rel.RelShuttleImpl.visitChildren(RelShuttleImpl.java:69)
~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0] at org.apache.calcite.rel.RelShuttleImpl.visit(RelShuttleImpl.java:131)
~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0] at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler$PrelFinalizer.visit(DefaultSqlHandler.java:311)
~[drill-java-exec-1.13.0-SNAPSHOT.jar:1.13.0-SNAPSHOT] at org.apache.calcite.rel.AbstractRelNode.accept(AbstractRelNode.java:279)
~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0] at org.apache.calcite.rel.RelShuttleImpl.visitChild(RelShuttleImpl.java:55)
~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0] at org.apache.calcite.rel.RelShuttleImpl.visitChildren(RelShuttleImpl.java:69)
~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0] at org.apache.calcite.rel.RelShuttleImpl.visit(RelShuttleImpl.java:131)
~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0] at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler$PrelFinalizer.visit(DefaultSqlHandler.java:311)
~[drill-java-exec-1.13.0-SNAPSHOT.jar:1.13.0-SNAPSHOT] at org.apache.calcite.rel.AbstractRelNode.accept(AbstractRelNode.java:279)
~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0] at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.convertToPrel(DefaultSqlHandler.java:437)
~[drill-java-exec-1.13.0-SNAPSHOT.jar:1.13.0-SNAPSHOT] at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan(DefaultSqlHandler.java:173)
~[drill-java-exec-1.13.0-SNAPSHOT.jar:1.13.0-SNAPSHOT] at org.apache.drill.exec.planner.sql.DrillSqlWorker.getQueryPlan(DrillSqlWorker.java:146)
~[drill-java-exec-1.13.0-SNAPSHOT.jar:1.13.0-SNAPSHOT] at org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:84)
~[drill-java-exec-1.13.0-SNAPSHOT.jar:1.13.0-SNAPSHOT] at org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:567)
[drill-java-exec-1.13.0-SNAPSHOT.jar:1.13.0-SNAPSHOT] at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:264)
[drill-java-exec-1.13.0-SNAPSHOT.jar:1.13.0-SNAPSHOT] ... 3 common frames omitted 2018-02-16
17:16:36,255 [Client-1] INFO o.a.d.j.i.DrillCursor$ResultsListener - [#4] Query failed: org.apache.drill.common.exceptions.UserRemoteException:
SYSTEM ERROR: UnsupportedOperationException: class org.apache.calcite.sql.SqlSyntax$6: SPECIAL

> Drill fails on date functions in 'where clause' when queried on a JDBC Storage plugin
> -------------------------------------------------------------------------------------
>
>                 Key: DRILL-5578
>                 URL: https://issues.apache.org/jira/browse/DRILL-5578
>             Project: Apache Drill
>          Issue Type: Bug
>    Affects Versions: 1.9.0, 1.10.0
>            Reporter: Rahul Raj
>            Priority: Major
>
> Drill 1.9/1.10 fails on any date manipulation in the where part while querying on a table
from JDBC Storage plugin. Issue happens on postgres and Oracle.
> The following two queries error out:
> select * from config_1.APP.EXECUTIONSTEP  where DATE_ADD(CAST(STARTED_AT as DATE),interval
'1' second) < CAST(CURRENT_DATE as DATE)
> select `id` from (select * from config_1.public.project_release) where CAST(DATE_ADD(`start_date`,interval
'19800' second(5)) AS DATE) = DATE '2011-11-11'
> However date manipulation succeeds when date function are applied on the selected fields
>  
> select DATE_ADD(CAST(STARTED_AT as DATE),interval '1' second) < CAST(CURRENT_DATE
as DATE) from config_1.APP.EXECUTIONSTEP 
> select `id` from (select * from config_1.public.project_release) where CAST(`start_date`
AS DATE) = DATE '2011-11-11'
> Error:
> [Error Id: 048fe4b9-ecab-40fe-aca9-d57eb2df9b0c on vpc12.o3c.in:31010]
> org.apache.drill.common.exceptions.UserException: SYSTEM ERROR: AssertionError: 1000:
INTERVAL_DAY_TIME
> [Error Id: 048fe4b9-ecab-40fe-aca9-d57eb2df9b0c on vpc12.o3c.in:31010]
> 	at org.apache.drill.common.exceptions.UserException$Builder.build(UserException.java:543)
~[drill-common-1.9.0.jar:1.9.0]
> 	at org.apache.drill.exec.work.foreman.Foreman$ForemanResult.close(Foreman.java:825)
[drill-java-exec-1.9.0.jar:1.9.0]
> 	at org.apache.drill.exec.work.foreman.Foreman.moveToState(Foreman.java:935) [drill-java-exec-1.9.0.jar:1.9.0]
> 	at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:281) [drill-java-exec-1.9.0.jar:1.9.0]
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_60]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_60]
> 	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_60]
> Caused by: org.apache.drill.exec.work.foreman.ForemanException: Unexpected exception
during fragment initialization: 1000: INTERVAL_DAY_TIME
> 	... 4 common frames omitted
> Caused by: java.lang.AssertionError: 1000: INTERVAL_DAY_TIME
> 	at org.apache.calcite.adapter.jdbc.JdbcImplementor$Context.toSql(JdbcImplementor.java:179)
~[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
> 	at org.apache.calcite.adapter.jdbc.JdbcImplementor$Context.toSql(JdbcImplementor.java:268)
~[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
> 	at org.apache.calcite.adapter.jdbc.JdbcImplementor$Context.toSql(JdbcImplementor.java:212)
~[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
> 	at org.apache.calcite.adapter.jdbc.JdbcImplementor$Context.toSql(JdbcImplementor.java:268)
~[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
> 	at org.apache.calcite.adapter.jdbc.JdbcImplementor$Context.toSql(JdbcImplementor.java:212)
~[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
> 	at org.apache.calcite.adapter.jdbc.JdbcImplementor$Context.toSql(JdbcImplementor.java:268)
~[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
> 	at org.apache.calcite.adapter.jdbc.JdbcImplementor$Context.toSql(JdbcImplementor.java:212)
~[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
> 	at org.apache.calcite.adapter.jdbc.JdbcRules$JdbcFilter.implement(JdbcRules.java:658)
~[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
> 	at org.apache.calcite.adapter.jdbc.JdbcImplementor.visitChild(JdbcImplementor.java:118)
~[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
> 	at org.apache.drill.exec.store.jdbc.JdbcPrel.<init>(JdbcPrel.java:62) ~[drill-jdbc-storage-1.9.0.jar:1.9.0]
> 	at org.apache.drill.exec.store.jdbc.JdbcIntermediatePrel.finalizeRel(JdbcIntermediatePrel.java:66)
~[drill-jdbc-storage-1.9.0.jar:1.9.0]
> 	at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler$PrelFinalizer.visit(DefaultSqlHandler.java:306)
~[drill-java-exec-1.9.0.jar:1.9.0]
> 	at org.apache.calcite.rel.AbstractRelNode.accept(AbstractRelNode.java:256) ~[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
> 	at org.apache.calcite.rel.RelShuttleImpl.visitChild(RelShuttleImpl.java:53) ~[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
> 	at org.apache.calcite.rel.RelShuttleImpl.visitChildren(RelShuttleImpl.java:68) ~[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
> 	at org.apache.calcite.rel.RelShuttleImpl.visit(RelShuttleImpl.java:126) ~[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
> 	at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler$PrelFinalizer.visit(DefaultSqlHandler.java:308)
~[drill-java-exec-1.9.0.jar:1.9.0]
> 	at org.apache.calcite.rel.AbstractRelNode.accept(AbstractRelNode.java:256) ~[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
> 	at org.apache.calcite.rel.RelShuttleImpl.visitChild(RelShuttleImpl.java:53) ~[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
> 	at org.apache.calcite.rel.RelShuttleImpl.visitChildren(RelShuttleImpl.java:68) ~[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
> 	at org.apache.calcite.rel.RelShuttleImpl.visit(RelShuttleImpl.java:126) ~[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
> 	at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler$PrelFinalizer.visit(DefaultSqlHandler.java:308)
~[drill-java-exec-1.9.0.jar:1.9.0]
> 	at org.apache.calcite.rel.AbstractRelNode.accept(AbstractRelNode.java:256) ~[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
> 	at org.apache.calcite.rel.RelShuttleImpl.visitChild(RelShuttleImpl.java:53) ~[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
> 	at org.apache.calcite.rel.RelShuttleImpl.visitChildren(RelShuttleImpl.java:68) ~[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
> 	at org.apache.calcite.rel.RelShuttleImpl.visit(RelShuttleImpl.java:126) ~[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
> 	at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler$PrelFinalizer.visit(DefaultSqlHandler.java:308)
~[drill-java-exec-1.9.0.jar:1.9.0]
> 	at org.apache.calcite.rel.AbstractRelNode.accept(AbstractRelNode.java:256) ~[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
> 	at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.convertToPrel(DefaultSqlHandler.java:425)
~[drill-java-exec-1.9.0.jar:1.9.0]
> 	at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan(DefaultSqlHandler.java:169)
~[drill-java-exec-1.9.0.jar:1.9.0]
> 	at org.apache.drill.exec.planner.sql.DrillSqlWorker.getPhysicalPlan(DrillSqlWorker.java:123)
~[drill-java-exec-1.9.0.jar:1.9.0]
> 	at org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:97)
~[drill-java-exec-1.9.0.jar:1.9.0]
> 	at org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:1008) [drill-java-exec-1.9.0.jar:1.9.0]
> 	at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:264) [drill-java-exec-1.9.0.jar:1.9.0]
> 	... 3 common frames omitted
> 2017-03-20 14:16:44,943 [USER-rpc-event-queue] ERROR o.a.d.exec.server.rest.QueryWrapper
- Query Failed
> org.apache.drill.common.exceptions.UserRemoteException: SYSTEM ERROR: AssertionError:
1000: INTERVAL_DAY_TIME



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

Mime
View raw message