Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-4938

SELECT compilation failure when a local index is present

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None

    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

      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)
      

      This will not happen when there is no local index defined.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            larsh Lars Hofhansl

            Dates

              Created:
              Updated:

              Slack

                Issue deployment