[ https://issues.apache.org/jira/browse/PHOENIX-7035?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Viraj Jasani resolved PHOENIX-7035. ----------------------------------- Resolution: Fixed > Index on data table with only pk columns result into invalid state > ------------------------------------------------------------------ > > Key: PHOENIX-7035 > URL: https://issues.apache.org/jira/browse/PHOENIX-7035 > Project: Phoenix > Issue Type: Bug > Affects Versions: 5.1.3 > Reporter: Viraj Jasani > Assignee: Viraj Jasani > Priority: Major > Fix For: 5.2.0, 5.1.4 > > > 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: > {code:java} > CREATE TABLE T1 (ID VARCHAR(15) NOT NULL PRIMARY KEY); > CREATE INDEX IDX_T1 ON T1 (PHOENIX_ROW_TIMESTAMP()); {code} > CREATE INDEX results into: > {code:java} > 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) {code} > > 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. -- This message was sent by Atlassian Jira (v8.20.10#820010)