Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-4798

TPCDS query 12 fails to plan

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Duplicate
    • 1.8.0
    • None
    • None
    • 4 node cluster CentOS

    Description

      TPCDS query 12 fails to plan.
      test was run over TPCDS SF1 data
      MapR Drill 1.8.0 commit ID 34ca63ba

      0: jdbc:drill:schema=dfs.tmp> SELECT   item_id ,
      . . . . . . . . . . . . . . >          item_desc ,
      . . . . . . . . . . . . . . >          category ,
      . . . . . . . . . . . . . . >          class1 ,
      . . . . . . . . . . . . . . >          current_price ,
      . . . . . . . . . . . . . . >          itemrevenue,
      . . . . . . . . . . . . . . >          itemrevenue*100/sum(itemrevenue) OVER (partition BY class1) AS revenueratio
      . . . . . . . . . . . . . . > FROM (
      . . . . . . . . . . . . . . > SELECT
      . . . . . . . . . . . . . . >          i.i_item_id AS item_id,
      . . . . . . . . . . . . . . >          i.i_item_desc AS item_desc,
      . . . . . . . . . . . . . . >          i.i_category AS category,
      . . . . . . . . . . . . . . >          i.i_class AS class1,
      . . . . . . . . . . . . . . >          i.i_current_price AS current_price,
      . . . . . . . . . . . . . . >          Sum(w.ws_ext_sales_price) AS itemrevenue
      . . . . . . . . . . . . . . > FROM     dfs.`/drill/testdata/tpcds_sf1/parquet/web_sales` w,
      . . . . . . . . . . . . . . >          dfs.`/drill/testdata/tpcds_sf1/parquet/item` i,
      . . . . . . . . . . . . . . >          dfs.`/drill/testdata/tpcds_sf1/parquet/date_dim` d
      . . . . . . . . . . . . . . > WHERE    w.ws_item_sk = i.i_item_sk
      . . . . . . . . . . . . . . > AND      i.i_category IN ('Home',
      . . . . . . . . . . . . . . >                         'Men',
      . . . . . . . . . . . . . . >                         'Women')
      . . . . . . . . . . . . . . > AND      w.ws_sold_date_sk = d.d_date_sk
      . . . . . . . . . . . . . . > AND      d.d_date BETWEEN Cast('2000-05-11' AS date) AND      (
      . . . . . . . . . . . . . . >                   Cast('2000-05-11' AS date) + INTERVAL '30' day)
      . . . . . . . . . . . . . . > GROUP BY i.i_item_id ,
      . . . . . . . . . . . . . . >          i.i_item_desc ,
      . . . . . . . . . . . . . . >          i.i_category ,
      . . . . . . . . . . . . . . >          i.i_class ,
      . . . . . . . . . . . . . . >          i.i_current_price
      . . . . . . . . . . . . . . > ) AS temp1
      . . . . . . . . . . . . . . > ORDER BY category ,
      . . . . . . . . . . . . . . >          class1 ,
      . . . . . . . . . . . . . . >          item_id ,
      . . . . . . . . . . . . . . >          item_desc,
      . . . . . . . . . . . . . . >         revenueratio
      . . . . . . . . . . . . . . > LIMIT 100;
      Error: VALIDATION ERROR: From line 24, column 10 to line 25, column 64: Cannot apply 'BETWEEN ASYMMETRIC' to arguments of type '<ANY> BETWEEN ASYMMETRIC <DATE> AND <TIMESTAMP(0)>'. Supported form(s): '<COMPARABLE_TYPE> BETWEEN <COMPARABLE_TYPE> AND <COMPARABLE_TYPE>'
      
      SQL Query null
      
      [Error Id: 90e48eea-6d5d-4786-8876-81f6480fda93 on centos-01.qa.lab:31010] (state=,code=0)
      

      Stack trace from drillbit.log

      2016-07-22 06:11:29,441 [286e46ed-944d-018e-3158-aa03ede89215:foreman] INFO  o.a.drill.exec.work.foreman.Foreman - Query text for query id 286e46ed-944d-018e-3158-aa03ede89215: SELECT   item_id ,
               item_desc ,
               category ,
               class1 ,
               current_price ,
               itemrevenue,
               itemrevenue*100/sum(itemrevenue) OVER (partition BY class1) AS revenueratio
      FROM (
      SELECT
               i.i_item_id AS item_id,
               i.i_item_desc AS item_desc,
               i.i_category AS category,
               i.i_class AS class1,
               i.i_current_price AS current_price,
               Sum(w.ws_ext_sales_price) AS itemrevenue
      FROM     dfs.`/drill/testdata/tpcds_sf1/parquet/web_sales` w,
               dfs.`/drill/testdata/tpcds_sf1/parquet/item` i,
               dfs.`/drill/testdata/tpcds_sf1/parquet/date_dim` d
      WHERE    w.ws_item_sk = i.i_item_sk
      AND      i.i_category IN ('Home',
                              'Men',
                              'Women')
      AND      w.ws_sold_date_sk = d.d_date_sk
      AND      d.d_date BETWEEN Cast('2000-05-11' AS date) AND      (
                        Cast('2000-05-11' AS date) + INTERVAL '30' day)
      GROUP BY i.i_item_id ,
               i.i_item_desc ,
               i.i_category ,
               i.i_class ,
               i.i_current_price
      ) AS temp1
      ORDER BY category ,
               class1 ,
               item_id ,
               item_desc,
              revenueratio
      LIMIT 100
      2016-07-22 06:11:29,544 [286e46ed-944d-018e-3158-aa03ede89215:foreman] INFO  o.a.d.exec.planner.sql.SqlConverter - User Error Occurred
      org.apache.drill.common.exceptions.UserException: VALIDATION ERROR: From line 24, column 10 to line 25, column 64: Cannot apply 'BETWEEN ASYMMETRIC' to arguments of type '<ANY> BETWEEN ASYMMETRIC <DATE> AND <TIMESTAMP(0)>'. Supported form(s): '<COMPARABLE_TYPE> BETWEEN <COMPARABLE_TYPE> AND <COMPARABLE_TYPE>'
      
      SQL Query null
      
      [Error Id: 90e48eea-6d5d-4786-8876-81f6480fda93 ]
              at org.apache.drill.common.exceptions.UserException$Builder.build(UserException.java:543) ~[drill-common-1.8.0-SNAPSHOT.jar:1.8.0-SNAPSHOT]
              at org.apache.drill.exec.planner.sql.SqlConverter.validate(SqlConverter.java:164) [drill-java-exec-1.8.0-SNAPSHOT.jar:1.8.0-SNAPSHOT]
              at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateNode(DefaultSqlHandler.java:600) [drill-java-exec-1.8.0-SNAPSHOT.jar:1.8.0-SNAPSHOT]
              at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateAndConvert(DefaultSqlHandler.java:192) [drill-java-exec-1.8.0-SNAPSHOT.jar:1.8.0-SNAPSHOT]
              at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan(DefaultSqlHandler.java:164) [drill-java-exec-1.8.0-SNAPSHOT.jar:1.8.0-SNAPSHOT]
              at org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:94) [drill-java-exec-1.8.0-SNAPSHOT.jar:1.8.0-SNAPSHOT]
              at org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:978) [drill-java-exec-1.8.0-SNAPSHOT.jar:1.8.0-SNAPSHOT]
              at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:257) [drill-java-exec-1.8.0-SNAPSHOT.jar:1.8.0-SNAPSHOT]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_101]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_101]
              at java.lang.Thread.run(Thread.java:745) [na:1.7.0_101]
      Caused by: org.apache.calcite.runtime.CalciteContextException: From line 24, column 10 to line 25, column 64: Cannot apply 'BETWEEN ASYMMETRIC' to arguments of type '<ANY> BETWEEN ASYMMETRIC <DATE> AND <TIMESTAMP(0)>'. Supported form(s): '<COMPARABLE_TYPE> BETWEEN <COMPARABLE_TYPE> AND <COMPARABLE_TYPE>'
              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.7.0_101]
              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ~[na:1.7.0_101]
              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.7.0_101]
              at java.lang.reflect.Constructor.newInstance(Constructor.java:526) ~[na:1.7.0_101]
              at org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:405) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:765) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:753) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.validate.SqlValidatorImpl.newValidationError(SqlValidatorImpl.java:3958) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.SqlCallBinding.newValidationSignatureError(SqlCallBinding.java:275) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.type.ComparableOperandTypeChecker.checkOperandTypes(ComparableOperandTypeChecker.java:70) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.SqlOperator.checkOperandTypes(SqlOperator.java:657) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.SqlOperator.validateOperands(SqlOperator.java:430) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.SqlOperator.deriveType(SqlOperator.java:507) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.validate.SqlValidatorImpl$DeriveTypeVisitor.visit(SqlValidatorImpl.java:4321) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.validate.SqlValidatorImpl$DeriveTypeVisitor.visit(SqlValidatorImpl.java:4308) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.SqlCall.accept(SqlCall.java:130) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.validate.SqlValidatorImpl.deriveTypeImpl(SqlValidatorImpl.java:1502) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.validate.SqlValidatorImpl.deriveType(SqlValidatorImpl.java:1485) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.SqlNode.validateExpr(SqlNode.java:232) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.SqlOperator.validateCall(SqlOperator.java:405) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.validate.SqlValidatorImpl.validateCall(SqlValidatorImpl.java:4111) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.SqlCall.validate(SqlCall.java:107) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.validate.SqlValidatorImpl.validateWhereOrOn(SqlValidatorImpl.java:3401) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.validate.SqlValidatorImpl.validateWhereClause(SqlValidatorImpl.java:3389) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:2994) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:60) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:86) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:884) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:870) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:2785) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:2770) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:2993) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:60) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:86) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:884) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:870) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.SqlSelect.validate(SqlSelect.java:210) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:844) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:558) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.drill.exec.planner.sql.SqlConverter.validate(SqlConverter.java:155) [drill-java-exec-1.8.0-SNAPSHOT.jar:1.8.0-SNAPSHOT]
              ... 9 common frames omitted
      Caused by: org.apache.calcite.sql.validate.SqlValidatorException: Cannot apply 'BETWEEN ASYMMETRIC' to arguments of type '<ANY> BETWEEN ASYMMETRIC <DATE> AND <TIMESTAMP(0)>'. Supported form(s): '<COMPARABLE_TYPE> BETWEEN <COMPARABLE_TYPE> AND <COMPARABLE_TYPE>'
              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.7.0_101]
              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ~[na:1.7.0_101]
              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.7.0_101]
              at java.lang.reflect.Constructor.newInstance(Constructor.java:526) ~[na:1.7.0_101]
              at org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:405) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              at org.apache.calcite.runtime.Resources$ExInst.ex(Resources.java:514) ~[calcite-core-1.4.0-drill-r14.jar:1.4.0-drill-r14]
              ... 44 common frames omitted
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              khfaraaz Khurram Faraaz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: