You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by bu...@apache.org on 2016/09/14 01:13:58 UTC

asterixdb git commit: Add "--" and "#" for SQL++ comments.

Repository: asterixdb
Updated Branches:
  refs/heads/master f798175f2 -> 93846a75b


Add "--" and "#" for SQL++ comments.

Change-Id: I389eb3f1e9653ee976152c894f04939e5eb162e2
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1171
Sonar-Qube: Jenkins <je...@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
Reviewed-by: Michael Blow <mb...@apache.org>
Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/93846a75
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/93846a75
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/93846a75

Branch: refs/heads/master
Commit: 93846a75b8568c0f307a33e2608b1b509e769e2c
Parents: f798175
Author: Yingyi Bu <yi...@couchbase.com>
Authored: Tue Sep 13 16:30:39 2016 -0700
Committer: Yingyi Bu <bu...@gmail.com>
Committed: Tue Sep 13 18:13:36 2016 -0700

----------------------------------------------------------------------
 .../global-aggregate/q10/q10.3.query.sqlpp      |  7 +++---
 .../asterix-lang-sqlpp/src/main/javacc/SQLPP.jj | 26 ++++++++++++++++++++
 2 files changed, 30 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/93846a75/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q10/q10.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q10/q10.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q10/q10.3.query.sqlpp
index a5fa88c..b7bcd7f 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q10/q10.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q10/q10.3.query.sqlpp
@@ -19,11 +19,12 @@
 
 USE TinySocial;
 
-// Tests the propagation for WITH binding variables for subqueries in global aggregates.
+-- Tests the propagation for WITH binding variables for subqueries in global aggregates.
 WITH t AS (
-   SELECT VALUE MIN(v)
-   FROM [1, 2, 3] v
+   SELECT VALUE MIN(v)     -- aggregate
+   FROM [1, 2, 3] v        # from clause
 )[0]
 
+# The main select query that uses the WITH variable t.
 SELECT COUNT(1) count, t
 FROM FacebookUsers u;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/93846a75/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj b/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
index 2f738ff..19e856f 100644
--- a/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
+++ b/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
@@ -3273,6 +3273,32 @@ SKIP:
 <DEFAULT,IN_DBL_BRACE>
 SKIP:
 {
+    <"--" (~["\n"])* "\n">
+}
+
+
+<DEFAULT,IN_DBL_BRACE>
+SKIP:
+{
+    <"--" (~["\n","\r"])* ("\n"|"\r"|"\r\n")?>
+}
+
+<DEFAULT,IN_DBL_BRACE>
+SKIP:
+{
+    <"#" (~["\n"])* "\n">
+}
+
+
+<DEFAULT,IN_DBL_BRACE>
+SKIP:
+{
+    <"#" (~["\n","\r"])* ("\n"|"\r"|"\r\n")?>
+}
+
+<DEFAULT,IN_DBL_BRACE>
+SKIP:
+{
     <"/*"> { pushState(); } : INSIDE_COMMENT
 }