Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-3770

HBase - table's alias (... AS ...) is not "visible" in SELECT caluse in IN predicate

    Details

    • Steps to Reproduce:
      Hide

      SELECT INTKEY, BIGDECIMALVALUE FROM BQT1.SMALLA AS A WHERE BIGDECIMALVALUE IN (SELECT MAX(BIGDECIMALVALUE) FROM BQT1.SMALLA AS B WHERE A.INTKEY = B.INTKEY) ORDER BY INTKEY

      10:07:31,998 DEBUG [org.teiid.CONNECTOR] (Worker19_QueryProcessorQueue134) Source-specific command: SELECT g_0.intkey AS c_0, g_0.bigdecimalvalue AS c_1 FROM smalla AS g_0 WHERE g_0.bigdecimalvalue IN (SELECT MAX(g_1.bigdecimalvalue) FROM smalla AS g_1 WHERE g_1.intkey = g_0.intkey) ORDER BY c_0
      10:07:31,998 DEBUG [org.teiid.CONNECTOR] (Worker19_QueryProcessorQueue134) qvJ3png5LESA.47.2.31 Obtained execution
      10:07:32,397 WARN  [org.teiid.CONNECTOR] (Worker19_QueryProcessorQueue134) Connector worker process failed for atomic-request=qvJ3png5LESA.47.2.31: org.teiid.translator.jdbc.JDBCExecutionException: 1001 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT g_0.intkey AS c_0, g_0.bigdecimalvalue AS c_1 FROM smalla AS g_0 WHERE g_0.bigdecimalvalue IN (SELECT MAX(g_1.bigdecimalvalue) FROM smalla AS g_1 WHERE g_1.intkey = g_0.intkey) ORDER BY c_0]
      	at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:131)
      	at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:329) [teiid-engine-8.7.1.6_2-redhat-6.jar:8.7.1.6_2-redhat-6]
      	at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:298) [teiid-engine-8.7.1.6_2-redhat-6.jar:8.7.1.6_2-redhat-6]
      	at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:110) [teiid-engine-8.7.1.6_2-redhat-6.jar:8.7.1.6_2-redhat-6]
      	at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:107) [teiid-engine-8.7.1.6_2-redhat-6.jar:8.7.1.6_2-redhat-6]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_40]
      	at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:58) [teiid-engine-8.7.1.6_2-redhat-6.jar:8.7.1.6_2-redhat-6]
      	at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:274) [teiid-engine-8.7.1.6_2-redhat-6.jar:8.7.1.6_2-redhat-6]
      	at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) [teiid-engine-8.7.1.6_2-redhat-6.jar:8.7.1.6_2-redhat-6]
      	at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210) [teiid-engine-8.7.1.6_2-redhat-6.jar:8.7.1.6_2-redhat-6]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_40]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_40]
      	at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_40]
      Caused by: org.apache.phoenix.schema.ColumnFamilyNotFoundException: ERROR 1001 (42I01): Undefined column family. familyName=G_0.null
      	at org.apache.phoenix.schema.PTableImpl.getColumnFamily(PTableImpl.java:779)
      	at org.apache.phoenix.compile.FromCompiler$SingleTableColumnResolver.resolveColumn(FromCompiler.java:361)
      	at org.apache.phoenix.compile.ExpressionCompiler.resolveColumn(ExpressionCompiler.java:366)
      	at org.apache.phoenix.compile.WhereCompiler$WhereExpressionCompiler.resolveColumn(WhereCompiler.java:181)
      	at org.apache.phoenix.compile.WhereCompiler$WhereExpressionCompiler.visit(WhereCompiler.java:169)
      	at org.apache.phoenix.compile.WhereCompiler$WhereExpressionCompiler.visit(WhereCompiler.java:156)
      	at org.apache.phoenix.parse.ColumnParseNode.accept(ColumnParseNode.java:56)
      	at org.apache.phoenix.parse.CompoundParseNode.acceptChildren(CompoundParseNode.java:64)
      	at org.apache.phoenix.parse.ComparisonParseNode.accept(ComparisonParseNode.java:45)
      	at org.apache.phoenix.compile.WhereCompiler.compile(WhereCompiler.java:130)
      	at org.apache.phoenix.compile.WhereCompiler.compile(WhereCompiler.java:100)
      	at org.apache.phoenix.compile.QueryCompiler.compileSingleFlatQuery(QueryCompiler.java:536)
      	at org.apache.phoenix.compile.QueryCompiler.compileSingleQuery(QueryCompiler.java:489)
      	at org.apache.phoenix.compile.QueryCompiler.compileSelect(QueryCompiler.java:201)
      	at org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:158)
      	at org.apache.phoenix.compile.QueryCompiler.compileSubquery(QueryCompiler.java:480)
      	at org.apache.phoenix.compile.QueryCompiler.compileJoinQuery(QueryCompiler.java:250)
      	at org.apache.phoenix.compile.QueryCompiler.compileJoinQuery(QueryCompiler.java:293)
      	at org.apache.phoenix.compile.JoinCompiler.optimize(JoinCompiler.java:1163)
      	at org.apache.phoenix.compile.QueryCompiler.compileSelect(QueryCompiler.java:193)
      	at org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:158)
      	at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:380)
      	at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:354)
      	at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:260)
      	at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:255)
      	at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
      	at org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:254)
      	at org.apache.phoenix.jdbc.PhoenixPreparedStatement.executeQuery(PhoenixPreparedStatement.java:187)
      	at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:462)
      	at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:123)
      	... 12 more
      

      Show
      SELECT INTKEY, BIGDECIMALVALUE FROM BQT1.SMALLA AS A WHERE BIGDECIMALVALUE IN (SELECT MAX(BIGDECIMALVALUE) FROM BQT1.SMALLA AS B WHERE A .INTKEY = B.INTKEY) ORDER BY INTKEY 10:07:31,998 DEBUG [org.teiid.CONNECTOR] (Worker19_QueryProcessorQueue134) Source-specific command: SELECT g_0.intkey AS c_0, g_0.bigdecimalvalue AS c_1 FROM smalla AS g_0 WHERE g_0.bigdecimalvalue IN (SELECT MAX(g_1.bigdecimalvalue) FROM smalla AS g_1 WHERE g_1.intkey = g_0.intkey) ORDER BY c_0 10:07:31,998 DEBUG [org.teiid.CONNECTOR] (Worker19_QueryProcessorQueue134) qvJ3png5LESA.47.2.31 Obtained execution 10:07:32,397 WARN [org.teiid.CONNECTOR] (Worker19_QueryProcessorQueue134) Connector worker process failed for atomic-request=qvJ3png5LESA.47.2.31: org.teiid.translator.jdbc.JDBCExecutionException: 1001 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT g_0.intkey AS c_0, g_0.bigdecimalvalue AS c_1 FROM smalla AS g_0 WHERE g_0.bigdecimalvalue IN (SELECT MAX(g_1.bigdecimalvalue) FROM smalla AS g_1 WHERE g_1.intkey = g_0.intkey) ORDER BY c_0] at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:131) at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:329) [teiid-engine-8.7.1.6_2-redhat-6.jar:8.7.1.6_2-redhat-6] at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:298) [teiid-engine-8.7.1.6_2-redhat-6.jar:8.7.1.6_2-redhat-6] at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:110) [teiid-engine-8.7.1.6_2-redhat-6.jar:8.7.1.6_2-redhat-6] at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:107) [teiid-engine-8.7.1.6_2-redhat-6.jar:8.7.1.6_2-redhat-6] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_40] at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:58) [teiid-engine-8.7.1.6_2-redhat-6.jar:8.7.1.6_2-redhat-6] at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:274) [teiid-engine-8.7.1.6_2-redhat-6.jar:8.7.1.6_2-redhat-6] at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) [teiid-engine-8.7.1.6_2-redhat-6.jar:8.7.1.6_2-redhat-6] at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210) [teiid-engine-8.7.1.6_2-redhat-6.jar:8.7.1.6_2-redhat-6] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_40] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_40] at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_40] Caused by: org.apache.phoenix.schema.ColumnFamilyNotFoundException: ERROR 1001 (42I01): Undefined column family. familyName=G_0.null at org.apache.phoenix.schema.PTableImpl.getColumnFamily(PTableImpl.java:779) at org.apache.phoenix.compile.FromCompiler$SingleTableColumnResolver.resolveColumn(FromCompiler.java:361) at org.apache.phoenix.compile.ExpressionCompiler.resolveColumn(ExpressionCompiler.java:366) at org.apache.phoenix.compile.WhereCompiler$WhereExpressionCompiler.resolveColumn(WhereCompiler.java:181) at org.apache.phoenix.compile.WhereCompiler$WhereExpressionCompiler.visit(WhereCompiler.java:169) at org.apache.phoenix.compile.WhereCompiler$WhereExpressionCompiler.visit(WhereCompiler.java:156) at org.apache.phoenix.parse.ColumnParseNode.accept(ColumnParseNode.java:56) at org.apache.phoenix.parse.CompoundParseNode.acceptChildren(CompoundParseNode.java:64) at org.apache.phoenix.parse.ComparisonParseNode.accept(ComparisonParseNode.java:45) at org.apache.phoenix.compile.WhereCompiler.compile(WhereCompiler.java:130) at org.apache.phoenix.compile.WhereCompiler.compile(WhereCompiler.java:100) at org.apache.phoenix.compile.QueryCompiler.compileSingleFlatQuery(QueryCompiler.java:536) at org.apache.phoenix.compile.QueryCompiler.compileSingleQuery(QueryCompiler.java:489) at org.apache.phoenix.compile.QueryCompiler.compileSelect(QueryCompiler.java:201) at org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:158) at org.apache.phoenix.compile.QueryCompiler.compileSubquery(QueryCompiler.java:480) at org.apache.phoenix.compile.QueryCompiler.compileJoinQuery(QueryCompiler.java:250) at org.apache.phoenix.compile.QueryCompiler.compileJoinQuery(QueryCompiler.java:293) at org.apache.phoenix.compile.JoinCompiler.optimize(JoinCompiler.java:1163) at org.apache.phoenix.compile.QueryCompiler.compileSelect(QueryCompiler.java:193) at org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:158) at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:380) at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:354) at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:260) at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:255) at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53) at org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:254) at org.apache.phoenix.jdbc.PhoenixPreparedStatement.executeQuery(PhoenixPreparedStatement.java:187) at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:462) at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:123) ... 12 more
    • Bugzilla Update:
      Perform

      Description

      Query:
      SELECT INTKEY, BIGDECIMALVALUE FROM BQT1.SMALLA AS A WHERE BIGDECIMALVALUE IN (SELECT MAX(BIGDECIMALVALUE) FROM BQT1.SMALLA AS B WHERE A.INTKEY = B.INTKEY) ORDER BY INTKEY

      It seems like bug in Phoenix driver.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  shawkins Steven Hawkins
                  Reporter:
                  jdurani Juraj Duráni
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: