You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Chun Chang (JIRA)" <ji...@apache.org> on 2014/07/17 02:38:05 UTC

[jira] [Commented] (DRILL-1152) mondrian query - sql parser error: SqlValidatorException:[ Column 'fullname' is ambiguous ]"

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

Chun Chang commented on DRILL-1152:
-----------------------------------

org.eigenbase.sql.validate.SqlValidatorException: Column 'fullname' is ambiguous
	sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)(NativeConstructorAccessorImpl.java) ~[na:1.7.0_45]
	sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ~[na:1.7.0_45]
	sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.7.0_45]
	java.lang.reflect.Constructor.newInstance(Constructor.java:526) ~[na:1.7.0_45]
	org.eigenbase.resource.Resources$ExInstWithCause.ex(Resources.java:348) ~[optiq-core-0.7-20140708.001905-9.jar:na]
	org.eigenbase.resource.Resources$ExInst.ex(Resources.java:457) ~[optiq-core-0.7-20140708.001905-9.jar:na]
	org.eigenbase.sql.SqlUtil.newContextException(SqlUtil.java:671) ~[optiq-core-0.7-20140708.001905-9.jar:na]
	org.eigenbase.sql.SqlUtil.newContextException(SqlUtil.java:659) ~[optiq-core-0.7-20140708.001905-9.jar:na]
	org.eigenbase.sql.validate.SqlValidatorImpl.newValidationError(SqlValidatorImpl.java:3515) ~[optiq-core-0.7-20140708.001905-9.jar:na]
	org.eigenbase.sql.validate.ListScope.findQualifyingTableName(ListScope.java:111) ~[optiq-core-0.7-20140708.001905-9.jar:na]
	org.eigenbase.sql.validate.DelegatingScope.fullyQualify(DelegatingScope.java:145) ~[optiq-core-0.7-20140708.001905-9.jar:na]
	org.eigenbase.sql.validate.SqlValidatorUtil$DeepCopier.visit(SqlValidatorUtil.java:367) ~[optiq-core-0.7-20140708.001905-9.jar:na]
	org.eigenbase.sql.validate.SqlValidatorUtil$DeepCopier.visit(SqlValidatorUtil.java:340) ~[optiq-core-0.7-20140708.001905-9.jar:na]
	org.eigenbase.sql.SqlIdentifier.accept(SqlIdentifier.java:222) ~[optiq-core-0.7-20140708.001905-9.jar:na]
	org.eigenbase.sql.validate.SqlValidatorUtil$DeepCopier.visit(SqlValidatorUtil.java:348) ~[optiq-core-0.7-20140708.001905-9.jar:na]
	org.eigenbase.sql.validate.SqlValidatorUtil$DeepCopier.visit(SqlValidatorUtil.java:340) ~[optiq-core-0.7-20140708.001905-9.jar:na]
	org.eigenbase.sql.SqlNodeList.accept(SqlNodeList.java:149) ~[optiq-core-0.7-20140708.001905-9.jar:na]
	org.eigenbase.sql.validate.AggregatingSelectScope.<init>(AggregatingSelectScope.java:65) ~[optiq-core-0.7-20140708.001905-9.jar:na]
	org.eigenbase.sql.validate.SqlValidatorImpl.registerQuery(SqlValidatorImpl.java:2001) ~[optiq-core-0.7-20140708.001905-9.jar:na]
	org.eigenbase.sql.validate.SqlValidatorImpl.registerQuery(SqlValidatorImpl.java:1924) ~[optiq-core-0.7-20140708.001905-9.jar:na]
	org.eigenbase.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:708) ~[optiq-core-0.7-20140708.001905-9.jar:na]
	org.eigenbase.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:426) ~[optiq-core-0.7-20140708.001905-9.jar:na]
	net.hydromatic.optiq.prepare.PlannerImpl.validate(PlannerImpl.java:175) ~[optiq-core-0.7-20140708.001905-9.jar:na]
	org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateNode(DefaultSqlHandler.java:128) ~[drill-java-exec-1.0.0-m2-incubating-SNAPSHOT-rebuffed.jar:1.0.0-m2-incubating-SNAPSHOT]
	org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan(DefaultSqlHandler.java:113) ~[drill-java-exec-1.0.0-m2-incubating-SNAPSHOT-rebuffed.jar:1.0.0-m2-incubating-SNAPSHOT]
	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]
	org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:400) [drill-java-exec-1.0.0-m2-incubating-SNAPSHOT-rebuffed.jar:1.0.0-m2-incubating-SNAPSHOT]
	org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:216) [drill-java-exec-1.0.0-m2-incubating-SNAPSHOT-rebuffed.jar:1.0.0-m2-incubating-SNAPSHOT]
	org.apache.drill.exec.work.WorkManager$RunnableWrapper.run(WorkManager.java:242) [drill-java-exec-1.0.0-m2-incubating-SNAPSHOT-rebuffed.jar:1.0.0-m2-incubating-SNAPSHOT]
	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_45]
	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_45]
	java.lang.Thread.run(Thread.java:744) [na:1.7.0_45]


