|
16 | 16 | * limitations under the License. |
17 | 17 | */ |
18 | 18 |
|
19 | | - |
| 19 | + |
20 | 20 |
|
21 | 21 | package com.dtstack.flink.sql; |
22 | 22 |
|
|
34 | 34 | import com.dtstack.flink.sql.watermarker.WaterMarkerAssigner; |
35 | 35 | import com.dtstack.flink.sql.util.FlinkUtil; |
36 | 36 | import com.dtstack.flink.sql.util.PluginUtil; |
| 37 | +import org.apache.calcite.config.Lex; |
37 | 38 | import org.apache.calcite.sql.SqlInsert; |
38 | 39 | import org.apache.calcite.sql.SqlNode; |
39 | 40 | import org.apache.commons.cli.CommandLine; |
@@ -185,7 +186,12 @@ public static void main(String[] args) throws Exception { |
185 | 186 | if (sqlTree.getTmpTableMap().containsKey(tableName)) { |
186 | 187 | CreateTmpTableParser.SqlParserResult tmp = sqlTree.getTmpTableMap().get(tableName); |
187 | 188 | String realSql = DtStringUtil.replaceIgnoreQuota(result.getExecSql(), "`", ""); |
188 | | - SqlNode sqlNode = org.apache.calcite.sql.parser.SqlParser.create(realSql).parseStmt(); |
| 189 | + |
| 190 | + org.apache.calcite.sql.parser.SqlParser.Config config = org.apache.calcite.sql.parser.SqlParser |
| 191 | + .configBuilder() |
| 192 | + .setLex(Lex.MYSQL) |
| 193 | + .build(); |
| 194 | + SqlNode sqlNode = org.apache.calcite.sql.parser.SqlParser.create(realSql,config).parseStmt(); |
189 | 195 | String tmpSql = ((SqlInsert) sqlNode).getSource().toString(); |
190 | 196 | tmp.setExecSql(tmpSql); |
191 | 197 | sideSqlExec.registerTmpTable(tmp, sideTableMap, tableEnv, registerTableCache); |
@@ -246,7 +252,7 @@ private static void registerUDF(SqlTree sqlTree, List<URL> jarURList, URLClassLo |
246 | 252 | classLoader = FlinkUtil.loadExtraJar(jarURList, parentClassloader); |
247 | 253 | } |
248 | 254 | classLoader.loadClass(funcInfo.getClassName()); |
249 | | - FlinkUtil.registerUDF(funcInfo.getType(), funcInfo.getClassName(), funcInfo.getName().toUpperCase(), |
| 255 | + FlinkUtil.registerUDF(funcInfo.getType(), funcInfo.getClassName(), funcInfo.getName(), |
250 | 256 | tableEnv, classLoader); |
251 | 257 | } |
252 | 258 | } |
|
0 commit comments