refactor: 使用Calcite新方法替换过时方法

This commit is contained in:
junjun 2024-02-01 11:37:04 +08:00
parent 7f1e1554e2
commit 5344368145
2 changed files with 6 additions and 8 deletions

View File

@ -43,10 +43,9 @@ public class SqlparserUtils {
}
SqlParser.Config config =
SqlParser.configBuilder()
.setLex(Lex.JAVA)
.setIdentifierMaxLength(256)
.build();
SqlParser.config()
.withLex(Lex.JAVA)
.withIdentifierMaxLength(256);
SqlParser sqlParser = SqlParser.create(tmpSql, config);
SqlNode sqlNode;
try {

View File

@ -21,10 +21,9 @@ public class SqlUtils {
}
SqlParser.Config config =
SqlParser.configBuilder()
.setLex(Lex.JAVA)
.setIdentifierMaxLength(256)
.build();
SqlParser.config()
.withLex(Lex.JAVA)
.withIdentifierMaxLength(256);
// 创建解析器
SqlParser sqlParser = SqlParser
.create(sql, config);