[ 
https://issues.apache.org/jira/browse/PHOENIX-4938?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lars Hofhansl updated PHOENIX-4938:
-----------------------------------
    Description: 
{{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.

  was:
{{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.


> 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
>            Priority: Major
>
> {{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)

Reply via email to