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

Index on data table with only pk columns result into invalid state

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.1.3
    • 5.2.0, 5.1.4
    • None
    • None

    Description

      For a given data table with only primary keys (and no other non-pk columns), creating uncovered or covered index on a function results in the index table getting stuck in the BUILDING state:

      CREATE TABLE T1 (ID VARCHAR(15) NOT NULL PRIMARY KEY);
      
      CREATE INDEX IDX_T1 ON T1 (PHOENIX_ROW_TIMESTAMP()); 

      CREATE INDEX results into:

      Error: ERROR 1001 (42I01): Undefined column family. familyName=0 (state=42I01,code=1001)
      org.apache.phoenix.schema.ColumnFamilyNotFoundException: ERROR 1001 (42I01): Undefined column family. familyName=0
      	at org.apache.phoenix.schema.PTableImpl.getColumnFamily(PTableImpl.java:1592)
      	at org.apache.phoenix.index.IndexMaintainer$5.addDataColInfo(IndexMaintainer.java:617)
      	at org.apache.phoenix.index.IndexMaintainer$5.visit(IndexMaintainer.java:593)
      	at org.apache.phoenix.index.IndexMaintainer$5.visit(IndexMaintainer.java:590)
      	at org.apache.phoenix.expression.KeyValueColumnExpression.accept(KeyValueColumnExpression.java:143)
      	at org.apache.phoenix.expression.BaseExpression.acceptChildren(BaseExpression.java:244)
      	at org.apache.phoenix.expression.function.ScalarFunction.accept(ScalarFunction.java:70)
      	at org.apache.phoenix.index.IndexMaintainer.<init>(IndexMaintainer.java:638)
      	at org.apache.phoenix.index.IndexMaintainer.create(IndexMaintainer.java:148)
      	at org.apache.phoenix.schema.PTableImpl.getIndexMaintainer(PTableImpl.java:1725)
      	at org.apache.phoenix.compile.ServerBuildIndexCompiler.compile(ServerBuildIndexCompiler.java:104)
      	at org.apache.phoenix.schema.MetaDataClient.getMutationPlanForBuildingIndex(MetaDataClient.java:1285)
      	at org.apache.phoenix.schema.MetaDataClient.buildIndex(MetaDataClient.java:1294)
      	at org.apache.phoenix.schema.MetaDataClient.createIndex(MetaDataClient.java:1698)
      	at org.apache.phoenix.compile.CreateIndexCompiler$1.execute(CreateIndexCompiler.java:85)
      	at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:559)
      	at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:525)
      	at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
      	at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:524)
      	at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:512)
      	at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:2202)
      	at sqlline.Commands.executeSingleQuery(Commands.java:1054)
      	at sqlline.Commands.execute(Commands.java:1003)
      	at sqlline.Commands.sql(Commands.java:967)
      	at sqlline.SqlLine.dispatch(SqlLine.java:734)
      	at sqlline.SqlLine.begin(SqlLine.java:541)
      	at sqlline.SqlLine.start(SqlLine.java:267)
      	at sqlline.SqlLine.main(SqlLine.java:206) 

       

      While the index table does get created, it stays in the BUILDING state because the index build fails to generate IndexMaintainer for the given index table.

      Attachments

        Issue Links

          Activity

            People

              vjasani Viraj Jasani
              vjasani Viraj Jasani
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: