asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From buyin...@apache.org
Subject [2/3] asterixdb git commit: Add EXISTS/NOT EXISTS.
Date Sat, 16 Jul 2016 03:57:03 GMT
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/subquery/relational_division3/relational_division3.1.ddl.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/subquery/relational_division3/relational_division3.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/subquery/relational_division3/relational_division3.1.ddl.sqlpp
new file mode 100644
index 0000000..78d754a
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/subquery/relational_division3/relational_division3.1.ddl.sqlpp
@@ -0,0 +1,51 @@
+/*
+ * 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.
+ */
+
+DROP DATABASE test IF EXISTS;
+CREATE DATABASE test;
+USE test;
+
+
+CREATE TYPE OrderType AS CLOSED {
+  o_orderkey: int32,
+  o_custkey: int32,
+  o_orderstatus: string,
+  o_totalprice: double,
+  o_orderdate: string,
+  o_orderpriority: string,
+  o_clerk: string,
+  o_shippriority: int32,
+  o_comment: string
+}
+
+CREATE TYPE CustomerType AS CLOSED {
+  c_custkey: int32,
+  c_name: string,
+  c_address: string,
+  c_nationkey: int32,
+  c_phone: string,
+  c_acctbal: double,
+  c_mktsegment: string,
+  c_comment: string
+}
+
+
+CREATE TABLE Customer(CustomerType) PRIMARY KEY c_custkey;
+
+CREATE TABLE Orders(OrderType) PRIMARY KEY o_orderkey;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/subquery/relational_division3/relational_division3.2.update.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/subquery/relational_division3/relational_division3.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/subquery/relational_division3/relational_division3.2.update.sqlpp
new file mode 100644
index 0000000..e09d9e5
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/subquery/relational_division3/relational_division3.2.update.sqlpp
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+USE test;
+
+load  table Orders using localfs ((`path`=`asterix_nc1://data/tpch0.001/orders.tbl`),(`format`=`delimited-text`),(`delimiter`=`|`));
+
+load  table Customer using localfs ((`path`=`asterix_nc1://data/tpch0.001/customer.tbl`),(`format`=`delimited-text`),(`delimiter`=`|`));
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/subquery/relational_division3/relational_division3.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/subquery/relational_division3/relational_division3.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/subquery/relational_division3/relational_division3.3.query.sqlpp
new file mode 100644
index 0000000..e75d365
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/subquery/relational_division3/relational_division3.3.query.sqlpp
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+
+USE test;
+
+/** Finds customers whose orders have all possible priorities.*/
+
+
+
+SELECT c.c_custkey
+FROM  Customer c
+WHERE NOT EXISTS (
+        SELECT *
+        FROM Orders o1
+        WHERE o1.o_orderpriority NOT IN (
+                SELECT VALUE o2.o_orderpriority
+                FROM Orders o2
+                WHERE c.c_custkey=o2.o_custkey
+              )
+      )
+ORDER BY c.c_custkey
+;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/results/list/exists/exists.1.adm
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/list/exists/exists.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/list/exists/exists.1.adm
new file mode 100644
index 0000000..313ae8a
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/list/exists/exists.1.adm
@@ -0,0 +1 @@
+{ "$1": [ true, true, false, false ] }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/results/subquery/exists/exists.1.adm
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/subquery/exists/exists.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/subquery/exists/exists.1.adm
new file mode 100644
index 0000000..b815ac2
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/subquery/exists/exists.1.adm
@@ -0,0 +1,21 @@
+{ "cntrycode": "10", "numcust": 3, "totacctbal": 20747.13 }
+{ "cntrycode": "11", "numcust": 1, "totacctbal": 5266.3 }
+{ "cntrycode": "12", "numcust": 1, "totacctbal": 7470.96 }
+{ "cntrycode": "13", "numcust": 1, "totacctbal": 7865.46 }
+{ "cntrycode": "14", "numcust": 1, "totacctbal": 9963.15 }
+{ "cntrycode": "16", "numcust": 1, "totacctbal": 5744.59 }
+{ "cntrycode": "18", "numcust": 1, "totacctbal": 7508.92 }
+{ "cntrycode": "19", "numcust": 4, "totacctbal": 26638.06 }
+{ "cntrycode": "20", "numcust": 2, "totacctbal": 13993.849999999999 }
+{ "cntrycode": "21", "numcust": 2, "totacctbal": 14225.810000000001 }
+{ "cntrycode": "22", "numcust": 3, "totacctbal": 20332.18 }
+{ "cntrycode": "23", "numcust": 2, "totacctbal": 16227.39 }
+{ "cntrycode": "25", "numcust": 3, "totacctbal": 19038.36 }
+{ "cntrycode": "26", "numcust": 4, "totacctbal": 31589.67 }
+{ "cntrycode": "27", "numcust": 2, "totacctbal": 13248.06 }
+{ "cntrycode": "28", "numcust": 3, "totacctbal": 27945.0 }
+{ "cntrycode": "29", "numcust": 2, "totacctbal": 18863.93 }
+{ "cntrycode": "30", "numcust": 1, "totacctbal": 9889.89 }
+{ "cntrycode": "31", "numcust": 1, "totacctbal": 9280.71 }
+{ "cntrycode": "32", "numcust": 3, "totacctbal": 19248.96 }
+{ "cntrycode": "33", "numcust": 2, "totacctbal": 14032.05 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/results/subquery/not_exists/not_exists.1.adm
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/subquery/not_exists/not_exists.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/subquery/not_exists/not_exists.1.adm
new file mode 100644
index 0000000..fbd6260
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/subquery/not_exists/not_exists.1.adm
@@ -0,0 +1,18 @@
+{ "cntrycode": "11", "numcust": 4, "totacctbal": 29942.58 }
+{ "cntrycode": "12", "numcust": 1, "totacctbal": 6264.31 }
+{ "cntrycode": "13", "numcust": 1, "totacctbal": 5679.84 }
+{ "cntrycode": "15", "numcust": 2, "totacctbal": 14624.84 }
+{ "cntrycode": "16", "numcust": 1, "totacctbal": 5494.43 }
+{ "cntrycode": "17", "numcust": 1, "totacctbal": 9127.27 }
+{ "cntrycode": "18", "numcust": 2, "totacctbal": 14647.99 }
+{ "cntrycode": "19", "numcust": 2, "totacctbal": 17120.35 }
+{ "cntrycode": "20", "numcust": 1, "totacctbal": 9091.82 }
+{ "cntrycode": "21", "numcust": 1, "totacctbal": 5174.71 }
+{ "cntrycode": "23", "numcust": 1, "totacctbal": 9255.67 }
+{ "cntrycode": "26", "numcust": 1, "totacctbal": 7354.23 }
+{ "cntrycode": "28", "numcust": 2, "totacctbal": 14755.5 }
+{ "cntrycode": "29", "numcust": 2, "totacctbal": 17195.08 }
+{ "cntrycode": "30", "numcust": 1, "totacctbal": 7638.57 }
+{ "cntrycode": "31", "numcust": 2, "totacctbal": 14318.4 }
+{ "cntrycode": "32", "numcust": 1, "totacctbal": 6505.26 }
+{ "cntrycode": "33", "numcust": 1, "totacctbal": 6327.54 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/results/subquery/relational_division/relational_division.1.adm
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/subquery/relational_division/relational_division.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/subquery/relational_division/relational_division.1.adm
new file mode 100644
index 0000000..af8e48b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/subquery/relational_division/relational_division.1.adm
@@ -0,0 +1,74 @@
+{ "c_custkey": 4 }
+{ "c_custkey": 7 }
+{ "c_custkey": 8 }
+{ "c_custkey": 10 }
+{ "c_custkey": 13 }
+{ "c_custkey": 16 }
+{ "c_custkey": 17 }
+{ "c_custkey": 19 }
+{ "c_custkey": 22 }
+{ "c_custkey": 23 }
+{ "c_custkey": 25 }
+{ "c_custkey": 28 }
+{ "c_custkey": 29 }
+{ "c_custkey": 31 }
+{ "c_custkey": 32 }
+{ "c_custkey": 34 }
+{ "c_custkey": 37 }
+{ "c_custkey": 40 }
+{ "c_custkey": 43 }
+{ "c_custkey": 44 }
+{ "c_custkey": 46 }
+{ "c_custkey": 47 }
+{ "c_custkey": 49 }
+{ "c_custkey": 52 }
+{ "c_custkey": 53 }
+{ "c_custkey": 55 }
+{ "c_custkey": 56 }
+{ "c_custkey": 58 }
+{ "c_custkey": 61 }
+{ "c_custkey": 64 }
+{ "c_custkey": 65 }
+{ "c_custkey": 67 }
+{ "c_custkey": 70 }
+{ "c_custkey": 73 }
+{ "c_custkey": 74 }
+{ "c_custkey": 76 }
+{ "c_custkey": 79 }
+{ "c_custkey": 80 }
+{ "c_custkey": 82 }
+{ "c_custkey": 85 }
+{ "c_custkey": 88 }
+{ "c_custkey": 89 }
+{ "c_custkey": 91 }
+{ "c_custkey": 94 }
+{ "c_custkey": 95 }
+{ "c_custkey": 97 }
+{ "c_custkey": 98 }
+{ "c_custkey": 100 }
+{ "c_custkey": 101 }
+{ "c_custkey": 103 }
+{ "c_custkey": 104 }
+{ "c_custkey": 106 }
+{ "c_custkey": 109 }
+{ "c_custkey": 112 }
+{ "c_custkey": 115 }
+{ "c_custkey": 118 }
+{ "c_custkey": 119 }
+{ "c_custkey": 121 }
+{ "c_custkey": 122 }
+{ "c_custkey": 124 }
+{ "c_custkey": 125 }
+{ "c_custkey": 127 }
+{ "c_custkey": 130 }
+{ "c_custkey": 131 }
+{ "c_custkey": 133 }
+{ "c_custkey": 134 }
+{ "c_custkey": 136 }
+{ "c_custkey": 137 }
+{ "c_custkey": 139 }
+{ "c_custkey": 140 }
+{ "c_custkey": 142 }
+{ "c_custkey": 145 }
+{ "c_custkey": 148 }
+{ "c_custkey": 149 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/binary/subbinary/subbinary_01.3.ast
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/binary/subbinary/subbinary_01.3.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/binary/subbinary/subbinary_01.3.ast
index 79aa35a..6ec8199 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/binary/subbinary/subbinary_01.3.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/binary/subbinary/subbinary_01.3.ast
@@ -30,7 +30,7 @@ OrderedListConstructor [
       FunctionCall test.hex@1[
         LiteralExpr [STRING] []
       ]
-      NEGATIVE LiteralExpr [LONG] [1]
+      - LiteralExpr [LONG] [1]
     ]
     =
     FunctionCall test.hex@1[
@@ -135,7 +135,7 @@ OrderedListConstructor [
       FunctionCall test.hex@1[
         LiteralExpr [STRING] [aabbccdd]
       ]
-      NEGATIVE LiteralExpr [LONG] [1]
+      - LiteralExpr [LONG] [1]
     ]
     =
     FunctionCall test.hex@1[
@@ -174,7 +174,7 @@ OrderedListConstructor [
         LiteralExpr [STRING] [aabbccdd]
       ]
       LiteralExpr [LONG] [2]
-      NEGATIVE LiteralExpr [LONG] [1]
+      - LiteralExpr [LONG] [1]
     ]
     =
     FunctionCall test.hex@1[

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/custord/customer_q_04/customer_q_04.3.ast
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/custord/customer_q_04/customer_q_04.3.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/custord/customer_q_04/customer_q_04.3.ast
index 351b4ef..3109b22 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/custord/customer_q_04/customer_q_04.3.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/custord/customer_q_04/customer_q_04.3.ast
@@ -100,7 +100,7 @@ Let Variable [ Name=$rec ]
     (
       LiteralExpr [STRING] [-cashBack]
       :
-      NEGATIVE FieldAccessor [
+      - FieldAccessor [
   Variable [ Name=$c ]
   Field=cashBack
 ]

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/custord/customer_q_05/customer_q_05.3.ast
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/custord/customer_q_05/customer_q_05.3.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/custord/customer_q_05/customer_q_05.3.ast
index 460fdd3..f2f701b 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/custord/customer_q_05/customer_q_05.3.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/custord/customer_q_05/customer_q_05.3.ast
@@ -92,7 +92,7 @@ Let Variable [ Name=$rec ]
     (
       LiteralExpr [STRING] [-age]
       :
-      NEGATIVE FieldAccessor [
+      - FieldAccessor [
   Variable [ Name=$c ]
   Field=age
 ]

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/list/listify_03/listify_03.3.ast
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/list/listify_03/listify_03.3.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/list/listify_03/listify_03.3.ast
index 7b18d20..effbbb3 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/list/listify_03/listify_03.3.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/list/listify_03/listify_03.3.ast
@@ -31,8 +31,8 @@ Let Variable [ Name=$y ]
           LiteralExpr [LONG] [30]
         ]
         OrderedListConstructor [
-          NEGATIVE LiteralExpr [LONG] [2]
-          NEGATIVE LiteralExpr [LONG] [5]
+          - LiteralExpr [LONG] [2]
+          - LiteralExpr [LONG] [5]
           LiteralExpr [LONG] [0]
         ]
       ]

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/abs4/abs4.3.ast
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/abs4/abs4.3.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/abs4/abs4.3.ast
index a27798a..26f4e05 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/abs4/abs4.3.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/abs4/abs4.3.ast
@@ -14,7 +14,7 @@ RecordConstructor [
     LiteralExpr [STRING] [f1]
     :
     FunctionCall test.abs@1[
-      NEGATIVE LiteralExpr [DOUBLE] [1.11]
+      - LiteralExpr [DOUBLE] [1.11]
     ]
   )
   (

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/add_double/add_double.1.ast
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/add_double/add_double.1.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/add_double/add_double.1.ast
index 7cceff0..4550cfe 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/add_double/add_double.1.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/add_double/add_double.1.ast
@@ -101,7 +101,7 @@ RecordConstructor [
         OrderedListConstructor [
           LiteralExpr [DOUBLE] [1.0]
         ]
-        Index:         NEGATIVE LiteralExpr [LONG] [1]
+        Index:         - LiteralExpr [LONG] [1]
       ]
     ]
   )

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/ceiling4/ceiling4.3.ast
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/ceiling4/ceiling4.3.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/ceiling4/ceiling4.3.ast
index 8f0324f..1179f48 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/ceiling4/ceiling4.3.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/ceiling4/ceiling4.3.ast
@@ -14,7 +14,7 @@ RecordConstructor [
     LiteralExpr [STRING] [f1]
     :
     FunctionCall test.ceiling@1[
-      NEGATIVE LiteralExpr [DOUBLE] [1.11]
+      - LiteralExpr [DOUBLE] [1.11]
     ]
   )
   (

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/floor4/floor4.3.ast
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/floor4/floor4.3.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/floor4/floor4.3.ast
index 25b47d0..1bb6af7 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/floor4/floor4.3.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/floor4/floor4.3.ast
@@ -14,7 +14,7 @@ RecordConstructor [
     LiteralExpr [STRING] [f1]
     :
     FunctionCall test.floor@1[
-      NEGATIVE LiteralExpr [DOUBLE] [1.11]
+      - LiteralExpr [DOUBLE] [1.11]
     ]
   )
   (

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/round-half-to-even24/round-half-to-even24.3.ast
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/round-half-to-even24/round-half-to-even24.3.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/round-half-to-even24/round-half-to-even24.3.ast
index c2d41d9..80b6d09 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/round-half-to-even24/round-half-to-even24.3.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/round-half-to-even24/round-half-to-even24.3.ast
@@ -48,7 +48,7 @@ RecordConstructor [
       FunctionCall test.double@1[
         LiteralExpr [STRING] [35612.25]
       ]
-      NEGATIVE LiteralExpr [LONG] [2]
+      - LiteralExpr [LONG] [2]
     ]
   )
 ]

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/round-half-to-even5/round-half-to-even5.3.ast
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/round-half-to-even5/round-half-to-even5.3.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/round-half-to-even5/round-half-to-even5.3.ast
index ade34b5..e2e0f27 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/round-half-to-even5/round-half-to-even5.3.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/round-half-to-even5/round-half-to-even5.3.ast
@@ -14,7 +14,7 @@ RecordConstructor [
     LiteralExpr [STRING] [f1]
     :
     FunctionCall test.round-half-to-even@1[
-      NEGATIVE LiteralExpr [DOUBLE] [1.5]
+      - LiteralExpr [DOUBLE] [1.5]
     ]
   )
   (

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/round4/round4.3.ast
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/round4/round4.3.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/round4/round4.3.ast
index e372fa9..e446715 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/round4/round4.3.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/round4/round4.3.ast
@@ -14,7 +14,7 @@ RecordConstructor [
     LiteralExpr [STRING] [f1]
     :
     FunctionCall test.round@1[
-      NEGATIVE LiteralExpr [DOUBLE] [1.11]
+      - LiteralExpr [DOUBLE] [1.11]
     ]
   )
   (

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/unary-minus_double_02/unary-minus_double_02.3.ast
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/unary-minus_double_02/unary-minus_double_02.3.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/unary-minus_double_02/unary-minus_double_02.3.ast
index 58c8e8b..c74b17a 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/unary-minus_double_02/unary-minus_double_02.3.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/unary-minus_double_02/unary-minus_double_02.3.ast
@@ -4,28 +4,28 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [double1]
     :
-    NEGATIVE FunctionCall test.double@1[
+    - FunctionCall test.double@1[
   LiteralExpr [STRING] [-20.56e-30]
 ]
   )
   (
     LiteralExpr [STRING] [double2]
     :
-    NEGATIVE FunctionCall test.double@1[
+    - FunctionCall test.double@1[
   LiteralExpr [STRING] [NaN]
 ]
   )
   (
     LiteralExpr [STRING] [double3]
     :
-    NEGATIVE FunctionCall test.double@1[
+    - FunctionCall test.double@1[
   LiteralExpr [STRING] [INF]
 ]
   )
   (
     LiteralExpr [STRING] [double4]
     :
-    NEGATIVE FunctionCall test.double@1[
+    - FunctionCall test.double@1[
   LiteralExpr [STRING] [-INF]
 ]
   )

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/unary-minus_float_02/unary-minus_float_02.3.ast
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/unary-minus_float_02/unary-minus_float_02.3.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/unary-minus_float_02/unary-minus_float_02.3.ast
index 27fd67f..cd38a0c 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/unary-minus_float_02/unary-minus_float_02.3.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/unary-minus_float_02/unary-minus_float_02.3.ast
@@ -4,28 +4,28 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [float1]
     :
-    NEGATIVE FunctionCall test.float@1[
+    - FunctionCall test.float@1[
   LiteralExpr [STRING] [-80.20f]
 ]
   )
   (
     LiteralExpr [STRING] [float2]
     :
-    NEGATIVE FunctionCall test.float@1[
+    - FunctionCall test.float@1[
   LiteralExpr [STRING] [NaN]
 ]
   )
   (
     LiteralExpr [STRING] [float3]
     :
-    NEGATIVE FunctionCall test.float@1[
+    - FunctionCall test.float@1[
   LiteralExpr [STRING] [INF]
 ]
   )
   (
     LiteralExpr [STRING] [float4]
     :
-    NEGATIVE FunctionCall test.float@1[
+    - FunctionCall test.float@1[
   LiteralExpr [STRING] [-INF]
 ]
   )

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/unary-minus_int_02/unary-minus_int_02.3.ast
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/unary-minus_int_02/unary-minus_int_02.3.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/unary-minus_int_02/unary-minus_int_02.3.ast
index 682a20d..b37a097 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/unary-minus_int_02/unary-minus_int_02.3.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/unary-minus_int_02/unary-minus_int_02.3.ast
@@ -4,28 +4,28 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [int8]
     :
-    NEGATIVE FunctionCall test.int8@1[
+    - FunctionCall test.int8@1[
   LiteralExpr [STRING] [+80]
 ]
   )
   (
     LiteralExpr [STRING] [int16]
     :
-    NEGATIVE FunctionCall test.int16@1[
+    - FunctionCall test.int16@1[
   LiteralExpr [STRING] [160]
 ]
   )
   (
     LiteralExpr [STRING] [int32]
     :
-    NEGATIVE FunctionCall test.int32@1[
+    - FunctionCall test.int32@1[
   LiteralExpr [STRING] [+320]
 ]
   )
   (
     LiteralExpr [STRING] [int64]
     :
-    NEGATIVE FunctionCall test.int64@1[
+    - FunctionCall test.int64@1[
   LiteralExpr [STRING] [-640]
 ]
   )

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/unary-minus_null/unary-minus_null.1.ast
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/unary-minus_null/unary-minus_null.1.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/unary-minus_null/unary-minus_null.1.ast
index c272a7e..f1b45ae 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/unary-minus_null/unary-minus_null.1.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/numeric/unary-minus_null/unary-minus_null.1.ast
@@ -3,11 +3,11 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [nullField]
     :
-    NEGATIVE LiteralExpr [NULL]
+    - LiteralExpr [NULL]
   )
   (
     LiteralExpr [STRING] [missingField]
     :
-    NEGATIVE LiteralExpr [MISSING]
+    - LiteralExpr [MISSING]
   )
 ]

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/open-closed/query-issue134/query-issue134.3.ast
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/open-closed/query-issue134/query-issue134.3.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/open-closed/query-issue134/query-issue134.3.ast
index f996b27..353cad6 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/open-closed/query-issue134/query-issue134.3.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/open-closed/query-issue134/query-issue134.3.ast
@@ -18,7 +18,7 @@ UnorderedListConstructor [
     LiteralExpr [LONG] [44]
     LiteralExpr [LONG] [22]
     LiteralExpr [LONG] [66]
-    NEGATIVE LiteralExpr [LONG] [1]
+    - LiteralExpr [LONG] [1]
     LiteralExpr [LONG] [0]
     LiteralExpr [DOUBLE] [99.9]
   ]

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/open-closed/query-issue442/query-issue442.1.ast
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/open-closed/query-issue442/query-issue442.1.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/open-closed/query-issue442/query-issue442.1.ast
index 72b2823..c099316 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/open-closed/query-issue442/query-issue442.1.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/open-closed/query-issue442/query-issue442.1.ast
@@ -21,7 +21,7 @@ FROM [  OrderedListConstructor [
       (
         LiteralExpr [STRING] [f]
         :
-        NEGATIVE LiteralExpr [LONG] [1]
+        - LiteralExpr [LONG] [1]
       )
     ]
     RecordConstructor [

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/open-closed/query-issue55/query-issue55.3.ast
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/open-closed/query-issue55/query-issue55.3.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/open-closed/query-issue55/query-issue55.3.ast
index d65a7a2..ab48d43 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/open-closed/query-issue55/query-issue55.3.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/open-closed/query-issue55/query-issue55.3.ast
@@ -13,8 +13,8 @@ FROM [  OrderedListConstructor [
       LiteralExpr [LONG] [2]
     ]
     OrderedListConstructor [
-      NEGATIVE LiteralExpr [LONG] [1]
-      NEGATIVE LiteralExpr [LONG] [3]
+      - LiteralExpr [LONG] [1]
+      - LiteralExpr [LONG] [3]
       LiteralExpr [LONG] [0]
     ]
     OrderedListConstructor [

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/quantifiers/everysat_01/everysat_01.3.ast
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/quantifiers/everysat_01/everysat_01.3.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/quantifiers/everysat_01/everysat_01.3.ast
index 16141da..d734065 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/quantifiers/everysat_01/everysat_01.3.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/quantifiers/everysat_01/everysat_01.3.ast
@@ -5,7 +5,7 @@ Variable [ Name=$x ]
 ]
 FROM [  OrderedListConstructor [
     LiteralExpr [LONG] [10]
-    NEGATIVE LiteralExpr [LONG] [30]
+    - LiteralExpr [LONG] [30]
   ]
   AS Variable [ Name=$x ]
 ]
@@ -14,8 +14,8 @@ Where
     [Variable [ Name=$y ]
     In
       OrderedListConstructor [
-        NEGATIVE LiteralExpr [LONG] [20]
-        NEGATIVE LiteralExpr [LONG] [10]
+        - LiteralExpr [LONG] [20]
+        - LiteralExpr [LONG] [10]
       ]
     ]
     Satifies [

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/quantifiers/somesat_01/somesat_01.3.ast
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/quantifiers/somesat_01/somesat_01.3.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/quantifiers/somesat_01/somesat_01.3.ast
index 2584e26..fce8f80 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/quantifiers/somesat_01/somesat_01.3.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/quantifiers/somesat_01/somesat_01.3.ast
@@ -5,8 +5,8 @@ Variable [ Name=$x ]
 ]
 FROM [  OrderedListConstructor [
     LiteralExpr [LONG] [10]
-    NEGATIVE LiteralExpr [LONG] [30]
-    NEGATIVE LiteralExpr [LONG] [21]
+    - LiteralExpr [LONG] [30]
+    - LiteralExpr [LONG] [21]
     LiteralExpr [LONG] [50]
   ]
   AS Variable [ Name=$x ]
@@ -16,8 +16,8 @@ Where
     [Variable [ Name=$y ]
     In
       OrderedListConstructor [
-        NEGATIVE LiteralExpr [LONG] [20]
-        NEGATIVE LiteralExpr [LONG] [40]
+        - LiteralExpr [LONG] [20]
+        - LiteralExpr [LONG] [40]
       ]
     ]
     Satifies [

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/spatial/cell-aggregation-with-filtering/cell-aggregation-with-filtering.3.ast
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/spatial/cell-aggregation-with-filtering/cell-aggregation-with-filtering.3.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/spatial/cell-aggregation-with-filtering/cell-aggregation-with-filtering.3.ast
index 238633c..657dce3 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/spatial/cell-aggregation-with-filtering/cell-aggregation-with-filtering.3.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/spatial/cell-aggregation-with-filtering/cell-aggregation-with-filtering.3.ast
@@ -81,7 +81,7 @@ Groupby
     ]
     FunctionCall test.create-point@2[
       LiteralExpr [DOUBLE] [24.5]
-      NEGATIVE LiteralExpr [DOUBLE] [125.5]
+      - LiteralExpr [DOUBLE] [125.5]
     ]
     LiteralExpr [DOUBLE] [3.0]
     LiteralExpr [DOUBLE] [3.0]

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/spatial/line_accessor/line_accessor.3.ast
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/spatial/line_accessor/line_accessor.3.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/spatial/line_accessor/line_accessor.3.ast
index b9c5f4f..44be116 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/spatial/line_accessor/line_accessor.3.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/spatial/line_accessor/line_accessor.3.ast
@@ -8,8 +8,8 @@ Let Variable [ Name=$line ]
       LiteralExpr [DOUBLE] [999.4]
     ]
     FunctionCall test.create-point@2[
-      NEGATIVE LiteralExpr [DOUBLE] [872.0]
-      NEGATIVE LiteralExpr [DOUBLE] [876.9]
+      - LiteralExpr [DOUBLE] [872.0]
+      - LiteralExpr [DOUBLE] [876.9]
     ]
   ]
 Let Variable [ Name=$line_list ]

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/spatial/rectangle-intersect-rectangle/rectangle-intersect-rectangle.3.ast
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/spatial/rectangle-intersect-rectangle/rectangle-intersect-rectangle.3.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/spatial/rectangle-intersect-rectangle/rectangle-intersect-rectangle.3.ast
index d71d157..cb1d05b 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/spatial/rectangle-intersect-rectangle/rectangle-intersect-rectangle.3.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/spatial/rectangle-intersect-rectangle/rectangle-intersect-rectangle.3.ast
@@ -29,7 +29,7 @@ Where
         LiteralExpr [DOUBLE] [9.0]
       ]
       FunctionCall test.create-point@2[
-        NEGATIVE LiteralExpr [DOUBLE] [1.0]
+        - LiteralExpr [DOUBLE] [1.0]
         LiteralExpr [DOUBLE] [5.0]
       ]
     ]

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substr01/substr01.3.ast
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substr01/substr01.3.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substr01/substr01.3.ast
index c2b1ad2..9e8f66d 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substr01/substr01.3.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substr01/substr01.3.ast
@@ -37,7 +37,7 @@ RecordConstructor [
     :
     FunctionCall null.substring@2[
       LiteralExpr [STRING] [This is a test string]
-      NEGATIVE LiteralExpr [LONG] [1]
+      - LiteralExpr [LONG] [1]
     ]
   )
   (

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substring2-4/substring2-4.3.ast
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substring2-4/substring2-4.3.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substring2-4/substring2-4.3.ast
index 95d87e4..414ad6e 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substring2-4/substring2-4.3.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substring2-4/substring2-4.3.ast
@@ -6,7 +6,7 @@ RecordConstructor [
     :
     FunctionCall test.substring@2[
       LiteralExpr [STRING] [HEllow]
-      NEGATIVE LiteralExpr [LONG] [1]
+      - LiteralExpr [LONG] [1]
     ]
   )
 ]

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/user-defined-functions/query-issue218-2/query-issue218-2.3.ast
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/user-defined-functions/query-issue218-2/query-issue218-2.3.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/user-defined-functions/query-issue218-2/query-issue218-2.3.ast
index 15eb8e3..4ace9af 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/user-defined-functions/query-issue218-2/query-issue218-2.3.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/user-defined-functions/query-issue218-2/query-issue218-2.3.ast
@@ -1,7 +1,7 @@
 Query:
 SELECT ELEMENT [
 FunctionCall test.computeBonus@2[
-  NEGATIVE LiteralExpr [LONG] [1]
-  NEGATIVE LiteralExpr [LONG] [1]
+  - LiteralExpr [LONG] [1]
+  - LiteralExpr [LONG] [1]
 ]
 ]

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/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 f66e3a8..e3d3102 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
@@ -2758,6 +2758,11 @@
       </compilation-unit>
     </test-case>
     <test-case FilePath="list">
+      <compilation-unit name="exists">
+        <output-dir compare="Text">exists</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="list">
       <compilation-unit name="get-item_01">
         <output-dir compare="Text">get-item_01</output-dir>
       </compilation-unit>
@@ -5302,6 +5307,11 @@
       </compilation-unit>
     </test-case>
     <test-case FilePath="subquery">
+      <compilation-unit name="exists">
+        <output-dir compare="Text">exists</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="subquery">
       <compilation-unit name="in">
         <output-dir compare="Text">in</output-dir>
       </compilation-unit>
@@ -5312,6 +5322,11 @@
       </compilation-unit>
     </test-case>
     <test-case FilePath="subquery">
+      <compilation-unit name="not_exists">
+        <output-dir compare="Text">not_exists</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="subquery">
       <compilation-unit name="not_in">
         <output-dir compare="Text">not_in</output-dir>
       </compilation-unit>
@@ -5320,6 +5335,21 @@
       <compilation-unit name="alias_negative">
         <output-dir compare="Text">alias_negative</output-dir>
         <expected-error>Need an alias for the enclosed expression</expected-error>
+        </compilation-unit>
+    </test-case>
+     <test-case FilePath="subquery">
+      <compilation-unit name="relational_division">
+        <output-dir compare="Text">relational_division</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="subquery">
+      <compilation-unit name="relational_division2">
+        <output-dir compare="Text">relational_division</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="subquery">
+      <compilation-unit name="relational_division3">
+        <output-dir compare="Text">relational_division</output-dir>
       </compilation-unit>
     </test-case>
   </test-group>

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/AQLToSQLPPPrintVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/AQLToSQLPPPrintVisitor.java b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/AQLToSQLPPPrintVisitor.java
index ba837b5..2af2816 100644
--- a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/AQLToSQLPPPrintVisitor.java
+++ b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/AQLToSQLPPPrintVisitor.java
@@ -119,8 +119,8 @@ public class AQLToSQLPPPrintVisitor extends FormatPrintVisitor implements IAQLVi
 
         String generated = generateVariableSymbol();
         if (unnestClauseList.size() > 0) {
-            Map<VariableExpr, Expression> varExprMap = extractDefinedCollectionVariables(clauseList, cuttingGbyClause,
-                    generated);
+            Map<VariableExpr, Expression> varExprMap =
+                    extractDefinedCollectionVariables(clauseList, cuttingGbyClause, generated);
 
             returnExpr = (Expression) AQLVariableSubstitutionUtil.substituteVariable(returnExpr, varExprMap);
             List<Clause> newUnnestClauses = new ArrayList<Clause>();
@@ -560,7 +560,7 @@ public class AQLToSQLPPPrintVisitor extends FormatPrintVisitor implements IAQLVi
     }
 
     // Merge consecutive "where" clauses.
-    private void mergeConsecutiveWhereClauses(List<Clause> clauses) {
+    private void mergeConsecutiveWhereClauses(List<Clause> clauses) throws AsterixException {
         List<Clause> results = new ArrayList<Clause>();
         int size = clauses.size();
         for (int index = 0; index < size;) {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj b/asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj
index fcb6eb4..586464c 100644
--- a/asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj
+++ b/asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj
@@ -83,7 +83,6 @@ import org.apache.asterix.lang.common.expression.TypeReferenceExpression;
 import org.apache.asterix.lang.common.expression.UnaryExpr;
 import org.apache.asterix.lang.common.expression.UnorderedListTypeDefinition;
 import org.apache.asterix.lang.common.expression.VariableExpr;
-import org.apache.asterix.lang.common.expression.UnaryExpr.Sign;
 import org.apache.asterix.lang.common.literal.DoubleLiteral;
 import org.apache.asterix.lang.common.literal.FalseLiteral;
 import org.apache.asterix.lang.common.literal.FloatLiteral;
@@ -1582,7 +1581,11 @@ Expression OperatorExpr()throws ParseException:
           op.addOperand(operand);
         op.setCurrentop(true);
         }
-      op.addOperator(token.image);
+        try{
+          op.addOperator(token.image);
+        } catch (AsterixException e){
+          throw new ParseException(e.getMessage());
+        }
     }
 
     operand = AndExpr()
@@ -1613,7 +1616,11 @@ Expression AndExpr()throws ParseException:
           op.addOperand(operand);
         op.setCurrentop(true);
         }
-      op.addOperator(token.image);
+        try{
+          op.addOperator(token.image);
+        } catch (AsterixException e){
+          throw new ParseException(e.getMessage());
+        }
     }
 
     operand = RelExpr()
@@ -1665,7 +1672,11 @@ Expression RelExpr()throws ParseException:
           op.setCurrentop(true);
           broadcast = false;
           }
-        op.addOperator(token.image);
+         try{
+           op.addOperator(token.image);
+         } catch (AsterixException e){
+           throw new ParseException(e.getMessage());
+         }
       }
 
        operand = AddExpr()
@@ -1704,7 +1715,11 @@ Expression AddExpr()throws ParseException:
         op.addOperand(operand);
         op.setCurrentop(true);
         }
-      ((OperatorExpr)op).addOperator(token.image);
+        try{
+          ((OperatorExpr)op).addOperator(token.image);
+        } catch (AsterixException e){
+          throw new ParseException(e.getMessage());
+        }
     }
 
     operand = MultExpr()
@@ -1733,7 +1748,11 @@ Expression MultExpr()throws ParseException:
         op.addOperand(operand);
         op.setCurrentop(true);
         }
-      op.addOperator(token.image);
+        try{
+          op.addOperator(token.image);
+        } catch (AsterixException e){
+          throw new ParseException(e.getMessage());
+        }
     }
     operand = UnionExpr()
     {
@@ -1769,19 +1788,18 @@ Expression UnionExpr() throws ParseException:
 
 Expression UnaryExpr() throws ParseException:
 {
-    Expression uexpr = null;
+    UnaryExpr uexpr = null;
     Expression expr = null;
 }
 {
     ( (<PLUS> | <MINUS>)
     {
           uexpr = new UnaryExpr();
-        if("+".equals(token.image))
-            ((UnaryExpr)uexpr).setSign(Sign.POSITIVE);
-        else if("-".equals(token.image))
-            ((UnaryExpr)uexpr).setSign(Sign.NEGATIVE);
-        else
-            throw new ParseException();
+          try{
+            uexpr.setExprType(token.image);
+          } catch (AsterixException e){
+            throw new ParseException(e.getMessage());
+          }
     }
     )?
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/expression/OperatorExpr.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/expression/OperatorExpr.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/expression/OperatorExpr.java
index fb64ad8..1418be7 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/expression/OperatorExpr.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/expression/OperatorExpr.java
@@ -91,12 +91,12 @@ public class OperatorExpr extends AbstractExpression {
         return cmp;
     }
 
-    public void addOperator(String strOp) {
+    public void addOperator(String strOp) throws AsterixException {
         Optional<OperatorType> op = OperatorType.fromSymbol(strOp);
         if (op.isPresent()) {
             opList.add(op.get());
         } else {
-            throw new UnsupportedOperationException("Unsupported operator: " + strOp);
+            throw new AsterixException("Unsupported operator: " + strOp);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/expression/UnaryExpr.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/expression/UnaryExpr.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/expression/UnaryExpr.java
index eef8f1c..929587c 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/expression/UnaryExpr.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/expression/UnaryExpr.java
@@ -18,30 +18,38 @@
  */
 package org.apache.asterix.lang.common.expression;
 
+import java.util.Optional;
+
 import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.lang.common.base.Expression;
+import org.apache.asterix.lang.common.struct.UnaryExprType;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 import org.apache.commons.lang3.ObjectUtils;
 
 public class UnaryExpr implements Expression {
-    private Sign sign;
+    private UnaryExprType unaryExprType;
     private Expression expr;
 
     public UnaryExpr() {
         // default constructor
     }
 
-    public UnaryExpr(Sign sign, Expression expr) {
-        this.sign = sign;
+    public UnaryExpr(UnaryExprType type, Expression expr) {
+        this.unaryExprType = type;
         this.expr = expr;
     }
 
-    public Sign getSign() {
-        return sign;
+    public UnaryExprType getExprType() {
+        return unaryExprType;
     }
 
-    public void setSign(Sign sign) {
-        this.sign = sign;
+    public void setExprType(String strType) throws AsterixException {
+        Optional<UnaryExprType> exprType = UnaryExprType.fromSymbol(strType);
+        if (exprType.isPresent()) {
+            this.unaryExprType = exprType.get();
+        } else {
+            throw new AsterixException("Unsupported operator: " + strType);
+        }
     }
 
     public Expression getExpr() {
@@ -57,11 +65,6 @@ public class UnaryExpr implements Expression {
         return Kind.UNARY_EXPRESSION;
     }
 
-    public enum Sign {
-        POSITIVE,
-        NEGATIVE
-    }
-
     @Override
     public <R, T> R accept(ILangVisitor<R, T> visitor, T arg) throws AsterixException {
         return visitor.visit(this, arg);
@@ -69,7 +72,7 @@ public class UnaryExpr implements Expression {
 
     @Override
     public int hashCode() {
-        return ObjectUtils.hashCodeMulti(expr, sign);
+        return ObjectUtils.hashCodeMulti(expr, unaryExprType);
     }
 
     @Override
@@ -81,6 +84,6 @@ public class UnaryExpr implements Expression {
             return false;
         }
         UnaryExpr target = (UnaryExpr) object;
-        return ObjectUtils.equals(expr, target.expr) && ObjectUtils.equals(sign, target.sign);
+        return ObjectUtils.equals(expr, target.expr) && ObjectUtils.equals(unaryExprType, target.unaryExprType);
     }
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/struct/UnaryExprType.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/struct/UnaryExprType.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/struct/UnaryExprType.java
new file mode 100644
index 0000000..554a659
--- /dev/null
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/struct/UnaryExprType.java
@@ -0,0 +1,44 @@
+/*
+3 * 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.
+ */
+package org.apache.asterix.lang.common.struct;
+
+import java.util.Arrays;
+import java.util.Optional;
+
+public enum UnaryExprType {
+    POSITIVE("+"),
+    NEGATIVE("-"),
+    EXISTS("exists"),
+    NOT_EXISTS("not_exists");
+
+    private final String symbol;
+
+    UnaryExprType(String s) {
+        symbol = s;
+    }
+
+    @Override
+    public String toString() {
+        return symbol;
+    }
+
+    public static Optional<UnaryExprType> fromSymbol(String symbol) {
+        return Arrays.stream(UnaryExprType.values()).filter(o -> o.symbol.equals(symbol)).findFirst();
+    }
+}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/CloneAndSubstituteVariablesVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/CloneAndSubstituteVariablesVisitor.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/CloneAndSubstituteVariablesVisitor.java
index 57264be..667878c 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/CloneAndSubstituteVariablesVisitor.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/CloneAndSubstituteVariablesVisitor.java
@@ -260,7 +260,7 @@ public class CloneAndSubstituteVariablesVisitor extends
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(UnaryExpr u,
             VariableSubstitutionEnvironment env) throws AsterixException {
         Pair<ILangExpression, VariableSubstitutionEnvironment> p1 = u.getExpr().accept(this, env);
-        UnaryExpr newU = new UnaryExpr(u.getSign(), (Expression) p1.first);
+        UnaryExpr newU = new UnaryExpr(u.getExprType(), (Expression) p1.first);
         return new Pair<>(newU, env);
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/FormatPrintVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/FormatPrintVisitor.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/FormatPrintVisitor.java
index b9c583d..54795bc 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/FormatPrintVisitor.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/FormatPrintVisitor.java
@@ -58,7 +58,6 @@ import org.apache.asterix.lang.common.expression.RecordTypeDefinition.RecordKind
 import org.apache.asterix.lang.common.expression.TypeExpression;
 import org.apache.asterix.lang.common.expression.TypeReferenceExpression;
 import org.apache.asterix.lang.common.expression.UnaryExpr;
-import org.apache.asterix.lang.common.expression.UnaryExpr.Sign;
 import org.apache.asterix.lang.common.expression.UnorderedListTypeDefinition;
 import org.apache.asterix.lang.common.expression.VariableExpr;
 import org.apache.asterix.lang.common.statement.CompactStatement;
@@ -95,6 +94,7 @@ import org.apache.asterix.lang.common.statement.WriteStatement;
 import org.apache.asterix.lang.common.struct.Identifier;
 import org.apache.asterix.lang.common.struct.OperatorType;
 import org.apache.asterix.lang.common.struct.QuantifiedPair;
+import org.apache.asterix.lang.common.struct.UnaryExprType;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 import org.apache.hyracks.algebricks.common.utils.Pair;
 import org.apache.hyracks.algebricks.core.algebra.expressions.IExpressionAnnotation;
@@ -363,7 +363,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
 
     @Override
     public Void visit(UnaryExpr u, Integer step) throws AsterixException {
-        out.print(u.getSign() == Sign.NEGATIVE ? "-" : "");
+        out.print(u.getExprType() == UnaryExprType.NEGATIVE ? "-" : "");
         u.getExpr().accept(this, 0);
         return null;
     }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/QueryPrintVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/QueryPrintVisitor.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/QueryPrintVisitor.java
index ba2f52c..a32a3c8 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/QueryPrintVisitor.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/QueryPrintVisitor.java
@@ -284,8 +284,8 @@ public class QueryPrintVisitor extends AbstractQueryExpressionVisitor<Void, Inte
 
     @Override
     public Void visit(UnaryExpr u, Integer step) throws AsterixException {
-        if (u.getSign() != null) {
-            out.print(skip(step) + u.getSign() + " ");
+        if (u.getExprType() != null) {
+            out.print(skip(step) + u.getExprType() + " ");
             u.getExpr().accept(this, 0);
         } else {
             u.getExpr().accept(this, step);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/rewrites/visitor/OperatorExpressionVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/rewrites/visitor/OperatorExpressionVisitor.java b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/rewrites/visitor/OperatorExpressionVisitor.java
index c591d72..815e020 100644
--- a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/rewrites/visitor/OperatorExpressionVisitor.java
+++ b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/rewrites/visitor/OperatorExpressionVisitor.java
@@ -76,7 +76,7 @@ public class OperatorExpressionVisitor extends AbstractSqlppExpressionScopingVis
                 new ArrayList<Expression>(Collections.singletonList(likeExpr)));
     }
 
-    private Expression processInOperator(OperatorExpr operatorExpr, OperatorType opType) {
+    private Expression processInOperator(OperatorExpr operatorExpr, OperatorType opType) throws AsterixException {
         VariableExpr bindingVar = new VariableExpr(context.newVariable());
         Expression itemExpr = operatorExpr.getExprList().get(0);
         Expression collectionExpr = operatorExpr.getExprList().get(1);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/DeepCopyVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/DeepCopyVisitor.java b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/DeepCopyVisitor.java
index 6c48c64..bafb8c0 100644
--- a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/DeepCopyVisitor.java
+++ b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/DeepCopyVisitor.java
@@ -402,7 +402,7 @@ public class DeepCopyVisitor extends AbstractSqlppQueryExpressionVisitor<ILangEx
 
     @Override
     public UnaryExpr visit(UnaryExpr u, Void arg) throws AsterixException {
-        return new UnaryExpr(u.getSign(), (Expression) u.getExpr().accept(this, arg));
+        return new UnaryExpr(u.getExprType(), (Expression) u.getExpr().accept(this, arg));
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/SqlppCloneAndSubstituteVariablesVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/SqlppCloneAndSubstituteVariablesVisitor.java b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/SqlppCloneAndSubstituteVariablesVisitor.java
index 445c835..d380cad 100644
--- a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/SqlppCloneAndSubstituteVariablesVisitor.java
+++ b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/SqlppCloneAndSubstituteVariablesVisitor.java
@@ -187,6 +187,9 @@ public class SqlppCloneAndSubstituteVariablesVisitor extends CloneAndSubstituteV
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(Projection projection,
             VariableSubstitutionEnvironment env) throws AsterixException {
+        if (projection.star()) {
+            return new Pair<>(projection, env);
+        }
         Projection newProjection = new Projection((Expression) projection.getExpression().accept(this, env).first,
                 projection.getName(), projection.star(), projection.exprStar());
         return new Pair<>(newProjection, env);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/196db5d8/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.html
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.html b/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.html
index c651146..8d093d9 100644
--- a/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.html
+++ b/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.html
@@ -684,60 +684,65 @@
 <TR>
 <TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod66">AndExpr</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod67">RelExpr</A> ( &lt;AND&gt; <A HREF="#prod67">RelExpr</A> )*</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod67">NotExpr</A> ( &lt;AND&gt; <A HREF="#prod67">NotExpr</A> )*</TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod67">RelExpr</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod67">NotExpr</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod68">IsExpr</A> ( ( &lt;LT&gt; | &lt;GT&gt; | &lt;LE&gt; | &lt;GE&gt; | &lt;EQ&gt; | &lt;NE&gt; | &lt;SIMILAR&gt; | ( &lt;NOT&gt; )? ( &lt;LIKE&gt; | &lt;IN&gt; ) ) <A HREF="#prod68">IsExpr</A> )?</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>( &lt;NOT&gt; )? <A HREF="#prod68">RelExpr</A></TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod68">IsExpr</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod68">RelExpr</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod69">AddExpr</A> ( &lt;IS&gt; ( &lt;NOT&gt; )? ( &lt;NULL&gt; | &lt;MISSING&gt; | &lt;UNKOWN&gt; ) )?</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod69">IsExpr</A> ( ( &lt;LT&gt; | &lt;GT&gt; | &lt;LE&gt; | &lt;GE&gt; | &lt;EQ&gt; | &lt;NE&gt; | &lt;SIMILAR&gt; | ( &lt;NOT&gt; )? ( &lt;LIKE&gt; | &lt;IN&gt; ) ) <A HREF="#prod69">IsExpr</A> )?</TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod69">AddExpr</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod69">IsExpr</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod70">MultExpr</A> ( ( &lt;PLUS&gt; | &lt;MINUS&gt; ) <A HREF="#prod70">MultExpr</A> )*</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod70">AddExpr</A> ( &lt;IS&gt; ( &lt;NOT&gt; )? ( &lt;NULL&gt; | &lt;MISSING&gt; | &lt;UNKOWN&gt; ) )?</TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod70">MultExpr</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod70">AddExpr</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod71">UnaryExpr</A> ( ( &lt;MUL&gt; | &lt;DIV&gt; | &lt;MOD&gt; | &lt;CARET&gt; | &lt;IDIV&gt; ) <A HREF="#prod71">UnaryExpr</A> )*</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod71">MultExpr</A> ( ( &lt;PLUS&gt; | &lt;MINUS&gt; ) <A HREF="#prod71">MultExpr</A> )*</TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod71">UnaryExpr</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod71">MultExpr</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE>( ( &lt;PLUS&gt; | &lt;MINUS&gt; | &lt;NOT&gt; ) )? <A HREF="#prod72">ValueExpr</A></TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod72">UnaryExpr</A> ( ( &lt;MUL&gt; | &lt;DIV&gt; | &lt;MOD&gt; | &lt;CARET&gt; | &lt;IDIV&gt; ) <A HREF="#prod72">UnaryExpr</A> )*</TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod72">ValueExpr</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod72">UnaryExpr</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod73">PrimaryExpr</A> ( <A HREF="#prod74">Field</A> | <A HREF="#prod75">Index</A> )*</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>( ( &lt;PLUS&gt; | &lt;MINUS&gt; | ( &lt;NOT&gt; )? &lt;EXISTS&gt; ) )? <A HREF="#prod73">ValueExpr</A></TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod74">Field</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod73">ValueExpr</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod74">PrimaryExpr</A> ( <A HREF="#prod75">Field</A> | <A HREF="#prod76">Index</A> )*</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod75">Field</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
 <TD ALIGN=LEFT VALIGN=BASELINE>&lt;DOT&gt; <A HREF="#prod18">Identifier</A></TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod75">Index</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod76">Index</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
 <TD ALIGN=LEFT VALIGN=BASELINE>&lt;LEFTBRACKET&gt; ( <A HREF="#prod44">Expression</A> | &lt;QUES&gt; ) &lt;RIGHTBRACKET&gt;</TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod73">PrimaryExpr</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod74">PrimaryExpr</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod76">FunctionCallExpr</A> | <A HREF="#prod77">Literal</A> | <A HREF="#prod78">VariableRef</A> | <A HREF="#prod79">ListConstructor</A> | <A HREF="#prod80">RecordConstructor</A> | <A HREF="#prod81">ParenthesizedExpression</A> )</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod77">FunctionCallExpr</A> | <A HREF="#prod78">Literal</A> | <A HREF="#prod79">VariableRef</A> | <A HREF="#prod80">ListConstructor</A> | <A HREF="#prod81">RecordConstructor</A> | <A HREF="#prod82">ParenthesizedExpression</A> )</TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod77">Literal</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod78">Literal</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
 <TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod54">StringLiteral</A> | &lt;INTEGER_LITERAL&gt; | &lt;FLOAT_LITERAL&gt; | &lt;DOUBLE_LITERAL&gt; | &lt;MISSING&gt; | &lt;NULL&gt; | &lt;TRUE&gt; | &lt;FALSE&gt; )</TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod78">VariableRef</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod79">VariableRef</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
 <TD ALIGN=LEFT VALIGN=BASELINE>( &lt;IDENTIFIER&gt; | <A HREF="#prod61">QuotedString</A> )</TD>
 </TR>
@@ -747,49 +752,49 @@
 <TD ALIGN=LEFT VALIGN=BASELINE>( &lt;IDENTIFIER&gt; | <A HREF="#prod61">QuotedString</A> )</TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod79">ListConstructor</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod80">ListConstructor</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod82">OrderedListConstructor</A> | <A HREF="#prod83">UnorderedListConstructor</A> )</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod83">OrderedListConstructor</A> | <A HREF="#prod84">UnorderedListConstructor</A> )</TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod82">OrderedListConstructor</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod83">OrderedListConstructor</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE>&lt;LEFTBRACKET&gt; <A HREF="#prod84">ExpressionList</A> &lt;RIGHTBRACKET&gt;</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>&lt;LEFTBRACKET&gt; <A HREF="#prod85">ExpressionList</A> &lt;RIGHTBRACKET&gt;</TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod83">UnorderedListConstructor</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod84">UnorderedListConstructor</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE>&lt;LEFTDBLBRACE&gt; <A HREF="#prod84">ExpressionList</A> &lt;RIGHTDBLBRACE&gt;</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>&lt;LEFTDBLBRACE&gt; <A HREF="#prod85">ExpressionList</A> &lt;RIGHTDBLBRACE&gt;</TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod84">ExpressionList</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod85">ExpressionList</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod44">Expression</A> ( &lt;COMMA&gt; <A HREF="#prod84">ExpressionList</A> )? )? ( <A HREF="#prod85">Comma</A> )?</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod44">Expression</A> ( &lt;COMMA&gt; <A HREF="#prod85">ExpressionList</A> )? )? ( <A HREF="#prod86">Comma</A> )?</TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod85">Comma</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod86">Comma</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
 <TD ALIGN=LEFT VALIGN=BASELINE>&lt;COMMA&gt;</TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod80">RecordConstructor</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod81">RecordConstructor</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE>&lt;LEFTBRACE&gt; ( <A HREF="#prod86">FieldBinding</A> ( &lt;COMMA&gt; <A HREF="#prod86">FieldBinding</A> )* )? &lt;RIGHTBRACE&gt;</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>&lt;LEFTBRACE&gt; ( <A HREF="#prod87">FieldBinding</A> ( &lt;COMMA&gt; <A HREF="#prod87">FieldBinding</A> )* )? &lt;RIGHTBRACE&gt;</TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod86">FieldBinding</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod87">FieldBinding</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
 <TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod44">Expression</A> &lt;COLON&gt; <A HREF="#prod44">Expression</A></TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod76">FunctionCallExpr</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod77">FunctionCallExpr</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
 <TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod42">FunctionName</A> &lt;LEFTPAREN&gt; ( <A HREF="#prod44">Expression</A> ( &lt;COMMA&gt; <A HREF="#prod44">Expression</A> )* )? &lt;RIGHTPAREN&gt;</TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod81">ParenthesizedExpression</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod82">ParenthesizedExpression</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE>( &lt;LEFTPAREN&gt; <A HREF="#prod44">Expression</A> &lt;RIGHTPAREN&gt; | <A HREF="#prod87">Subquery</A> )</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>( &lt;LEFTPAREN&gt; <A HREF="#prod44">Expression</A> &lt;RIGHTPAREN&gt; | <A HREF="#prod88">Subquery</A> )</TD>
 </TR>
 <TR>
 <TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod64">IfThenElse</A></TD>
@@ -799,95 +804,95 @@
 <TR>
 <TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod62">SelectExpression</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod88">LetClause</A> )? <A HREF="#prod89">SelectSetOperation</A> ( <A HREF="#prod90">OrderbyClause</A> )? ( <A HREF="#prod91">LimitClause</A> )?</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod89">LetClause</A> )? <A HREF="#prod90">SelectSetOperation</A> ( <A HREF="#prod91">OrderbyClause</A> )? ( <A HREF="#prod92">LimitClause</A> )?</TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod89">SelectSetOperation</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod90">SelectSetOperation</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod92">SelectBlock</A> ( ( &lt;UNION&gt; | &lt;INTERSECT&gt; | &lt;EXCEPT&gt; ) ( &lt;ALL&gt; )? ( <A HREF="#prod92">SelectBlock</A> | <A HREF="#prod87">Subquery</A> ) )*</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod93">SelectBlock</A> ( ( &lt;UNION&gt; | &lt;INTERSECT&gt; | &lt;EXCEPT&gt; ) ( &lt;ALL&gt; )? ( <A HREF="#prod93">SelectBlock</A> | <A HREF="#prod88">Subquery</A> ) )*</TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod87">Subquery</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod88">Subquery</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
 <TD ALIGN=LEFT VALIGN=BASELINE>&lt;LEFTPAREN&gt; <A HREF="#prod62">SelectExpression</A> &lt;RIGHTPAREN&gt;</TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod92">SelectBlock</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod93">SelectBlock</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod93">SelectClause</A> ( <A HREF="#prod94">FromClause</A> ( <A HREF="#prod88">LetClause</A> )? )? ( <A HREF="#prod95">WhereClause</A> )? ( <A HREF="#prod96">GroupbyClause</A> ( <A HREF="#prod88">LetClause</A> )? ( <A HREF="#prod97">HavingClause</A> )? )? | <A HREF="#prod94">FromClause</A> ( <A HREF="#prod88">LetClause</A> )? ( <A HREF="#prod95">WhereClause</A> )? ( <A HREF="#prod96">GroupbyClause</A> ( <A HREF="#prod88">LetClause</A> )? ( <A HREF="#prod97">HavingClause</A> )? )? <A HREF="#prod93">SelectClause</A> )</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod94">SelectClause</A> ( <A HREF="#prod95">FromClause</A> ( <A HREF="#prod89">LetClause</A> )? )? ( <A HREF="#prod96">WhereClause</A> )? ( <A HREF="#prod97">GroupbyClause</A> ( <A HREF="#prod89">LetClause</A> )? ( <A HREF="#prod98">HavingClause</A> )? )? | <A HREF="#prod95">FromClause</A> ( <A HREF="#prod89">LetClause</A> )? ( <A HREF="#prod96">WhereClause</A> )? ( <A HREF="#prod97">GroupbyClause</A> ( <A HREF="#prod89">LetClause</A> )? ( <A HREF="#prod98">HavingClause</A> )? )? <A HREF="#prod94">SelectClause</A> )</TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod93">SelectClause</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod94">SelectClause</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE>&lt;SELECT&gt; ( &lt;ALL&gt; | &lt;DISTINCT&gt; )? ( <A HREF="#prod98">SelectRegular</A> | <A HREF="#prod99">SelectElement</A> )?</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>&lt;SELECT&gt; ( &lt;ALL&gt; | &lt;DISTINCT&gt; )? ( <A HREF="#prod99">SelectRegular</A> | <A HREF="#prod100">SelectElement</A> )?</TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod98">SelectRegular</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod99">SelectRegular</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod100">Projection</A> ( &lt;COMMA&gt; <A HREF="#prod100">Projection</A> )*</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod101">Projection</A> ( &lt;COMMA&gt; <A HREF="#prod101">Projection</A> )*</TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod99">SelectElement</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod100">SelectElement</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
 <TD ALIGN=LEFT VALIGN=BASELINE>( &lt;RAW&gt; | &lt;ELEMENT&gt; | &lt;VALUE&gt; ) <A HREF="#prod44">Expression</A></TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod100">Projection</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod101">Projection</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
 <TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod44">Expression</A> ( ( &lt;AS&gt; )? <A HREF="#prod18">Identifier</A> )? | <A HREF="#prod44">Expression</A> &lt;DOT&gt; &lt;MUL&gt; | &lt;MUL&gt; )</TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod94">FromClause</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod95">FromClause</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE>&lt;FROM&gt; <A HREF="#prod101">FromTerm</A> ( &lt;COMMA&gt; <A HREF="#prod101">FromTerm</A> )*</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>&lt;FROM&gt; <A HREF="#prod102">FromTerm</A> ( &lt;COMMA&gt; <A HREF="#prod102">FromTerm</A> )*</TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod101">FromTerm</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod102">FromTerm</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod44">Expression</A> ( ( &lt;AS&gt; )? <A HREF="#prod50">Variable</A> )? ( &lt;AT&gt; <A HREF="#prod50">Variable</A> )? ( ( <A HREF="#prod102">JoinType</A> )? ( <A HREF="#prod103">JoinClause</A> | <A HREF="#prod104">UnnestClause</A> ) )*</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod44">Expression</A> ( ( &lt;AS&gt; )? <A HREF="#prod50">Variable</A> )? ( &lt;AT&gt; <A HREF="#prod50">Variable</A> )? ( ( <A HREF="#prod103">JoinType</A> )? ( <A HREF="#prod104">JoinClause</A> | <A HREF="#prod105">UnnestClause</A> ) )*</TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod103">JoinClause</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod104">JoinClause</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
 <TD ALIGN=LEFT VALIGN=BASELINE>&lt;JOIN&gt; <A HREF="#prod44">Expression</A> ( ( &lt;AS&gt; )? <A HREF="#prod50">Variable</A> )? ( &lt;AT&gt; <A HREF="#prod50">Variable</A> )? &lt;ON&gt; <A HREF="#prod44">Expression</A></TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod104">UnnestClause</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod105">UnnestClause</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
 <TD ALIGN=LEFT VALIGN=BASELINE>( &lt;UNNEST&gt; | &lt;CORRELATE&gt; | &lt;FLATTEN&gt; ) <A HREF="#prod44">Expression</A> ( ( &lt;AS&gt; )? <A HREF="#prod50">Variable</A> ) ( &lt;AT&gt; <A HREF="#prod50">Variable</A> )?</TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod102">JoinType</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod103">JoinType</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
 <TD ALIGN=LEFT VALIGN=BASELINE>( &lt;INNER&gt; | &lt;LEFT&gt; ( &lt;OUTER&gt; )? )</TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod88">LetClause</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod89">LetClause</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE>( ( &lt;LET&gt; | &lt;LETTING&gt; ) <A HREF="#prod105">LetElement</A> ( &lt;COMMA&gt; <A HREF="#prod105">LetElement</A> )* | &lt;WITH&gt; <A HREF="#prod106">WithElement</A> ( &lt;COMMA&gt; <A HREF="#prod106">WithElement</A> )* )</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>( ( &lt;LET&gt; | &lt;LETTING&gt; ) <A HREF="#prod106">LetElement</A> ( &lt;COMMA&gt; <A HREF="#prod106">LetElement</A> )* | &lt;WITH&gt; <A HREF="#prod107">WithElement</A> ( &lt;COMMA&gt; <A HREF="#prod107">WithElement</A> )* )</TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod95">WhereClause</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod96">WhereClause</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
 <TD ALIGN=LEFT VALIGN=BASELINE>&lt;WHERE&gt; <A HREF="#prod44">Expression</A></TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod90">OrderbyClause</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod91">OrderbyClause</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
 <TD ALIGN=LEFT VALIGN=BASELINE>&lt;ORDER&gt; &lt;BY&gt; <A HREF="#prod44">Expression</A> ( ( &lt;ASC&gt; ) | ( &lt;DESC&gt; ) )? ( &lt;COMMA&gt; <A HREF="#prod44">Expression</A> ( ( &lt;ASC&gt; ) | ( &lt;DESC&gt; ) )? )*</TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod96">GroupbyClause</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod97">GroupbyClause</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE>&lt;GROUP&gt; &lt;BY&gt; ( <A HREF="#prod44">Expression</A> ( ( &lt;AS&gt; )? <A HREF="#prod50">Variable</A> )? ( &lt;COMMA&gt; <A HREF="#prod44">Expression</A> ( ( &lt;AS&gt; )? <A HREF="#prod50">Variable</A> )? )* ) ( &lt;GROUP&gt; &lt;AS&gt; <A HREF="#prod50">Variable</A> ( &lt;LEFTPAREN&gt; <A HREF="#prod78">VariableRef</A> &lt;AS&gt; <A HREF="#prod18">Identifier</A> ( &lt;COMMA&gt; <A HREF="#prod78">VariableRef</A> &lt;AS&gt; <A HREF="#prod18">Identifier</A> )* &lt;RIGHTPAREN&gt; )? )?</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>&lt;GROUP&gt; &lt;BY&gt; ( <A HREF="#prod44">Expression</A> ( ( &lt;AS&gt; )? <A HREF="#prod50">Variable</A> )? ( &lt;COMMA&gt; <A HREF="#prod44">Expression</A> ( ( &lt;AS&gt; )? <A HREF="#prod50">Variable</A> )? )* ) ( &lt;GROUP&gt; &lt;AS&gt; <A HREF="#prod50">Variable</A> ( &lt;LEFTPAREN&gt; <A HREF="#prod79">VariableRef</A> &lt;AS&gt; <A HREF="#prod18">Identifier</A> ( &lt;COMMA&gt; <A HREF="#prod79">VariableRef</A> &lt;AS&gt; <A HREF="#prod18">Identifier</A> )* &lt;RIGHTPAREN&gt; )? )?</TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod97">HavingClause</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod98">HavingClause</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
 <TD ALIGN=LEFT VALIGN=BASELINE>&lt;HAVING&gt; <A HREF="#prod44">Expression</A></TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod91">LimitClause</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod92">LimitClause</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
 <TD ALIGN=LEFT VALIGN=BASELINE>&lt;LIMIT&gt; <A HREF="#prod44">Expression</A> ( &lt;OFFSET&gt; <A HREF="#prod44">Expression</A> )?</TD>
 </TR>
@@ -897,12 +902,12 @@
 <TD ALIGN=LEFT VALIGN=BASELINE>( ( &lt;SOME&gt; ) | ( &lt;EVERY&gt; ) ) <A HREF="#prod50">Variable</A> &lt;IN&gt; <A HREF="#prod44">Expression</A> ( &lt;COMMA&gt; <A HREF="#prod50">Variable</A> &lt;IN&gt; <A HREF="#prod44">Expression</A> )* &lt;SATISFIES&gt; <A HREF="#prod44">Expression</A></TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod105">LetElement</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod106">LetElement</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
 <TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod50">Variable</A> &lt;EQ&gt; <A HREF="#prod44">Expression</A></TD>
 </TR>
 <TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod106">WithElement</A></TD>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod107">WithElement</A></TD>
 <TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
 <TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod50">Variable</A> &lt;AS&gt; <A HREF="#prod44">Expression</A></TD>
 </TR>


Mime
View raw message