Hi, everyone, I’d like to initiate a discussion on FLIP-492: Support Query Modifications for Materialized Tables[1].
In FLIP-435[2], we introduced *MATERIALIZED TABLES*. By defining query logic and specifying data freshness requirements, users can efficiently build data pipelines, greatly improving development productivity. FLIP-492 builds on this by addressing a common need: the ability to modify the query logic of an existing MATERIALIZED TABLE. Two approaches are proposed: *1. Modifying the Query Logic: ALTER MATERIALIZED TABLE AS <query>* Retain historical data while modifying the query logic: ``` ALTER MATERIALIZED TABLE [catalog_name.][db_name.]table_name AS <query> ``` *2. Replacing the Table: CREATE OR REPLACE MATERIALIZED TABLE* Reconstruct the table with a new query, discarding all historical data: ``` CREATE [OR REPLACE] MATERIALIZED TABLE [catalog_name.][db_name.]table_name [ ([<table_constraint>]) ] [COMMENT table_comment] [PARTITIONED BY (partition_column_name1, partition_column_name2, ...)] [WITH (key1=val1, key2=val2, ...)] FRESHNESS = INTERVAL '<num>' { SECOND | MINUTE | HOUR | DAY } [REFRESH_MODE = { CONTINUOUS | FULL }] AS <select_statement> ``` For a more detailed explanation of this proposal, please refer to the FLIP-492[1] documentation. Your feedback and suggestions are highly appreciated to help refine this proposal further. Lastly, I’d like to thank Ron and Lincoln (cc’d) for their valuable input and suggestions during the drafting process. Looking forward to hearing your thoughts! Best, Feng Jin [1]. https://cwiki.apache.org/confluence/display/FLINK/FLIP-492%3A+Support+Query+Modifications+for+Materialized+Tables [2]. https://cwiki.apache.org/confluence/display/FLINK/FLIP-435%3A+Introduce+a+New+Materialized+Table+for+Simplifying+Data+Pipelines