Hi, yuxia. Thanks for starting the discussion. I think it's a nice improvement to support TRUNCATE TABLE statement because many other mature engines supports it.
I have some questions. 1. because table has different types, whether we will support view or temporary tables? 2. some other engines such as spark and hive support TRUNCATE TABLE with partition. whether we will support? btw, i think you need give the TRUNCATE TABLE concrete syntax in the FLIP because some engines has different syntaxes. for example, hive allow TRUNCATE TABLE be TRUNCATE [TABLE] which means TABLE keyword can be optional. 3. The Proposed Changes try to use SqlToOperationConverter and run in TableEnvironmentImpl#executeInternal. I think it's out of date, the community is refactoring the conversion logic from SqlNode to operation[1] and executions in TableEnvironmentImpl[2]. I suggest you can use new way to support it. [1] https://issues.apache.org/jira/browse/FLINK-31464 [2] https://issues.apache.org/jira/browse/FLINK-31368 Best Regards, Ran Tao https://github.com/chucheng92 yuxia <luoyu...@alumni.sjtu.edu.cn> 于2023年3月22日周三 21:13写道: > Hi, devs. > > I'd like to start a discussion about FLIP-302: Support TRUNCATE TABLE > statement [1]. > > The TRUNCATE TABLE statement is a SQL command that allows users to quickly > and efficiently delete all rows from a table without dropping the table > itself. This statement is commonly used in data warehouse, where large data > sets are frequently loaded and unloaded from tables. > So, this FLIP is meant to support TRUNCATE TABLE statement. M ore exactly, > this FLIP will bring Flink the TRUNCATE TABLE syntax and an interface with > which the coresponding connectors can implement their own logic for > truncating table. > > Looking forwards to your feedback. > > [1]: [ > https://cwiki.apache.org/confluence/display/FLINK/FLIP-302%3A+Support+TRUNCATE+TABLE+statement > | > https://cwiki.apache.org/confluence/display/FLINK/FLIP-302%3A+Support+TRUNCATE+TABLE+statement > ] > > > Best regards, > Yuxia >