mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved sql parser.
This commit is contained in:
@@ -28,6 +28,7 @@ import com.alibaba.druid.sql.dialect.odps.ast.OdpsLateralViewTableSource;
|
||||
import com.alibaba.druid.sql.dialect.odps.ast.OdpsSelectQueryBlock;
|
||||
import com.alibaba.druid.sql.dialect.odps.ast.OdpsValuesTableSource;
|
||||
import com.alibaba.druid.sql.parser.SQLExprParser;
|
||||
import com.alibaba.druid.sql.parser.SQLSelectListCache;
|
||||
import com.alibaba.druid.sql.parser.SQLSelectParser;
|
||||
import com.alibaba.druid.sql.parser.Token;
|
||||
|
||||
@@ -37,6 +38,12 @@ public class OdpsSelectParser extends SQLSelectParser {
|
||||
this.exprParser = exprParser;
|
||||
}
|
||||
|
||||
public OdpsSelectParser(SQLExprParser exprParser, SQLSelectListCache selectListCache){
|
||||
super(exprParser.getLexer());
|
||||
this.exprParser = exprParser;
|
||||
this.selectListCache = selectListCache;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SQLSelectQuery query() {
|
||||
if (lexer.token() == Token.LPAREN) {
|
||||
|
||||
@@ -266,7 +266,7 @@ public class OdpsStatementParser extends SQLStatementParser {
|
||||
}
|
||||
|
||||
public SQLSelectParser createSQLSelectParser() {
|
||||
return new OdpsSelectParser(this.exprParser);
|
||||
return new OdpsSelectParser(this.exprParser, selectListCache);
|
||||
}
|
||||
|
||||
public OdpsInsert parseOdpsInsert() {
|
||||
|
||||
Reference in New Issue
Block a user