Bug 1272913 - HBase - table's alias (... AS ...) is not "visible" in SELECT caluse in IN predicate
HBase - table's alias (... AS ...) is not "visible" in SELECT caluse in IN pr...
Status: CLOSED WONTFIX
Product: JBoss Data Virtualization 6
Classification: JBoss
Component: Teiid (Show other bugs)
6.2.0
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Van Halbert
Juraj Duráni
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-19 04:19 EDT by Juraj Duráni
Modified: 2016-06-17 08:41 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-06-17 08:41:29 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker TEIID-3770 Major Resolved HBase - table's alias (... AS ...) is not "visible" in SELECT caluse in IN predicate 2016-07-11 08:05 EDT

  None (edit)
Description Juraj Duráni 2015-10-19 04:19:05 EDT
Description of problem:
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.


Steps to Reproduce:
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
Comment 1 JBoss JIRA Server 2015-10-20 16:58:30 EDT
Steven Hawkins <shawkins@redhat.com> updated the status of jira TEIID-3770 to Resolved
Comment 2 JBoss JIRA Server 2016-01-27 16:25:02 EST
Steven Hawkins <shawkins@redhat.com> updated the status of jira TEIID-3770 to Closed
Comment 3 Juraj Duráni 2016-06-15 06:40:47 EDT
Now, Teiid throws different exception:

12:37:27,261 WARN  [org.teiid.PROCESSOR] (Worker3_QueryProcessorQueue181) TEIID30020 Processing exception for request r7NYsl824ly1.8 'TEIID30504 Source: 602 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 = SOME (SELECT MAX(g_1.bigdecimalvalue) FROM smalla AS g_1 WHERE g_1.intkey = g_0.intkey) ORDER BY c_0]'. Originally TeiidProcessingException PhoenixSQLParser.java:345.: org.teiid.core.TeiidProcessingException: TEIID30504 Source: 602 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 = SOME (SELECT MAX(g_1.bigdecimalvalue) FROM smalla AS g_1 WHERE g_1.intkey = g_0.intkey) ORDER BY c_0]
	at org.teiid.dqp.internal.process.DataTierTupleSource.exceptionOccurred(DataTierTupleSource.java:401) [teiid-engine-8.12.5.redhat-6.jar:8.12.5.redhat-6]
	at org.teiid.dqp.internal.process.DataTierTupleSource.nextTuple(DataTierTupleSource.java:161) [teiid-engine-8.12.5.redhat-6.jar:8.12.5.redhat-6]
	at org.teiid.query.processor.relational.AccessNode.nextBatchDirect(AccessNode.java:391) [teiid-engine-8.12.5.redhat-6.jar:8.12.5.redhat-6]
	at org.teiid.query.processor.relational.RelationalNode.nextBatch(RelationalNode.java:282) [teiid-engine-8.12.5.redhat-6.jar:8.12.5.redhat-6]
	at org.teiid.query.processor.relational.RelationalPlan.nextBatch(RelationalPlan.java:145) [teiid-engine-8.12.5.redhat-6.jar:8.12.5.redhat-6]
	at org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:151) [teiid-engine-8.12.5.redhat-6.jar:8.12.5.redhat-6]
	at org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:114) [teiid-engine-8.12.5.redhat-6.jar:8.12.5.redhat-6]
	at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:164) [teiid-engine-8.12.5.redhat-6.jar:8.12.5.redhat-6]
	at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:146) [teiid-engine-8.12.5.redhat-6.jar:8.12.5.redhat-6]
	at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:472) [teiid-engine-8.12.5.redhat-6.jar:8.12.5.redhat-6]
	at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:348) [teiid-engine-8.12.5.redhat-6.jar:8.12.5.redhat-6]
	at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51) [teiid-engine-8.12.5.redhat-6.jar:8.12.5.redhat-6]
	at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:274) [teiid-engine-8.12.5.redhat-6.jar:8.12.5.redhat-6]
	at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276) [teiid-engine-8.12.5.redhat-6.jar:8.12.5.redhat-6]
	at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) [teiid-engine-8.12.5.redhat-6.jar:8.12.5.redhat-6]
	at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210) [teiid-engine-8.12.5.redhat-6.jar:8.12.5.redhat-6]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0-internal]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0-internal]
	at java.lang.Thread.run(Thread.java:744) [rt.jar:1.8.0-internal]
