Apache Pheonix 添加一个覆盖列到索引 table

Apache Pheonix add a covered column to index table

我使用 shell 命令构建了一个 pheonix table:

CREATE TABLE Student (Id VARCHAR, Grade VARCHAR, Name VARCHAR, College VARCHAR, Age VARCHAR, CONSTRAINT PK_CONSTRAINT PRIMARY KEY(Id));

我在字段 Age:

上建立了一个索引 table
CREATE INDEX StudentIndex ON Student (Age) INCLUDE(Id, Grade, Name);

现在我想在 StudentIndex table 中涵盖 Student table 的 College 字段。是否有任何 Alter 命令可以帮助我将此列添加到索引中的覆盖字段。谁能帮我解决这个问题。

您不能更改索引。由于需要重建索引,只需删除之前的索引并创建一个新索引:

DROP INDEX StudentIndex ON Student 
CREATE INDEX StudentIndex ON Student (Age) INCLUDE(Id, Grade, Name, College);