Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修复解析sql条件为global in的问题,补充Clickhouse相关数据库类型的处理 #4881

Merged
merged 1 commit into from
Aug 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import com.alibaba.druid.sql.dialect.antspark.parser.AntsparkLexer;
import com.alibaba.druid.sql.dialect.antspark.parser.AntsparkStatementParser;
import com.alibaba.druid.sql.dialect.blink.parser.BlinkStatementParser;
import com.alibaba.druid.sql.dialect.clickhouse.parser.ClickhouseExprParser;
import com.alibaba.druid.sql.dialect.clickhouse.parser.ClickhouseLexer;
import com.alibaba.druid.sql.dialect.clickhouse.parser.ClickhouseStatementParser;
import com.alibaba.druid.sql.dialect.db2.ast.stmt.DB2SelectQueryBlock;
import com.alibaba.druid.sql.dialect.db2.parser.DB2ExprParser;
Expand Down Expand Up @@ -180,6 +182,8 @@ public static SQLExprParser createExprParser(String sql, DbType dbType, SQLParse
return new PrestoExprParser(sql, features);
case hive:
return new HiveExprParser(sql, features);
case clickhouse:
return new ClickhouseExprParser(sql, features);
default:
return new SQLExprParser(sql, dbType, features);
}
Expand Down Expand Up @@ -221,6 +225,8 @@ public static Lexer createLexer(String sql, DbType dbType, SQLParserFeature... f
return new PrestoLexer(sql);
case antspark:
return new AntsparkLexer(sql);
case clickhouse:
return new ClickhouseLexer(sql);
default:
return new Lexer(sql, null, dbType);
}
Expand Down Expand Up @@ -735,6 +741,9 @@ public static List<String> getTables(String sql, DbType dbType) {
case mysql:
exprParser = new MySqlExprParser(lexer);
break;
case clickhouse:
exprParser = new ClickhouseExprParser(lexer);
break;
default:
exprParser = new SQLExprParser(lexer);
break;
Expand Down