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

group by doesn't work with column number

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: 0.4.0
    • Component/s: Metadata
    • Labels:
      None

      Description

      0: jdbc:drill:schema=dfs> select uid, count from test where country='US' group by 1;
      Query failed: org.apache.drill.exec.rpc.RpcException: Remote failure while running query.[error_id: "a21ec4b8-1090-4075-9725-18e71610561a"
      error_type: 0
      message: "Failure while parsing sql. < ValidationException:[ org.eigenbase.util.EigenbaseContextException: From line 1, column 8 to line 1, column 10 ] < EigenbaseContextException:[ From line 1, column 8 to line 1, column 10 ] < SqlValidatorException:[ Expression 'uid' is not being grouped ]"
      ]

      org.eigenbase.sql.validate.SqlValidatorException: Expression 'uid' is not being grouped
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.7.0_45]
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ~[na:1.7.0_45]
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.7.0_45]
      at java.lang.reflect.Constructor.newInstance(Constructor.java:526) ~[na:1.7.0_45]
      at org.eigenbase.resource.Resources$ExInstWithCause.ex(Resources.java:348) ~[optiq-core-0.7-20140513.013236-5.jar:na]
      at org.eigenbase.resource.Resources$ExInst.ex(Resources.java:457) ~[optiq-core-0.7-20140513.013236-5.jar:na]
      at org.eigenbase.sql.SqlUtil.newContextException(SqlUtil.java:671) ~[optiq-core-0.7-20140513.013236-5.jar:na]
      at org.eigenbase.sql.SqlUtil.newContextException(SqlUtil.java:659) ~[optiq-core-0.7-20140513.013236-5.jar:na]
      at org.eigenbase.sql.validate.SqlValidatorImpl.newValidationError(SqlValidatorImpl.java:3512) ~[optiq-core-0.7-20140513.013236-5.jar:na]
      at org.eigenbase.sql.validate.AggChecker.visit(AggChecker.java:103) ~[optiq-core-0.7-20140513.013236-5.jar:na]
      at org.eigenbase.sql.validate.AggChecker.visit(AggChecker.java:31) ~[optiq-core-0.7-20140513.013236-5.jar:na]
      at org.eigenbase.sql.SqlIdentifier.accept(SqlIdentifier.java:222) ~[optiq-core-0.7-20140513.013236-5.jar:na]
      at org.eigenbase.sql.validate.AggregatingSelectScope.checkAggregateExpr(AggregatingSelectScope.java:160) ~[optiq-core-0.7-20140513.013236-5.jar:na]
      at org.eigenbase.sql.validate.SqlValidatorImpl.validateSelectList(SqlValidatorImpl.java:3033) ~[optiq-core-0.7-20140513.013236-5.jar:na]
      at org.eigenbase.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:2772) ~[optiq-core-0.7-20140513.013236-5.jar:na]
      at org.eigenbase.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:60) ~[optiq-core-0.7-20140513.013236-5.jar:na]
      at org.eigenbase.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:80) ~[optiq-core-0.7-20140513.013236-5.jar:na]
      at org.eigenbase.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:747) ~[optiq-core-0.7-20140513.013236-5.jar:na]
      at org.eigenbase.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:736) ~[optiq-core-0.7-20140513.013236-5.jar:na]
      at org.eigenbase.sql.SqlSelect.validate(SqlSelect.java:209) ~[optiq-core-0.7-20140513.013236-5.jar:na]
      at org.eigenbase.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:710) ~[optiq-core-0.7-20140513.013236-5.jar:na]
      at org.eigenbase.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:426) ~[optiq-core-0.7-20140513.013236-5.jar:na]
      at net.hydromatic.optiq.prepare.PlannerImpl.validate(PlannerImpl.java:175) ~[optiq-core-0.7-20140513.013236-5.jar:na]
      at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateNode(DefaultSqlHandler.java:121) ~[drill-java-exec-1.0.0-m2-incubating-SNAPSHOT-rebuffed.jar:1.0.0-m2-incubating-SNAPSHOT]
      at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan(DefaultSqlHandler.java:106) ~[drill-java-exec-1.0.0-m2-incubating-SNAPSHOT-rebuffed.jar:1.0.0-m2-incubating-SNAPSHOT]
      at org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:129) ~[drill-java-exec-1.0.0-m2-incubating-SNAPSHOT-rebuffed.jar:1.0.0-m2-incubating-SNAPSHOT]
      at org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:313) [drill-java-exec-1.0.0-m2-incubating-SNAPSHOT-rebuffed.jar:1.0.0-m2-incubating-SNAPSHOT]
      at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:167) [drill-java-exec-1.0.0-m2-incubating-SNAPSHOT-rebuffed.jar:1.0.0-m2-incubating-SNAPSHOT]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_45]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_45]
      at java.lang.Thread.run(Thread.java:744) [na:1.7.0_45]

        Attachments

          Activity

            People

            • Assignee:
              jnadeau Jacques Nadeau
              Reporter:
              vsummers Vivian Summers
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: