Repository: tajo
Updated Branches:
  refs/heads/master ab0d09489 -> a89b52337


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/a89b5233
Tree: http://git-wip-us.apache.org/repos/asf/tajo/tree/a89b5233
Diff: http://git-wip-us.apache.org/repos/asf/tajo/diff/a89b5233

Branch: refs/heads/master
Commit: a89b52337ef7d7c728e071766ccee6436ccde6a5
Parents: ab0d094
Author: Hyunsik Choi <[email protected]>
Authored: Thu Oct 22 20:52:55 2015 -0700
Committer: Hyunsik Choi <[email protected]>
Committed: Thu Oct 22 20:52:55 2015 -0700

----------------------------------------------------------------------
 CHANGES                                                            | 2 ++
 .../queries/TestSQLAnalyzer/positive/parentheses_table_1.sql       | 1 +
 .../queries/TestSQLAnalyzer/positive/parentheses_table_2.sql       | 1 +
 .../queries/TestSQLAnalyzer/positive/parentheses_table_3.sql       | 1 +
 .../src/main/antlr4/org/apache/tajo/parser/sql/SQLParser.g4        | 1 +
 5 files changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/a89b5233/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 4d64ae1..d38dcdf 100644
--- a/CHANGES
+++ b/CHANGES
@@ -24,6 +24,8 @@ Release 0.12.0 - unreleased
 
   BUG FIXES
 
+    TAJO-1643: SQLParse can't parse parentheses table clause. (hyunsik)
+
     TAJO-1924: Repair partition need to calculate partition volume. (jaehwa)
     
     TAJO-1913: Timezone does not affect the constant folding. (hyunsik)

http://git-wip-us.apache.org/repos/asf/tajo/blob/a89b5233/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/a89b5233/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/a89b5233/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/a89b5233/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)?
   ;
 

Reply via email to