2222
2323import com .dtstack .flink .sql .enums .ETableType ;
2424import com .dtstack .flink .sql .table .TableInfo ;
25- import com .dtstack .flink .sql .table .TableInfoParserFactory ;
25+ import com .dtstack .flink .sql .table .TableInfoParser ;
2626import com .dtstack .flink .sql .util .DtStringUtil ;
2727import org .apache .commons .lang3 .StringUtils ;
2828import org .apache .flink .shaded .curator .org .apache .curator .shaded .com .google .common .collect .Lists ;
@@ -75,7 +75,7 @@ public static SqlTree parseSql(String sql) throws Exception {
7575
7676 List <String > sqlArr = DtStringUtil .splitIgnoreQuota (sql , SQL_DELIMITER );
7777 SqlTree sqlTree = new SqlTree ();
78-
78+ TableInfoParser tableInfoParser = new TableInfoParser ();
7979 for (String childSql : sqlArr ){
8080 if (Strings .isNullOrEmpty (childSql )){
8181 continue ;
@@ -112,7 +112,7 @@ public static SqlTree parseSql(String sql) throws Exception {
112112 throw new RuntimeException ("can't find table " + tableName );
113113 }
114114
115- TableInfo tableInfo = TableInfoParserFactory .parseWithTableType (ETableType .SOURCE .getType (),
115+ TableInfo tableInfo = tableInfoParser .parseWithTableType (ETableType .SOURCE .getType (),
116116 createTableResult , LOCAL_SQL_PLUGIN_ROOT );
117117 sqlTree .addTableInfo (tableName , tableInfo );
118118 }
@@ -125,7 +125,7 @@ public static SqlTree parseSql(String sql) throws Exception {
125125 throw new RuntimeException ("can't find table " + tableName );
126126 }
127127
128- TableInfo tableInfo = TableInfoParserFactory .parseWithTableType (ETableType .SINK .getType (),
128+ TableInfo tableInfo = tableInfoParser .parseWithTableType (ETableType .SINK .getType (),
129129 createTableResult , LOCAL_SQL_PLUGIN_ROOT );
130130 sqlTree .addTableInfo (tableName , tableInfo );
131131 }
@@ -141,7 +141,7 @@ public static SqlTree parseSql(String sql) throws Exception {
141141 throw new RuntimeException ("can't find table " + tableName );
142142 }
143143
144- TableInfo tableInfo = TableInfoParserFactory .parseWithTableType (ETableType .SOURCE .getType (),
144+ TableInfo tableInfo = tableInfoParser .parseWithTableType (ETableType .SOURCE .getType (),
145145 createTableResult , LOCAL_SQL_PLUGIN_ROOT );
146146 sqlTree .addTableInfo (tableName , tableInfo );
147147 }
0 commit comments