odps support qualify identifier & alias

This commit is contained in:
shaojin.wensj
2023-02-01 19:56:45 +08:00
parent e0be6f5c9f
commit 1f405468ea
4 changed files with 12 additions and 0 deletions
@@ -749,6 +749,7 @@ public class SQLExprParser extends SQLParser {
case SHOW:
case INOUT:
case OUTER:
case QUALIFY:
sqlExpr = new SQLIdentifierExpr(lexer.stringVal());
lexer.nextToken();
break;
@@ -283,6 +283,7 @@ public class SQLParser {
case REPEAT:
case USE:
case MOD:
case QUALIFY:
case OUT: {
String strVal = lexer.stringVal();
lexer.nextToken();
@@ -36,6 +36,10 @@ public class OdpsResourceTest extends TestCase {
exec_test("bvt/parser/odps-9.txt");
}
public void test_10() throws Exception {
exec_test("bvt/parser/odps-10.txt");
}
public void exec_test(String resource) throws Exception {
String input = TestUtil.getResource(resource);
String[] items = input.split("---------------------------");
@@ -0,0 +1,6 @@
select qualify.api_name
from t_api qualify where qualify.api_name is not null;
---------------------------
SELECT qualify.api_name
FROM t_api qualify
WHERE qualify.api_name IS NOT NULL;