Caused by: org.teiid.translator.jdbc.JDBCExecutionException: 602 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 = SOME (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:364) [teiid-engine-8.12.5.redhat-6.jar:8.12.5.redhat-6]
	at sun.reflect.GeneratedMethodAccessor98.invoke(Unknown Source) [:1.8.0-internal]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0-internal]
	at java.lang.reflect.Method.invoke(Method.java:483) [rt.jar:1.8.0-internal]
	at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211) [teiid-engine-8.12.5.redhat-6.jar:8.12.5.redhat-6]
	at com.sun.proxy.$Proxy47.execute(Unknown Source)
	at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:306) [teiid-engine-8.12.5.redhat-6.jar:8.12.5.redhat-6]
	at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:112) [teiid-engine-8.12.5.redhat-6.jar:8.12.5.redhat-6]
	at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:108) [teiid-engine-8.12.5.redhat-6.jar:8.12.5.redhat-6]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0-internal]
	at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:65) [teiid-engine-8.12.5.redhat-6.jar:8.12.5.redhat-6]
	... 6 more
Caused by: org.apache.phoenix.exception.PhoenixParserException: ERROR 602 (42P00): Syntax error. Missing "LPAREN" at line 1, column 79.
	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:1105)
	at org.apache.phoenix.jdbc.PhoenixStatement.parseStatement(PhoenixStatement.java:1186)
	at org.apache.phoenix.jdbc.PhoenixPreparedStatement.<init>(PhoenixPreparedStatement.java:94)
	at org.apache.phoenix.jdbc.PhoenixConnection.prepareStatement(PhoenixConnection.java:633)
	at org.apache.phoenix.jdbc.PhoenixConnection.prepareStatement(PhoenixConnection.java:659)
	at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.doPrepareStatement(BaseWrapperManagedConnection.java:744)
	at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.prepareStatement(BaseWrapperManagedConnection.java:730)
	at org.jboss.jca.adapters.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:405)
	at org.teiid.translator.jdbc.JDBCBaseExecution.getPreparedStatement(JDBCBaseExecution.java:196)
	at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:121)
	... 17 more
Caused by: MissingTokenException(inserted [@-1,0:0='<missing LPAREN>',<88>,1:78] at g_0)
	at org.apache.phoenix.parse.PhoenixSQLParser.recoverFromMismatchedToken(PhoenixSQLParser.java:345)
	at org.antlr.runtime.BaseRecognizer.match(BaseRecognizer.java:115)
	at org.apache.phoenix.parse.PhoenixSQLParser.not_expression(PhoenixSQLParser.java:6265)
	at org.apache.phoenix.parse.PhoenixSQLParser.and_expression(PhoenixSQLParser.java:6085)
	at org.apache.phoenix.parse.PhoenixSQLParser.or_expression(PhoenixSQLParser.java:6022)
	at org.apache.phoenix.parse.PhoenixSQLParser.expression(PhoenixSQLParser.java:5987)
	at org.apache.phoenix.parse.PhoenixSQLParser.single_select(PhoenixSQLParser.java:4190)
	at org.apache.phoenix.parse.PhoenixSQLParser.unioned_selects(PhoenixSQLParser.java:4272)
	at org.apache.phoenix.parse.PhoenixSQLParser.select_node(PhoenixSQLParser.java:4337)
	at org.apache.phoenix.parse.PhoenixSQLParser.oneStatement(PhoenixSQLParser.java:730)
	at org.apache.phoenix.parse.PhoenixSQLParser.statement(PhoenixSQLParser.java:495)
	at org.apache.phoenix.parse.SQLParser.parseStatement(SQLParser.java:108)
	... 27 more
Comment 4 JBoss JIRA Server 2016-06-15 11:02:03 EDT
Van Halbert <vhalbert@jboss.org> updated the status of jira TEIID-3770 to Reopened
Comment 5 JBoss JIRA Server 2016-06-17 08:39:24 EDT
Steven Hawkins <shawkins@redhat.com> updated the status of jira TEIID-3770 to Resolved

Note You need to log in before you can comment on or make changes to this bug.