Repository: tajo Updated Branches: refs/heads/branch-0.11.1 2c8b58620 -> 4a2d8a5a1
TAJO-1643: SQLParse can't parse table alias in in brackets. Closes #834 Project: http://git-wip-us.apache.org/repos/asf/tajo/repo Commit: http://git-wip-us.apache.org/repos/asf/tajo/commit/4a2d8a5a Tree: http://git-wip-us.apache.org/repos/asf/tajo/tree/4a2d8a5a Diff: http://git-wip-us.apache.org/repos/asf/tajo/diff/4a2d8a5a Branch: refs/heads/branch-0.11.1 Commit: 4a2d8a5a17863cdc0afd4d42d9913f9e14cf0835 Parents: 2c8b586 Author: Hyunsik Choi <[email protected]> Authored: Thu Oct 22 20:52:55 2015 -0700 Committer: Hyunsik Choi <[email protected]> Committed: Thu Oct 22 21:07:26 2015 -0700 ---------------------------------------------------------------------- CHANGES | 21 +++++++++++++++++++- .../positive/parentheses_table_1.sql | 1 + .../positive/parentheses_table_2.sql | 1 + .../positive/parentheses_table_3.sql | 1 + .../org/apache/tajo/parser/sql/SQLParser.g4 | 1 + 5 files changed, 24 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tajo/blob/4a2d8a5a/CHANGES ---------------------------------------------------------------------- diff --git a/CHANGES b/CHANGES index b8d9ecf..4379c79 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,25 @@ Tajo Change Log -Release 0.11.0 - unreleased +Release 0.11.1 - unreleased + + NEW FEATURES + + + IMPROVEMENT + + + BUG FIXES + + TAJO-1643: SQLParse can't parse parentheses table clause. (hyunsik) + + + TASKS + + + SUB TASKS + + +Release 0.11.0 - Released NEW FEATURES http://git-wip-us.apache.org/repos/asf/tajo/blob/4a2d8a5a/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/positive/parentheses_table_1.sql ---------------------------------------------------------------------- diff --git a/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/positive/parentheses_table_1.sql b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/positive/parentheses_table_1.sql new file mode 100644 index 0000000..7c9048b --- /dev/null +++ b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/positive/parentheses_table_1.sql @@ -0,0 +1 @@ +select x, y, z from (table1); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tajo/blob/4a2d8a5a/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/positive/parentheses_table_2.sql ---------------------------------------------------------------------- diff --git a/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/positive/parentheses_table_2.sql b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/positive/parentheses_table_2.sql new file mode 100644 index 0000000..d708688 --- /dev/null +++ b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/positive/parentheses_table_2.sql @@ -0,0 +1 @@ +select x, y, z from (table1 x); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tajo/blob/4a2d8a5a/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/positive/parentheses_table_3.sql ---------------------------------------------------------------------- diff --git a/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/positive/parentheses_table_3.sql b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/positive/parentheses_table_3.sql new file mode 100644 index 0000000..de34b03 --- /dev/null +++ b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/positive/parentheses_table_3.sql @@ -0,0 +1 @@ +select x, y, z from (table1 t1 (x,y,z)); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tajo/blob/4a2d8a5a/tajo-sql-parser/src/main/antlr4/org/apache/tajo/parser/sql/SQLParser.g4 ---------------------------------------------------------------------- diff --git a/tajo-sql-parser/src/main/antlr4/org/apache/tajo/parser/sql/SQLParser.g4 b/tajo-sql-parser/src/main/antlr4/org/apache/tajo/parser/sql/SQLParser.g4 index e2693ea..6837314 100644 --- a/tajo-sql-parser/src/main/antlr4/org/apache/tajo/parser/sql/SQLParser.g4 +++ b/tajo-sql-parser/src/main/antlr4/org/apache/tajo/parser/sql/SQLParser.g4 @@ -1082,6 +1082,7 @@ named_columns_join table_primary : table_or_query_name ((AS)? alias=identifier)? (LEFT_PAREN column_name_list RIGHT_PAREN)? + | LEFT_PAREN table_or_query_name ((AS)? alias=identifier)? (LEFT_PAREN column_name_list RIGHT_PAREN)? RIGHT_PAREN | derived_table (AS)? name=identifier (LEFT_PAREN column_name_list RIGHT_PAREN)? ;
