improved sql parser.

This commit is contained in:
wenshao
2017-09-11 16:41:40 +08:00
parent 20c3f9304e
commit a9474ac6d0
33 changed files with 536 additions and 150 deletions
@@ -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() {