drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Khurram Faraaz (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DRILL-5392) implement castINT(BIT-REQUIRED) and castINT(BIT-OPTIONAL)
Date Tue, 28 Mar 2017 09:57:41 GMT
Khurram Faraaz created DRILL-5392:
-------------------------------------

             Summary: implement castINT(BIT-REQUIRED) and castINT(BIT-OPTIONAL)
                 Key: DRILL-5392
                 URL: https://issues.apache.org/jira/browse/DRILL-5392
             Project: Apache Drill
          Issue Type: Bug
          Components: Execution - Flow
    Affects Versions: 1.11.0
            Reporter: Khurram Faraaz


We need to implement castINT(BIT-REQUIRED) and castINT(BIT-OPTIONAL)
Below SQL fails on Drill 1.11.0

{noformat}
0: jdbc:drill:schema=dfs.tmp> SELECT res, CASE res WHEN true THEN CAST('1990-10-10 22:40:50'
AS TIMESTAMP) ELSE null END
. . . . . . . . . . . . . . > FROM
. . . . . . . . . . . . . . > (
. . . . . . . . . . . . . . >      SELECT
. . . . . . . . . . . . . . >      (CASE WHEN (true) THEN 1 ELSE null END) res
. . . . . . . . . . . . . . >      FROM (values(1)) foo
. . . . . . . . . . . . . . > ) foobar;
Error: PLAN ERROR: Failure while materializing expression in constant expression evaluator
[CASE(=(CASE(true, 1, null), true), CAST('1990-10-10 22:40:50'):TIMESTAMP(0) NOT NULL, null)].
 Errors:
Error in expression at index -1.  Error: Missing function implementation: [castINT(BIT-REQUIRED)].
 Full expression: --UNKNOWN EXPRESSION--.


[Error Id: 1c0c850f-99b7-4d64-a0e3-d6ee70b11259 on centos-01.qa.lab:31010] (state=,code=0)
{noformat}

Stack trace from drillbit.log

{noformat}
2017-03-28 09:50:54,500 [2725ce01-529d-3479-7467-ed4aa20d3ca5:foreman] INFO  o.a.drill.exec.work.foreman.Foreman
- Query text for query id 2725ce01-529d-3479-7467-ed4aa20d3ca5: SELECT res, CASE res WHEN
true THEN CAST('1990-10-10 22:40:50' AS TIMESTAMP) ELSE null END
FROM
(
     SELECT
     (CASE WHEN (true) THEN 1 ELSE null END) res
     FROM (values(1)) foo
) foobar
2017-03-28 09:50:54,585 [2725ce01-529d-3479-7467-ed4aa20d3ca5:foreman] INFO  o.a.d.e.p.logical.DrillConstExecutor
- User Error Occurred: Failure while materializing expression in constant expression evaluator
[CASE(=(CASE(true, 1, null), true), CAST('1990-10-10 22:40:50'):TIMESTAMP(0) NOT NULL, null)].
 Errors:
Error in expression at index -1.  Error: Missing function implementation: [castINT(BIT-REQUIRED)].
 Full expression: --UNKNOWN EXPRESSION--.
org.apache.drill.common.exceptions.UserException: PLAN ERROR: Failure while materializing
expression in constant expression evaluator [CASE(=(CASE(true, 1, null), true), CAST('1990-10-10
22:40:50'):TIMESTAMP(0) NOT NULL, null)].  Errors:
Error in expression at index -1.  Error: Missing function implementation: [castINT(BIT-REQUIRED)].
 Full expression: --UNKNOWN EXPRESSION--.


[Error Id: 1c0c850f-99b7-4d64-a0e3-d6ee70b11259 ]
        at org.apache.drill.common.exceptions.UserException$Builder.build(UserException.java:544)
~[drill-common-1.11.0-SNAPSHOT.jar:1.11.0-SNAPSHOT]
        at org.apache.drill.exec.planner.logical.DrillConstExecutor.reduce(DrillConstExecutor.java:131)
[drill-java-exec-1.11.0-SNAPSHOT.jar:1.11.0-SNAPSHOT]
        at org.apache.calcite.rel.rules.ReduceExpressionsRule.reduceExpressions(ReduceExpressionsRule.java:499)
[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
        at org.apache.calcite.rel.rules.ReduceExpressionsRule$1.onMatch(ReduceExpressionsRule.java:241)
[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
        at org.apache.calcite.plan.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:228)
[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
        at org.apache.calcite.plan.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:808)
[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
        at org.apache.calcite.tools.Programs$RuleSetProgram.run(Programs.java:303) [calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
        at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.transform(DefaultSqlHandler.java:404)
[drill-java-exec-1.11.0-SNAPSHOT.jar:1.11.0-SNAPSHOT]
        at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.transform(DefaultSqlHandler.java:343)
[drill-java-exec-1.11.0-SNAPSHOT.jar:1.11.0-SNAPSHOT]
        at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.convertToDrel(DefaultSqlHandler.java:240)
[drill-java-exec-1.11.0-SNAPSHOT.jar:1.11.0-SNAPSHOT]
        at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.convertToDrel(DefaultSqlHandler.java:290)
[drill-java-exec-1.11.0-SNAPSHOT.jar:1.11.0-SNAPSHOT]
        at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan(DefaultSqlHandler.java:168)
[drill-java-exec-1.11.0-SNAPSHOT.jar:1.11.0-SNAPSHOT]
        at org.apache.drill.exec.planner.sql.DrillSqlWorker.getQueryPlan(DrillSqlWorker.java:131)
[drill-java-exec-1.11.0-SNAPSHOT.jar:1.11.0-SNAPSHOT]
        at org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:79)
[drill-java-exec-1.11.0-SNAPSHOT.jar:1.11.0-SNAPSHOT]
        at org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:1050) [drill-java-exec-1.11.0-SNAPSHOT.jar:1.11.0-SNAPSHOT]
        at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:281) [drill-java-exec-1.11.0-SNAPSHOT.jar:1.11.0-SNAPSHOT]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[na:1.8.0_91]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[na:1.8.0_91]
        at java.lang.Thread.run(Thread.java:745) [na:1.8.0_91]
{noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message