[
https://issues.apache.org/jira/browse/PHOENIX-4859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16644028#comment-16644028
]
Hudson commented on PHOENIX-4859:
---------------------------------
FAILURE: Integrated in Jenkins build PreCommit-PHOENIX-Build #2081 (See
[https://builds.apache.org/job/PreCommit-PHOENIX-Build/2081/])
PHOENIX-4859 Using local index in where statement for join (only rhs
(rajeshbabu: rev 9a818dd43527008890d7b1cfa353725ff042f630)
* (edit) phoenix-core/src/main/java/org/apache/phoenix/compile/JoinCompiler.java
* (edit)
phoenix-core/src/main/java/org/apache/phoenix/schema/LocalIndexDataColumnRef.java
* (edit)
phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java
* (edit)
phoenix-core/src/main/java/org/apache/phoenix/compile/ExpressionCompiler.java
* (edit)
phoenix-core/src/main/java/org/apache/phoenix/compile/ProjectionCompiler.java
* (edit)
phoenix-core/src/main/java/org/apache/phoenix/compile/TupleProjectionCompiler.java
> Using local index in where statement for join (only rhs table) query fails
> --------------------------------------------------------------------------
>
> Key: PHOENIX-4859
> URL: https://issues.apache.org/jira/browse/PHOENIX-4859
> Project: Phoenix
> Issue Type: Bug
> Affects Versions: 5.0.0
> Reporter: Subrat Mishra
> Assignee: Rajeshbabu Chintaguntla
> Priority: Major
> Fix For: 4.15.0, 5.1.0
>
> Attachments: PHOENIX-4859.patch
>
>
> Consider a simple scenario:
> {code:java}
> CREATE TABLE cust_data (customer_id integer primary key, postal_code varchar,
> country_code varchar);
> UPSERT INTO cust_data values(1,'560103','IN');
> CREATE LOCAL INDEX ZIP_INDEX ON cust_data(postal_code);
> SELECT * from cust_data c1, cust_data c2 where c1.customer_id=c2.customer_id
> and c2.postal_code='560103'; {code}
> Query fails with an exception:
> {code:java}
> java.lang.NullPointerException
> at
> org.apache.phoenix.schema.LocalIndexDataColumnRef.<init>(LocalIndexDataColumnRef.java:40)
> at
> org.apache.phoenix.compile.ProjectionCompiler.projectAllIndexColumns(ProjectionCompiler.java:221)
> at
> org.apache.phoenix.compile.ProjectionCompiler.compile(ProjectionCompiler.java:389)
> at
> org.apache.phoenix.compile.QueryCompiler.compileSingleFlatQuery(QueryCompiler.java:561)
> at
> org.apache.phoenix.compile.QueryCompiler.compileJoinQuery(QueryCompiler.java:320)
> at
> org.apache.phoenix.compile.QueryCompiler.compileJoinQuery(QueryCompiler.java:228)
> at
> org.apache.phoenix.compile.QueryCompiler.compileSelect(QueryCompiler.java:191)
> at org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:153)
> at
> org.apache.phoenix.optimize.QueryOptimizer.getApplicablePlans(QueryOptimizer.java:190)
> at
> org.apache.phoenix.optimize.QueryOptimizer.optimize(QueryOptimizer.java:112)
> at org.apache.phoenix.optimize.QueryOptimizer.optimize(QueryOptimizer.java:98)
> at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:309)
> 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){code}
> Interestingly if we change c2.postal_code to c1.postal_code in where clause
> like shown below then the query runs fine.
> {code:java}
> SELECT * from cust_data c1, cust_data c2 where c1.customer_id=c2.customer_id
> and c1.postal_code='560103'; {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)