asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Till Westmann (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb[master]: [ASTERIXDB-2028][SQL] No recursion for list creation
Date Mon, 14 Aug 2017 04:53:38 GMT
Till Westmann has submitted this change and it was merged.

Change subject: [ASTERIXDB-2028][SQL] No recursion for list creation
......................................................................


[ASTERIXDB-2028][SQL] No recursion for list creation

- user model changes: no more dangling comma for lists in SQL++
- storage format changes: no
- interface changes: no

details:
- change the production to create expression lists to avoid recursion
- report the class name of Errors (not just the message)

Change-Id: I86b65371bc007b57fd80542f6530db12dd936242
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1936
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Yingyi Bu <buyingyi@gmail.com>
---
M asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/unnest/left-outer-unnest-with-pos/left-outer-unnest-with-pos.1.query.sqlpp
M asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/unnest/left-outer-unnest/left-outer-unnest.1.query.sqlpp
M asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
3 files changed, 14 insertions(+), 13 deletions(-)

Approvals:
  Yingyi Bu: Looks good to me, approved
  Jenkins: Verified; No violations found; ; Verified

Objections:
  Anon. E. Moose #1000171: 



diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/unnest/left-outer-unnest-with-pos/left-outer-unnest-with-pos.1.query.sqlpp
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/unnest/left-outer-unnest-with-pos/left-outer-unnest-with-pos.1.query.sqlpp
index 7b8651b..c736e24 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/unnest/left-outer-unnest-with-pos/left-outer-unnest-with-pos.1.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/unnest/left-outer-unnest-with-pos/left-outer-unnest-with-pos.1.query.sqlpp
@@ -23,7 +23,7 @@
  {'id': 1, 'list': [2, 3]},
  {'id': 4, 'list': [] },
  {'id': 5, 'list': [6, 7]},
- {'id': 8, 'list': []},
+ {'id': 8, 'list': []}
 ] AS a
 LEFT OUTER UNNEST a.list AS item AT i
 ORDER BY a.id
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/unnest/left-outer-unnest/left-outer-unnest.1.query.sqlpp
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/unnest/left-outer-unnest/left-outer-unnest.1.query.sqlpp
index 502d073..e7b6882 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/unnest/left-outer-unnest/left-outer-unnest.1.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/unnest/left-outer-unnest/left-outer-unnest.1.query.sqlpp
@@ -23,7 +23,7 @@
  {'id': 1, 'list': [2, 3]},
  {'id': 4, 'list': [] },
  {'id': 5, 'list': [6, 7]},
- {'id': 8, 'list': []},
+ {'id': 8, 'list': []}
 ] AS a
 LEFT OUTER UNNEST a.list AS item
 ORDER BY a.id
diff --git a/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj b/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
index bcba939..4c1d174 100644
--- a/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
+++ b/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
@@ -291,7 +291,8 @@
         } catch (Error e) {
             // this is here as the JavaCharStream that's below the lexer somtimes throws
Errors that are not handled
             // by the ANTLR-generated lexer or parser (e.g it does this for invalid backslash
u + 4 hex digits escapes)
-            throw new CompilationException(new ParseException(e.getMessage()));
+            final String msg = e.getClass().getSimpleName() + (e.getMessage() != null ? ":
" + e.getMessage() : "");
+            throw new CompilationException(new ParseException(msg));
         } catch (ParseException e) {
             throw new CompilationException("Syntax error: " + getMessage(e));
         }
@@ -2424,19 +2425,19 @@
 }
 {
     (
-      expr = Expression() { exprList.add(expr); }
-      (LOOKAHEAD(1) <COMMA> list = ExpressionList() { exprList.addAll(list); })?
+      expr = Expression()
+      {
+        exprList.add(expr);
+      }
+      ( <COMMA> expr = Expression()
+        {
+          exprList.add(expr);
+        }
+      )*
     )?
-    (LOOKAHEAD(1) Comma())?
     {
-        return exprList;
+      return exprList;
     }
-}
-
-void Comma():
-{}
-{
-   <COMMA>
 }
 
 RecordConstructor RecordConstructor() throws ParseException:

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1936
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I86b65371bc007b57fd80542f6530db12dd936242
Gerrit-PatchSet: 2
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Till Westmann <tillw@apache.org>
Gerrit-Reviewer: Anon. E. Moose #1000171
Gerrit-Reviewer: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Jianfeng Jia <jianfeng.jia@gmail.com>
Gerrit-Reviewer: Till Westmann <tillw@apache.org>
Gerrit-Reviewer: Yingyi Bu <buyingyi@gmail.com>

Mime
View raw message