[
https://issues.apache.org/jira/browse/PHOENIX-927?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13965970#comment-13965970
]
alex kamil edited comment on PHOENIX-927 at 4/11/14 12:51 AM:
--------------------------------------------------------------
[~maryannxue] , I checked the primary use case with joins and it works as
expected, many thanks.
Below use cases are still not working (these are simpler queries without joins
which belong to PHOENIX-136 ticket):
USE CASE 2: SELECT a.col1 FROM (SELECT rk, col1 FROM table1 WHERE col1 LIKE
'foo%' AND col300 IS NOT NULL) AS a ;
Error:: java.lang.ClassCastException: org.apache.phoenix.parse.DerivedTableNode
cannot be cast to org.apache.phoenix.parse.NamedTableNode
at
org.apache.phoenix.compile.FromCompiler.getResolverForQuery(FromCompiler.java:157)
at
org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:262)
at
org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:253)
at
org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:199)
at
org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:922)
at sqlline.SqlLine$Commands.execute(SqlLine.java:3673)
at sqlline.SqlLine$Commands.sql(SqlLine.java:3584)
at sqlline.SqlLine.dispatch(SqlLine.java:821)
at sqlline.SqlLine.begin(SqlLine.java:699)
at sqlline.SqlLine.mainWithInputRedirection(SqlLine.java:441)
at sqlline.SqlLine.main(SqlLine.java:424)
USE CASE 3: SELECT col1 FROM table1 where col3 > (SELECT count(col300) FROM
table2)
Error: ERROR 602 (42P00): Syntax error. Missing "LPAREN" at line 1, column 31.
(state=42P00,code=602)
USE CASE 4: SELECT rk, col1 FROM table1 WHERE col1 IN (SELECT col1 FROM
table2 WHERE col3= 'foo')
was (Author: alexdl):
[~maryannxue] , I checked the primary use case with joins and it works as
expected, many thanks.
Below use cases are still not working (these are simpler queries without joins
which belong to PHOENIX-136 ticket):
USE CASE 2: SELECT a.col1 FROM (SELECT rk, col1 FROM table1 WHERE col1 LIKE
'foo%' AND col300 IS NOT NULL) AS a ;
Error:: java.lang.ClassCastException: org.apache.phoenix.parse.DerivedTableNode
cannot be cast to org.apache.phoenix.parse.NamedTableNode
at
org.apache.phoenix.compile.FromCompiler.getResolverForQuery(FromCompiler.java:157)
at
org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:262)
at
org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:253)
at
org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:199)
at
org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:922)
at sqlline.SqlLine$Commands.execute(SqlLine.java:3673)
at sqlline.SqlLine$Commands.sql(SqlLine.java:3584)
at sqlline.SqlLine.dispatch(SqlLine.java:821)
at sqlline.SqlLine.begin(SqlLine.java:699)
at sqlline.SqlLine.mainWithInputRedirection(SqlLine.java:441)
at sqlline.SqlLine.main(SqlLine.java:424)
USE CASE 3: SELECT col1 FROM table1 where col3 > (SELECT count(col300) FROM
table2)
Error: ERROR 602 (42P00): Syntax error. Missing "LPAREN" at line 1, column 31.
(state=42P00,code=602)
> Support derived tables in joins
> -------------------------------
>
> Key: PHOENIX-927
> URL: https://issues.apache.org/jira/browse/PHOENIX-927
> Project: Phoenix
> Issue Type: Sub-task
> Reporter: Maryann Xue
> Assignee: Maryann Xue
> Labels: enhancement
> Fix For: 3.0.0, 4.0.0, 5.0.0
>
> Original Estimate: 240h
> Remaining Estimate: 240h
>
> Support grammar like:
> SELECT a.col1, b.col2, c.col3 FROM
> (SELECT rk, col1 FROM table1 WHERE col1 LIKE 'foo%' AND col300 IS NULL) AS a
> JOIN (SELECT rk, col2 FROM table2 WHERE col2 LIKE 'bar%') AS b ON a.rk=b.rk
> JOIN (SELECT rk, col3 FROM table3 ) AS c ON a.rk=c.rk;
--
This message was sent by Atlassian JIRA
(v6.2#6252)