参数配置说明:http://phoenix.apache.org/tuning.html
Join:http://phoenix.apache.org/joins.html
从设计角度来讲,尽可能的不使用phoenix进行关联查询,速度比直接根据条件查询慢很多很多
测试关联,异常如下
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:205)at org.apache.phoenix.execute.DelegateQueryPlan.iterator(DelegateQueryPlan.java:144)at org.apache.phoenix.execute.DelegateQueryPlan.iterator(DelegateQueryPlan.java:139)at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:312)at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:291)at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)at org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:290)at org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:283)at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1830)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.join.MaxServerCacheSizeExceededException: Size of hash cache (1024000029 bytes) exceeds the maximum allowed size (1024000000 bytes)at org.apache.phoenix.join.HashCacheClient.serialize(HashCacheClient.java:127)at org.apache.phoenix.join.HashCacheClient.addHashCache(HashCacheClient.java:85)at org.apache.phoenix.execute.HashJoinPlan$HashSubPlan.execute(HashJoinPlan.java:494)at org.apache.phoenix.execute.HashJoinPlan$1.call(HashJoinPlan.java:174)at org.apache.phoenix.execute.HashJoinPlan$1.call(HashJoinPlan.java:170)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:1142)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)at java.lang.Thread.run(Thread.java:745)
调整 phoenix.query.maxServerCacheBytes 大小,在CDH Hbase-site.xml 客户端设置即可,默认100MB