> mondrian query - sql parser error: SqlValidatorException:[ Column 'fullname' is ambiguous ]"
> --------------------------------------------------------------------------------------------
>
>                 Key: DRILL-1152
>                 URL: https://issues.apache.org/jira/browse/DRILL-1152
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: SQL Parser
>            Reporter: Chun Chang
>            Priority: Minor
>
> #Mon Jul 14 10:10:52 PDT 2014
> git.commit.id.abbrev=699851b
> The following mondrian query (query12.q) failed sql parser:
> 0: jdbc:drill:schema=dfs> select customer.country as c0, customer.state_province as c1, customer.city as c2, customer.customer_id as c3, fullname as c4, fullname as c5, customer.gender as c6, customer.marital_status as c7, customer.education as c8, customer.yearly_income as c9 from customer as customer, sales_fact_1997 as sales_fact_1997, time_by_day as time_by_day where sales_fact_1997.customer_id = customer.customer_id and sales_fact_1997.time_id = time_by_day.time_id and time_by_day.the_year = 1997 group by customer.country, customer.state_province, customer.city, customer.customer_id, fullname, customer.gender, customer.marital_status, customer.education, customer.yearly_income having fullname LIKE '%Jeanne%' order by customer.country ASC NULLS LAST, customer.state_province ASC NULLS LAST, customer.city ASC NULLS LAST, fullname ASC NULLS LAST;
> Query failed: org.apache.drill.exec.rpc.RpcException: Remote failure while running query.[error_id: "18220efe-a9f8-450c-bbf7-4ef1cf873cd0"
> endpoint {
>   address: "qa-node120.qa.lab"
>   user_port: 31010
>   control_port: 31011
>   data_port: 31012
> }
> error_type: 0
> message: "Failure while parsing sql. < ValidationException:[ org.eigenbase.util.EigenbaseContextException: From line 1, column 571 to line 1, column 578 ] < EigenbaseContextException:[ From line 1, column 571 to line 1, column 578 ] < SqlValidatorException:[ Column 'fullname' is ambiguous ]"
> ]
> Error: exception while executing query (state=,code=0)
> If I qualify the column name 'fullname' as 'customer.fullname', then query works. 
> The thing is with similar but a bit simplified query that I do not qualify the column name, it works fine. Only fails for this particular query. So far, I failed to isolate the problem. For example, the following query works without qualifying the column name:
> 0: jdbc:drill:schema=dfs> select customer.country as c0, fullname as c4 from customer as customer group by customer.country, fullname limit 4;
> +------------+------------+
> |     c0     |     c4     |
> +------------+------------+
> | [B@6fe52815 | [B@2daab417 |
> | [B@2215696d | [B@2bbc8496 |
> | [B@65a4aa48 | [B@1da7911a |
> | [B@6427512b | [B@5142116b |
> +------------+------------+
> 4 rows selected (0.491 seconds)



--
This message was sent by Atlassian JIRA
(v6.2#6252)