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 17:16:37 UTC

asterixdb git commit: Add ANY as a synonym to SOME for existential quantifiers.

Repository: asterixdb
Updated Branches:
  refs/heads/master d873f03a4 -> 8aac724b8


Add ANY as a synonym to SOME for existential quantifiers.

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


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

Branch: refs/heads/master
Commit: 8aac724b8f7533a34bcf24dda0ca37e6f34938de
Parents: d873f03
Author: Yingyi Bu <yi...@couchbase.com>
Authored: Tue Sep 13 23:14:09 2016 -0700
Committer: Yingyi Bu <bu...@gmail.com>
Committed: Wed Sep 14 10:16:09 2016 -0700

----------------------------------------------------------------------
 .../anysat_01/anysat_01.1.query.sqlpp           | 23 ++++++++++++++++++++
 .../resources/runtimets/testsuite_sqlpp.xml     |  5 +++++
 .../asterix-lang-sqlpp/src/main/javacc/SQLPP.jj |  3 ++-
 3 files changed, 30 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/8aac724b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/quantifiers/anysat_01/anysat_01.1.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/quantifiers/anysat_01/anysat_01.1.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/quantifiers/anysat_01/anysat_01.1.query.sqlpp
new file mode 100644
index 0000000..23ed7da
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/quantifiers/anysat_01/anysat_01.1.query.sqlpp
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+select element x
+from  [10,-30,-21,50] as x
+where any y in [-20,-40] satisfies y > x
+;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/8aac724b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
index 3dd4ad5..932a602 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
@@ -4668,6 +4668,11 @@
   </test-group>
   <test-group name="quantifiers">
     <test-case FilePath="quantifiers">
+      <compilation-unit name="anysat_01">
+        <output-dir compare="Text">somesat_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="quantifiers">
       <compilation-unit name="everysat_01">
         <output-dir compare="Text">everysat_01</output-dir>
       </compilation-unit>

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/8aac724b/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 19e856f..f9ce037 100644
--- a/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
+++ b/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
@@ -2911,7 +2911,7 @@ QuantifiedExpression QuantifiedExpression()throws ParseException:
     createNewScope();
   }
 
-   (      (<SOME>  {  qc.setQuantifier(QuantifiedExpression.Quantifier.SOME);    })
+   (      ((<ANY>|<SOME>)  {  qc.setQuantifier(QuantifiedExpression.Quantifier.SOME);    })
         | (<EVERY> {  qc.setQuantifier(QuantifiedExpression.Quantifier.EVERY);    }))
     var = Variable() <IN> inExpr = Expression()
     {
@@ -2993,6 +2993,7 @@ TOKEN [IGNORE_CASE]:
 {
   <ALL : "all">
   | <AND : "and">
+  | <ANY : "any">
   | <APPLY : "apply">
   | <AS : "as">
   | <ASC : "asc">