Add an optional <END> for quantifiers.
Change-Id: Ia2d037c31752867a4a9e567dfcc76b101f94220d
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1283
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <tillw@apache.org>
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/quantifiers/everysat_04/everysat_04.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/quantifiers/everysat_04/everysat_04.3.query.sqlpp
index 06eb088..113bedd 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/quantifiers/everysat_04/everysat_04.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/quantifiers/everysat_04/everysat_04.3.query.sqlpp
@@ -23,7 +23,7 @@
use test;
-with x as [every x in [false,false] satisfies x,every x in [true,false] satisfies x,every x in [false,true] satisfies x,every x in [true,true] satisfies x,every x in [false,false] satisfies not x,every x in [true,false] satisfies not x,every x in [false,true] satisfies not x,every x in [true,true] satisfies not x]
+with x as [every x in [false,false] satisfies x end,every x in [true,false] satisfies x,every x in [false,true] satisfies x,every x in [true,true] satisfies x,every x in [false,false] satisfies not x,every x in [true,false] satisfies not x,every x in [false,true] satisfies not x,every x in [true,true] satisfies not x]
select element i
from x as i
;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/quantifiers/somesat_06/somesat_06.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/quantifiers/somesat_06/somesat_06.3.query.sqlpp
index 8186a43..f8e9bf8 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/quantifiers/somesat_06/somesat_06.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/quantifiers/somesat_06/somesat_06.3.query.sqlpp
@@ -26,7 +26,7 @@
set `import-private-functions` `true`;
-with x as [some x in [false,false] satisfies x,some x in [true,false] satisfies x,some x in [false,true] satisfies x,some x in [true,true] satisfies x,some x in [false,false] satisfies NOT x,some x in [true,false] satisfies not x,some x in [false,true] satisfies NOT x,some x in [true,true] satisfies not x]
+with x as [some x in [false,false] satisfies x,some x in [true,false] satisfies x,some x in [false,true] satisfies x,some x in [true,true] satisfies x,some x in [false,false] satisfies NOT x,some x in [true,false] satisfies not x,some x in [false,true] satisfies NOT x,some x in [true,true] satisfies not x end]
select element i
from x as i
;
diff --git a/asterixdb/asterix-doc/src/main/markdown/sqlpp/2_expr.md b/asterixdb/asterix-doc/src/main/markdown/sqlpp/2_expr.md
index 2733679..811094e 100644
--- a/asterixdb/asterix-doc/src/main/markdown/sqlpp/2_expr.md
+++ b/asterixdb/asterix-doc/src/main/markdown/sqlpp/2_expr.md
@@ -311,7 +311,7 @@
### <a id="Quantified_expressions">Quantified expressions</a>
QuantifiedExpression ::= ( (<ANY>|<SOME>) | <EVERY> ) Variable <IN> Expression ( "," Variable "in" Expression )*
- <SATISFIES> Expression
+ <SATISFIES> Expression (<END>)?
Quantified expressions are used for expressing existential or universal predicates involving the elements of a collection.
diff --git a/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj b/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
index 566d9e9..f113894 100644
--- a/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
+++ b/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
@@ -2980,7 +2980,7 @@
quantifiedList.add(pair);
}
)*
- <SATISFIES> satisfiesExpr = Expression()
+ <SATISFIES> satisfiesExpr = Expression() (<END>)?
{
qc.setSatisfiesExpr(satisfiesExpr);
qc.setQuantifiedList(quantifiedList);