Lars Hofhansl created PHOENIX-4938: -------------------------------------- Summary: SELECT compilation failure when a local index is present Key: PHOENIX-4938 URL: https://issues.apache.org/jira/browse/PHOENIX-4938 Project: Phoenix Issue Type: Improvement Reporter: Lars Hofhansl
{{create table test (pk integer primary key, v1 float, v2 float, v3 integer);}} {{create local index local1 on test(v2);}} Now {{select count(*) from test t1, test t2 where t1.v1 = t2.v1 and t2.v2 < 0.001;}} will throw {code} Error: ERROR 1012 (42M03): Table undefined. tableName=T2 (state=42M03,code=1012) org.apache.phoenix.schema.TableNotFoundException: ERROR 1012 (42M03): Table undefined. tableName=T2 at org.apache.phoenix.compile.FromCompiler$MultiTableColumnResolver.resolveTable(FromCompiler.java:869) at org.apache.phoenix.compile.FromCompiler$ProjectedTableColumnResolver.resolveColumn(FromCompiler.java:1029) at org.apache.phoenix.compile.ExpressionCompiler.resolveColumn(ExpressionCompiler.java:372) at org.apache.phoenix.compile.ProjectionCompiler$SelectClauseVisitor.resolveColumn(ProjectionCompiler.java:621) at org.apache.phoenix.compile.ExpressionCompiler.visit(ExpressionCompiler.java:408) at org.apache.phoenix.compile.ProjectionCompiler$SelectClauseVisitor.visit(ProjectionCompiler.java:628) at org.apache.phoenix.compile.ProjectionCompiler$SelectClauseVisitor.visit(ProjectionCompiler.java:585) at org.apache.phoenix.parse.ColumnParseNode.accept(ColumnParseNode.java:56) at org.apache.phoenix.compile.ProjectionCompiler.compile(ProjectionCompiler.java:412) at org.apache.phoenix.compile.QueryCompiler.compileSingleFlatQuery(QueryCompiler.java:564) at org.apache.phoenix.compile.QueryCompiler.compileJoinQuery(QueryCompiler.java:219) at org.apache.phoenix.compile.QueryCompiler.compileJoinQuery(QueryCompiler.java:295) at org.apache.phoenix.compile.QueryCompiler.compileJoinQuery(QueryCompiler.java:230) at org.apache.phoenix.compile.QueryCompiler.compileSelect(QueryCompiler.java:193) at org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:155) at org.apache.phoenix.optimize.QueryOptimizer.getApplicablePlans(QueryOptimizer.java:189) at org.apache.phoenix.optimize.QueryOptimizer.optimize(QueryOptimizer.java:111) at org.apache.phoenix.optimize.QueryOptimizer.optimize(QueryOptimizer.java:97) 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) {code} This will not happen when there is no local index defined. -- This message was sent by Atlassian JIRA (v7.6.3#76005)