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
- is related to
-
PHOENIX-7001 Change Data Capture leveraging Max Lookback and Uncovered Indexes
- Resolved
- links to