improved sql parser.

This commit is contained in:
wenshao
2017-07-17 10:10:25 +08:00
parent 9e105a68f2
commit 5dac70deb0
20 changed files with 1510 additions and 69 deletions
@@ -156,6 +156,19 @@ public class OdpsExprParser extends SQLExprParser {
return super.equalityRest(expr);
}
public SQLExpr relationalRest(SQLExpr expr) {
if (identifierEquals("REGEXP")) {
lexer.nextToken();
SQLExpr rightExp = equality();
rightExp = relationalRest(rightExp);
return new SQLBinaryOpExpr(expr, SQLBinaryOperator.RegExp, rightExp, JdbcConstants.MYSQL);
}
return super.relationalRest(expr);
}
@Override
public OdpsSelectParser createSelectParser() {
return new OdpsSelectParser(this);