Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
SQLParser can't parse table alias in brackets as following:
tpch> select c.*
> from (customer as c)
> ;
ERROR: syntax error at or near '('
LINE 2:5 from (customer as c)
Above case, I found error logs as follows.
Caused by: org.apache.tajo.engine.parser.SQLParseError: ERROR: syntax error at or near '('
LINE 2:5 from (customer as c)
^
at org.apache.tajo.engine.parser.SQLErrorListener.syntaxError(SQLErrorListener.java:36)
at org.antlr.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:65)
at org.antlr.v4.runtime.Parser.notifyErrorListeners(Parser.java:473)
at org.apache.tajo.engine.parser.SQLErrorStrategy.reportNoViableAltException(SQLErrorStrategy.java:57)
at org.apache.tajo.engine.parser.SQLErrorStrategy.reportError(SQLErrorStrategy.java:35)
at org.apache.tajo.engine.parser.SQLParser.table_reference(SQLParser.java:10002)
at org.apache.tajo.engine.parser.SQLParser.table_reference_list(SQLParser.java:9925)
at org.apache.tajo.engine.parser.SQLParser.from_clause(SQLParser.java:9874)
at org.apache.tajo.engine.parser.SQLParser.table_expression(SQLParser.java:9781)
at org.apache.tajo.engine.parser.SQLParser.query_specification(SQLParser.java:13541)
at org.apache.tajo.engine.parser.SQLParser.simple_table(SQLParser.java:13251)
at org.apache.tajo.engine.parser.SQLParser.non_join_query_primary(SQLParser.java:13190)
at org.apache.tajo.engine.parser.SQLParser.non_join_query_term(SQLParser.java:13029)
at org.apache.tajo.engine.parser.SQLParser.non_join_query_expression(SQLParser.java:12841)
at org.apache.tajo.engine.parser.SQLParser.query_expression_body(SQLParser.java:12759)
at org.apache.tajo.engine.parser.SQLParser.query_expression(SQLParser.java:12710)
at org.apache.tajo.engine.parser.SQLParser.data_statement(SQLParser.java:669)
at org.apache.tajo.engine.parser.SQLParser.statement(SQLParser.java:422)
at org.apache.tajo.engine.parser.SQLParser.sql(SQLParser.java:307)
at org.apache.tajo.engine.parser.SQLAnalyzer.parse(SQLAnalyzer.java:65)