Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.13.0
Description
create a SqlCreateTable using like clause and then toString() or unparse() will lose watermark
if no column.
public static SqlParser getSqlParser(String sql) { SourceStringReader sqlReader = new SourceStringReader(sql); return SqlParser.create(sqlReader, SqlParser.configBuilder() .setParserFactory(FlinkSqlParserImpl.FACTORY) .setLex(Lex.JAVA) .setIdentifierMaxLength(256) .setConformance(FlinkSqlConformance.DEFAULT) .build()); } public static void main(String[] args) throws Exception { SqlParser sqlParser = getSqlParser("" + "create TEMPORARY table t_order_course (\n" + " WATERMARK FOR last_update_time AS last_update_time - INTERVAL '5' SECOND\n" + ") with (\n" + " 'scan.startup.mode' = 'specific-offsets',\n" + " 'scan.startup.specific-offsets' = 'partition:0,offset:1169129'\n" + ") like cdc.`qq_data(sh-backend-tst:3306)`.t_order_course (\n" + " OVERWRITING WATERMARKS\n" + " OVERWRITING OPTIONS\n" + " EXCLUDING CONSTRAINTS\n" + " \n" + ")"); SqlNode sqlNode = sqlParser.parseStmt(); System.out.println(sqlNode.toString()); }
output:
CREATE TEMPORARY TABLE `t_order_course` WITH ( 'scan.startup.mode' = 'specific-offsets', 'scan.startup.specific-offsets' = 'partition:0,offset:1169129' ) LIKE `cdc`.`qq_data(sh-backend-tst:3306)`.`t_order_course` ( OVERWRITING WATERMARKS OVERWRITING OPTIONS EXCLUDING CONSTRAINTS )
Attachments
Attachments
Issue Links
- links to