modify the syntax to be simpler

Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/b85c5fa3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/b85c5fa3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/b85c5fa3

Branch: refs/heads/master
Commit: b85c5fa3948bee86cef3aae195baee4438f099cc
Parents: 23fe6d5
Author: Liu Ming <ovis_p...@sina.com>
Authored: Sat Jul 30 13:38:20 2016 -0400
Committer: Liu Ming <ovis_p...@sina.com>
Committed: Sat Jul 30 13:38:20 2016 -0400

----------------------------------------------------------------------
 core/sql/parser/sqlparser.y | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b85c5fa3/core/sql/parser/sqlparser.y
----------------------------------------------------------------------
diff --git a/core/sql/parser/sqlparser.y b/core/sql/parser/sqlparser.y
index 733f9c5..b556f70 100755
--- a/core/sql/parser/sqlparser.y
+++ b/core/sql/parser/sqlparser.y
@@ -18341,20 +18341,7 @@ non_join_query_expression : non_join_query_term
 
 /* type relx */
 non_join_query_term : non_join_query_primary
-                   | query_term TOK_INTERSECT query_primary
-                     {
-                       $$ = new (PARSERHEAP())
-                         RelRoot(new (PARSERHEAP())
-                                 GroupByAgg(
-                                            new (PARSERHEAP())
-                                            Intersect($1,$3),
-                                            REL_GROUPBY,
-                                            new (PARSERHEAP())
-                                            ColReference(new (PARSERHEAP())
-                                              ColRefName(TRUE, PARSERHEAP())
-                                            )));
-                     }
-                   | query_term TOK_INTERSECT TOK_DISTINCT query_primary
+                   | query_term TOK_INTERSECT distinct_sugar query_primary
                      {
                        $$ = new (PARSERHEAP())
                          RelRoot(new (PARSERHEAP())
@@ -18373,6 +18360,8 @@ non_join_query_term : non_join_query_primary
                                        YYERROR;
                                      }
 
+distinct_sugar: TOK_DISTINCT
+| 
 /* type relx */
 non_join_query_primary : simple_table
              | rel_subquery                            // ## this line ...

Reply via email to