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

HBase - Phoenix does not support scalar subquery

    Details

    • Steps to Reproduce:
      Hide

      SELECT a.intkey, (SELECT longnum FROM bqt1.smallb AS b WHERE a.intkey = b.intkey) FROM bqt1.smalla AS a

      Source-specific command:
      SELECT g_0.intkey, (SELECT g_1.longnum FROM smallb AS g_1 WHERE g_1.intkey = g_0.intkey) FROM smalla AS g_0
      Exception

      07:24:00,529 WARN  [org.teiid.CONNECTOR] (Worker5_QueryProcessorQueue42) Connector worker process failed for atomic-request=qvJ3png5LESA.16.2.7: org.teiid.translator.jdbc.JDBCExecutionException: 604 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT g_0.intkey, (SELECT g_1.longnum FROM smallb AS g_1 WHERE g_1.intkey = g_0.intkey) FROM smalla AS g_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.exception.PhoenixParserException: ERROR 604 (42P00): Syntax error. Mismatched input. Expecting "LPAREN", got "SELECT" at line 1, column 21.
      	at org.apache.phoenix.exception.PhoenixParserException.newException(PhoenixParserException.java:33)
      	at org.apache.phoenix.parse.SQLParser.parseStatement(SQLParser.java:111)
      	at org.apache.phoenix.jdbc.PhoenixStatement$PhoenixStatementParser.parseStatement(PhoenixStatement.java:1282)
      	at org.apache.phoenix.jdbc.PhoenixStatement.parseStatement(PhoenixStatement.java:1363)
      	at org.apache.phoenix.jdbc.PhoenixPreparedStatement.<init>(PhoenixPreparedStatement.java:95)
      	at org.apache.phoenix.jdbc.PhoenixConnection.prepareStatement(PhoenixConnection.java:634)
      	at org.apache.phoenix.jdbc.PhoenixConnection.prepareStatement(PhoenixConnection.java:660)
      	at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.doPrepareStatement(BaseWrapperManagedConnection.java:748)
      	at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.prepareStatement(BaseWrapperManagedConnection.java:734)
      	at org.jboss.jca.adapters.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:405)
      	at org.teiid.translator.jdbc.JDBCBaseExecution.getPreparedStatement(JDBCBaseExecution.java:184)
      	at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:121)
      	... 12 more
      Caused by: MismatchedTokenException(126!=90)
      	at org.apache.phoenix.parse.PhoenixSQLParser.recoverFromMismatchedToken(PhoenixSQLParser.java:351)
      	at org.antlr.runtime.BaseRecognizer.match(BaseRecognizer.java:115)
      	at org.apache.phoenix.parse.PhoenixSQLParser.not_expression(PhoenixSQLParser.java:6425)
      	at org.apache.phoenix.parse.PhoenixSQLParser.and_expression(PhoenixSQLParser.java:6245)
      	at org.apache.phoenix.parse.PhoenixSQLParser.or_expression(PhoenixSQLParser.java:6182)
      	at org.apache.phoenix.parse.PhoenixSQLParser.expression(PhoenixSQLParser.java:6147)
      	at org.apache.phoenix.parse.PhoenixSQLParser.not_expression(PhoenixSQLParser.java:6427)
      	at org.apache.phoenix.parse.PhoenixSQLParser.and_expression(PhoenixSQLParser.java:6245)
      	at org.apache.phoenix.parse.PhoenixSQLParser.or_expression(PhoenixSQLParser.java:6182)
      	at org.apache.phoenix.parse.PhoenixSQLParser.expression(PhoenixSQLParser.java:6147)
      	at org.apache.phoenix.parse.PhoenixSQLParser.selectable(PhoenixSQLParser.java:5209)
      	at org.apache.phoenix.parse.PhoenixSQLParser.select_list(PhoenixSQLParser.java:5050)
      	at org.apache.phoenix.parse.PhoenixSQLParser.single_select(PhoenixSQLParser.java:4315)
      	at org.apache.phoenix.parse.PhoenixSQLParser.unioned_selects(PhoenixSQLParser.java:4432)
      	at org.apache.phoenix.parse.PhoenixSQLParser.select_node(PhoenixSQLParser.java:4497)
      	at org.apache.phoenix.parse.PhoenixSQLParser.oneStatement(PhoenixSQLParser.java:765)
      	at org.apache.phoenix.parse.PhoenixSQLParser.statement(PhoenixSQLParser.java:499)
      	at org.apache.phoenix.parse.SQLParser.parseStatement(SQLParser.java:108)
      	... 22 more
      

      Show
      SELECT a.intkey, (SELECT longnum FROM bqt1.smallb AS b WHERE a.intkey = b.intkey) FROM bqt1.smalla AS a Source-specific command: SELECT g_0.intkey, (SELECT g_1.longnum FROM smallb AS g_1 WHERE g_1.intkey = g_0.intkey) FROM smalla AS g_0 Exception 07:24:00,529 WARN [org.teiid.CONNECTOR] (Worker5_QueryProcessorQueue42) Connector worker process failed for atomic-request=qvJ3png5LESA.16.2.7: org.teiid.translator.jdbc.JDBCExecutionException: 604 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT g_0.intkey, (SELECT g_1.longnum FROM smallb AS g_1 WHERE g_1.intkey = g_0.intkey) FROM smalla AS g_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.exception.PhoenixParserException: ERROR 604 (42P00): Syntax error. Mismatched input. Expecting "LPAREN", got "SELECT" at line 1, column 21. at org.apache.phoenix.exception.PhoenixParserException.newException(PhoenixParserException.java:33) at org.apache.phoenix.parse.SQLParser.parseStatement(SQLParser.java:111) at org.apache.phoenix.jdbc.PhoenixStatement$PhoenixStatementParser.parseStatement(PhoenixStatement.java:1282) at org.apache.phoenix.jdbc.PhoenixStatement.parseStatement(PhoenixStatement.java:1363) at org.apache.phoenix.jdbc.PhoenixPreparedStatement.<init>(PhoenixPreparedStatement.java:95) at org.apache.phoenix.jdbc.PhoenixConnection.prepareStatement(PhoenixConnection.java:634) at org.apache.phoenix.jdbc.PhoenixConnection.prepareStatement(PhoenixConnection.java:660) at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.doPrepareStatement(BaseWrapperManagedConnection.java:748) at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.prepareStatement(BaseWrapperManagedConnection.java:734) at org.jboss.jca.adapters.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:405) at org.teiid.translator.jdbc.JDBCBaseExecution.getPreparedStatement(JDBCBaseExecution.java:184) at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:121) ... 12 more Caused by: MismatchedTokenException(126!=90) at org.apache.phoenix.parse.PhoenixSQLParser.recoverFromMismatchedToken(PhoenixSQLParser.java:351) at org.antlr.runtime.BaseRecognizer.match(BaseRecognizer.java:115) at org.apache.phoenix.parse.PhoenixSQLParser.not_expression(PhoenixSQLParser.java:6425) at org.apache.phoenix.parse.PhoenixSQLParser.and_expression(PhoenixSQLParser.java:6245) at org.apache.phoenix.parse.PhoenixSQLParser.or_expression(PhoenixSQLParser.java:6182) at org.apache.phoenix.parse.PhoenixSQLParser.expression(PhoenixSQLParser.java:6147) at org.apache.phoenix.parse.PhoenixSQLParser.not_expression(PhoenixSQLParser.java:6427) at org.apache.phoenix.parse.PhoenixSQLParser.and_expression(PhoenixSQLParser.java:6245) at org.apache.phoenix.parse.PhoenixSQLParser.or_expression(PhoenixSQLParser.java:6182) at org.apache.phoenix.parse.PhoenixSQLParser.expression(PhoenixSQLParser.java:6147) at org.apache.phoenix.parse.PhoenixSQLParser.selectable(PhoenixSQLParser.java:5209) at org.apache.phoenix.parse.PhoenixSQLParser.select_list(PhoenixSQLParser.java:5050) at org.apache.phoenix.parse.PhoenixSQLParser.single_select(PhoenixSQLParser.java:4315) at org.apache.phoenix.parse.PhoenixSQLParser.unioned_selects(PhoenixSQLParser.java:4432) at org.apache.phoenix.parse.PhoenixSQLParser.select_node(PhoenixSQLParser.java:4497) at org.apache.phoenix.parse.PhoenixSQLParser.oneStatement(PhoenixSQLParser.java:765) at org.apache.phoenix.parse.PhoenixSQLParser.statement(PhoenixSQLParser.java:499) at org.apache.phoenix.parse.SQLParser.parseStatement(SQLParser.java:108) ... 22 more
    • Bugzilla Update:
      Perform

      Description

      Phoenix driver does not support a scalar subquery in a SELECT - E.g. SELECT a, (SELECT...) ...

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved: