Kevin Liew created CALCITE-1252: ----------------------------------- Summary: Cannot resolve columns aliased to its own name Key: CALCITE-1252 URL: https://issues.apache.org/jira/browse/CALCITE-1252 Project: Calcite Issue Type: Bug Components: avatica Affects Versions: 1.8.0 Environment: HDP 2.5.0.0-518 preview Reporter: Kevin Liew
Tableau generates queries that alias a fully-qualified column name to its shortened name. Similar to: {code} create table test (pk integer primary key); select test.pk as pk from test group by pk; {code} Phoenix reports: {code} 8org.apache.calcite.avatica.proto.Responses$ErrorResponse¨ ðjava.lang.RuntimeException: org.apache.phoenix.schema.AmbiguousColumnException: ERROR 502 (42702): Column reference ambiguous or duplicate names. columnName=PK at org.apache.calcite.avatica.jdbc.JdbcMeta.propagate(JdbcMeta.java:671) at org.apache.calcite.avatica.jdbc.JdbcMeta.prepare(JdbcMeta.java:695) at org.apache.calcite.avatica.remote.LocalService.apply(LocalService.java:208) at org.apache.calcite.avatica.remote.Service$PrepareRequest.accept(Service.java:1157) at org.apache.calcite.avatica.remote.Service$PrepareRequest.accept(Service.java:1131) at org.apache.calcite.avatica.remote.AbstractHandler.apply(AbstractHandler.java:95) at org.apache.calcite.avatica.remote.ProtobufHandler.apply(ProtobufHandler.java:46) at org.apache.calcite.avatica.server.AvaticaProtobufHandler.handle(AvaticaProtobufHandler.java:127) at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) at org.eclipse.jetty.server.Server.handle(Server.java:499) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257) at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555) at java.lang.Thread.run(Thread.java:745) Caused by: org.apache.phoenix.schema.AmbiguousColumnException: ERROR 502 (42702): Column reference ambiguous or duplicate names. columnName=PK at org.apache.phoenix.parse.ParseNodeRewriter.visit(ParseNodeRewriter.java:406) at org.apache.phoenix.compile.StatementNormalizer.visit(StatementNormalizer.java:177) at org.apache.phoenix.compile.StatementNormalizer.visit(StatementNormalizer.java:58) at org.apache.phoenix.parse.ColumnParseNode.accept(ColumnParseNode.java:56) at org.apache.phoenix.parse.ParseNodeRewriter.rewrite(ParseNodeRewriter.java:111) at org.apache.phoenix.compile.StatementNormalizer.normalize(StatementNormalizer.java:107) at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:398) at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:378) at org.apache.phoenix.jdbc.PhoenixPreparedStatement.getMetaData(PhoenixPreparedStatement.java:223) at org.apache.calcite.avatica.jdbc.JdbcMeta.prepare(JdbcMeta.java:689) ... 15 more {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)