[ https://issues.apache.org/jira/browse/PHOENIX-7031?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Saurabh Rai updated PHOENIX-7031: --------------------------------- Description: *Issue Summary:* When creating a secondary index with {{PHOENIX_ROW_TIMESTAMP()}} as one of the indexed columns and subsequently dropping a column from the data table, the secondary index does not reflect the updates as expected. This behavior is inconsistent with the expected behavior where secondary indexes should stay synchronized with changes to the data table structure. *Steps to Reproduce:* # Create a DataTable and Define a Secondary Index: # Create a DataTable with a primary key and additional columns. ## {{CREATE TABLE datatable (id varchar(10) primary key, var1 varchar(10), var2 varchar(10), var3 varchar(10));}} # Define a secondary index on {{PHOENIX_ROW_TIMESTAMP()}} for the DataTable. ## {{CREATE UNCOVERED INDEX indextable on datatable (PHOENIX_ROW_TIMESTAMP());}} # Insert Rows and Perform Column Drop: ## Insert some rows into the DataTable. # Alter the DataTable to drop a column, for example: ## {{ALTER TABLE datatable DROP COLUMN var1;}} *Expected Results:* The secondary index {{indextable}} should stay synchronized with changes to the DataTable structure, and updates to rows, including dropped columns, should be accurately reflected in the index. *Actual Results:* The secondary index {{indextable}} does not update as expected after a column is dropped from the DataTable. This behavior is inconsistent with the expected behavior of secondary indexes in Apache Phoenix. *Additional Information:* Index table gets update when we set the column value to NULL through UPSERT statement. Example - {{UPSERT INTO datatable (ID, ColumnName) SELECT ID, NULL from datatable;}} was: *Issue Summary:* When creating a secondary index with {{PHOENIX_ROW_TIMESTAMP()}} as one of the indexed columns and subsequently dropping a column from the data table, the secondary index does not reflect the updates as expected. This behavior is inconsistent with the expected behavior where secondary indexes should stay synchronized with changes to the data table structure. *Steps to Reproduce:* # Create a DataTable and Define a Secondary Index: ## Create a DataTable with a primary key and additional columns. sql {{CREATE TABLE datatable (id varchar(10) primary key, var1 varchar(10), var2 varchar(10), var3 varchar(10));}} # Define a secondary index on {{PHOENIX_ROW_TIMESTAMP()}} for the DataTable. sql {{CREATE UNCOVERED INDEX indextable on datatable (PHOENIX_ROW_TIMESTAMP());}} # Insert Rows and Perform Column Drop: ## Insert some rows into the DataTable. ## Alter the DataTable to drop a column, for example: sql {{ ALTER TABLE datatable DROP COLUMN var1;}} *Expected Results:* The secondary index {{indextable}} should stay synchronized with changes to the DataTable structure, and updates to rows, including dropped columns, should be accurately reflected in the index. *Actual Results:* The secondary index {{indextable}} does not update as expected after a column is dropped from the DataTable. This behavior is inconsistent with the expected behavior of secondary indexes in Apache Phoenix. *Additional Information:* Index table gets update when we set the column value to NULL through UPSERT statement. Example - UPSERT INTO datatable (ID, ColumnName) SELECT ID, NULL from datatable; > Secondary Index with PHOENIX_ROW_TIMESTAMP() Not Updating After Column Drop > --------------------------------------------------------------------------- > > Key: PHOENIX-7031 > URL: https://issues.apache.org/jira/browse/PHOENIX-7031 > Project: Phoenix > Issue Type: Bug > Reporter: Saurabh Rai > Priority: Major > > *Issue Summary:* When creating a secondary index with > {{PHOENIX_ROW_TIMESTAMP()}} as one of the indexed columns and subsequently > dropping a column from the data table, the secondary index does not reflect > the updates as expected. This behavior is inconsistent with the expected > behavior where secondary indexes should stay synchronized with changes to the > data table structure. > *Steps to Reproduce:* > # Create a DataTable and Define a Secondary Index: > # Create a DataTable with a primary key and additional columns. > ## {{CREATE TABLE datatable (id varchar(10) primary key, var1 varchar(10), > var2 varchar(10), var3 varchar(10));}} > # Define a secondary index on {{PHOENIX_ROW_TIMESTAMP()}} for the DataTable. > ## {{CREATE UNCOVERED INDEX indextable on datatable > (PHOENIX_ROW_TIMESTAMP());}} > # Insert Rows and Perform Column Drop: > ## Insert some rows into the DataTable. > # Alter the DataTable to drop a column, for example: > ## {{ALTER TABLE datatable DROP COLUMN var1;}} > *Expected Results:* The secondary index {{indextable}} should stay > synchronized with changes to the DataTable structure, and updates to rows, > including dropped columns, should be accurately reflected in the index. > *Actual Results:* The secondary index {{indextable}} does not update as > expected after a column is dropped from the DataTable. This behavior is > inconsistent with the expected behavior of secondary indexes in Apache > Phoenix. > > *Additional Information:* > Index table gets update when we set the column value to NULL through UPSERT > statement. > Example - > {{UPSERT INTO datatable (ID, ColumnName) SELECT ID, NULL from datatable;}} -- This message was sent by Atlassian Jira (v8.20.10#820010)