You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "mike yang (JIRA)" <ji...@apache.org> on 2018/03/28 03:17:00 UTC

[jira] [Created] (PHOENIX-4676) union all can not work as expected.

mike yang created PHOENIX-4676:
----------------------------------

             Summary: union all can not work as expected.
                 Key: PHOENIX-4676
                 URL: https://issues.apache.org/jira/browse/PHOENIX-4676
             Project: Phoenix
          Issue Type: Bug
    Affects Versions: 4.9.0
         Environment: phoenix-for-cloudera-4.9-HBase-1.2-cdh5.9/

get code from git and compiled it.
            Reporter: mike yang


Hi,

I am use the phoenix to do the follow union all query:

select distinct t1.IDNO from (select IDNO from LOC_TRAVEL union all select IDNO from LOC_HOTEL) t1 join (select IDNO from LOC_TRAVEL union all select IDNO from LOC_HOTEL) t2 on t1.IDNO = t2.IDNO;

but some error was reported:
Error: Encountered exception in sub plan [0] execution. (state=,code=0)
java.sql.SQLException: Encountered exception in sub plan [0] execution.
 at org.apache.phoenix.execute.HashJoinPlan.iterator(HashJoinPlan.java:192)
 at org.apache.phoenix.execute.DelegateQueryPlan.iterator(DelegateQueryPlan.java:138)
 at org.apache.phoenix.execute.DelegateQueryPlan.iterator(DelegateQueryPlan.java:133)
 at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:290)
 at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:270)
 at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
 at org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:269)
 at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1515)
 at sqlline.Commands.execute(Commands.java:822)
 at sqlline.Commands.sql(Commands.java:732)
 at sqlline.SqlLine.dispatch(SqlLine.java:813)
 at sqlline.SqlLine.begin(SqlLine.java:686)
 at sqlline.SqlLine.start(SqlLine.java:398)
 at sqlline.SqlLine.main(SqlLine.java:291)
Caused by: org.apache.phoenix.schema.TableNotFoundException: ERROR 1012 (42M03): Table undefined. tableName=unionSchemaName.unionTableName
 at org.apache.phoenix.query.ConnectionQueryServicesImpl.getAllTableRegions(ConnectionQueryServicesImpl.java:548)
 at org.apache.phoenix.cache.ServerCacheClient.addServerCache(ServerCacheClient.java:167)
 at org.apache.phoenix.join.HashCacheClient.addHashCache(HashCacheClient.java:84)
 at org.apache.phoenix.execute.HashJoinPlan$HashSubPlan.execute(HashJoinPlan.java:378)
 at org.apache.phoenix.execute.HashJoinPlan$1.call(HashJoinPlan.java:160)
 at org.apache.phoenix.execute.HashJoinPlan$1.call(HashJoinPlan.java:156)
 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
 at org.apache.phoenix.job.JobManager$InstrumentedJobFutureTask.run(JobManager.java:183)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
 at java.lang.Thread.run(Thread.java:748)

 

if I change the first union all statement as some other query statement, for example:

select distinct t1.IDNO from (select IDNO from LOC_TRAVEL) t1 join (select IDNO from LOC_TRAVEL union all select IDNO from LOC_HOTEL) t2 on t1.IDNO = t2.IDNO;

it can work. 

I don't know why phoenix take the union all operator as a table in the first statement? are there some limits in Phoenix sql.

Please help me about this, it's an urgent issue to .

 

thanks a lot!

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)