asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From buyin...@apache.org
Subject [09/51] [partial] incubator-asterixdb git commit: ASTERIXDB-1226: implement SQL++ core group-by semantics and syntatic sugars.
Date Mon, 28 Mar 2016 20:18:36 GMT
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/quantifiers/everysat_04/everysat_04.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/quantifiers/everysat_04/everysat_04.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/quantifiers/everysat_04/everysat_04.3.ast
index 44d3f63..5808cbf 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/quantifiers/everysat_04/everysat_04.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/quantifiers/everysat_04/everysat_04.3.ast
@@ -1,11 +1,11 @@
 DataverseUse test
 Set import-private-functions=true
 Query:
-LetVariable [ Name=x ]
+Let Variable [ Name=$x ]
   :=
   OrderedListConstructor [
     QuantifiedExpression EVERY [
-      [Variable [ Name=x ]
+      [Variable [ Name=$x ]
       In
         OrderedListConstructor [
           LiteralExpr [FALSE]
@@ -13,11 +13,11 @@ LetVariable [ Name=x ]
         ]
       ]
       Satifies [
-        Variable [ Name=x ]
+        Variable [ Name=$x ]
       ]
     ]
     QuantifiedExpression EVERY [
-      [Variable [ Name=x ]
+      [Variable [ Name=$x ]
       In
         OrderedListConstructor [
           LiteralExpr [TRUE]
@@ -25,11 +25,11 @@ LetVariable [ Name=x ]
         ]
       ]
       Satifies [
-        Variable [ Name=x ]
+        Variable [ Name=$x ]
       ]
     ]
     QuantifiedExpression EVERY [
-      [Variable [ Name=x ]
+      [Variable [ Name=$x ]
       In
         OrderedListConstructor [
           LiteralExpr [FALSE]
@@ -37,11 +37,11 @@ LetVariable [ Name=x ]
         ]
       ]
       Satifies [
-        Variable [ Name=x ]
+        Variable [ Name=$x ]
       ]
     ]
     QuantifiedExpression EVERY [
-      [Variable [ Name=x ]
+      [Variable [ Name=$x ]
       In
         OrderedListConstructor [
           LiteralExpr [TRUE]
@@ -49,11 +49,11 @@ LetVariable [ Name=x ]
         ]
       ]
       Satifies [
-        Variable [ Name=x ]
+        Variable [ Name=$x ]
       ]
     ]
     QuantifiedExpression EVERY [
-      [Variable [ Name=x ]
+      [Variable [ Name=$x ]
       In
         OrderedListConstructor [
           LiteralExpr [FALSE]
@@ -62,12 +62,12 @@ LetVariable [ Name=x ]
       ]
       Satifies [
         FunctionCall test.not@1[
-          Variable [ Name=x ]
+          Variable [ Name=$x ]
         ]
       ]
     ]
     QuantifiedExpression EVERY [
-      [Variable [ Name=x ]
+      [Variable [ Name=$x ]
       In
         OrderedListConstructor [
           LiteralExpr [TRUE]
@@ -76,12 +76,12 @@ LetVariable [ Name=x ]
       ]
       Satifies [
         FunctionCall test.not@1[
-          Variable [ Name=x ]
+          Variable [ Name=$x ]
         ]
       ]
     ]
     QuantifiedExpression EVERY [
-      [Variable [ Name=x ]
+      [Variable [ Name=$x ]
       In
         OrderedListConstructor [
           LiteralExpr [FALSE]
@@ -90,12 +90,12 @@ LetVariable [ Name=x ]
       ]
       Satifies [
         FunctionCall test.not@1[
-          Variable [ Name=x ]
+          Variable [ Name=$x ]
         ]
       ]
     ]
     QuantifiedExpression EVERY [
-      [Variable [ Name=x ]
+      [Variable [ Name=$x ]
       In
         OrderedListConstructor [
           LiteralExpr [TRUE]
@@ -104,15 +104,15 @@ LetVariable [ Name=x ]
       ]
       Satifies [
         FunctionCall test.not@1[
-          Variable [ Name=x ]
+          Variable [ Name=$x ]
         ]
       ]
     ]
   ]
 SELECT ELEMENT [
-Variable [ Name=i ]
+Variable [ Name=$i ]
 ]
-FROM [  Variable [ Name=x ]
+FROM [  Variable [ Name=$x ]
   AS
-  Variable [ Name=i ]
+  Variable [ Name=$i ]
 ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/quantifiers/somesat_01/somesat_01.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/quantifiers/somesat_01/somesat_01.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/quantifiers/somesat_01/somesat_01.3.ast
index a39bcb5..e1e8b65 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/quantifiers/somesat_01/somesat_01.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/quantifiers/somesat_01/somesat_01.3.ast
@@ -1,7 +1,7 @@
 DataverseUse test
 Query:
 SELECT ELEMENT [
-Variable [ Name=x ]
+Variable [ Name=$x ]
 ]
 FROM [  OrderedListConstructor [
     LiteralExpr [LONG] [10]
@@ -10,11 +10,11 @@ FROM [  OrderedListConstructor [
     LiteralExpr [LONG] [50]
   ]
   AS
-  Variable [ Name=x ]
+  Variable [ Name=$x ]
 ]
 Where
   QuantifiedExpression SOME [
-    [Variable [ Name=y ]
+    [Variable [ Name=$y ]
     In
       OrderedListConstructor [
         NEGATIVE LiteralExpr [LONG] [20]
@@ -23,9 +23,9 @@ Where
     ]
     Satifies [
       OperatorExpr [
-        Variable [ Name=y ]
+        Variable [ Name=$y ]
         >
-        Variable [ Name=x ]
+        Variable [ Name=$x ]
       ]
     ]
   ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/quantifiers/somesat_02/somesat_02.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/quantifiers/somesat_02/somesat_02.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/quantifiers/somesat_02/somesat_02.3.ast
index ab31857..7aebb09 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/quantifiers/somesat_02/somesat_02.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/quantifiers/somesat_02/somesat_02.3.ast
@@ -2,7 +2,7 @@ DataverseUse test
 Query:
 SELECT ELEMENT [
 FieldAccessor [
-  Variable [ Name=x ]
+  Variable [ Name=$x ]
   Field=cid
 ]
 ]
@@ -10,11 +10,11 @@ FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [CustomerSomeSat02]
   ]
   AS
-  Variable [ Name=x ]
+  Variable [ Name=$x ]
 ]
 Where
   QuantifiedExpression SOME [
-    [Variable [ Name=y ]
+    [Variable [ Name=$y ]
     In
       FunctionCall Metadata.dataset@1[
         LiteralExpr [STRING] [OrdersSomeSat02]
@@ -23,12 +23,12 @@ Where
     Satifies [
       OperatorExpr [
         FieldAccessor [
-          Variable [ Name=y ]
+          Variable [ Name=$y ]
           Field=cid
         ]
         =
         FieldAccessor [
-          Variable [ Name=x ]
+          Variable [ Name=$x ]
           Field=cid
         ]
       ]
@@ -36,7 +36,7 @@ Where
   ]
 Orderby
   FieldAccessor [
-    Variable [ Name=x ]
+    Variable [ Name=$x ]
     Field=cid
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/quantifiers/somesat_06/somesat_06.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/quantifiers/somesat_06/somesat_06.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/quantifiers/somesat_06/somesat_06.3.ast
index 2ed5885..d0d67f4 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/quantifiers/somesat_06/somesat_06.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/quantifiers/somesat_06/somesat_06.3.ast
@@ -1,11 +1,11 @@
 DataverseUse test
 Set import-private-functions=true
 Query:
-LetVariable [ Name=x ]
+Let Variable [ Name=$x ]
   :=
   OrderedListConstructor [
     QuantifiedExpression SOME [
-      [Variable [ Name=x ]
+      [Variable [ Name=$x ]
       In
         OrderedListConstructor [
           LiteralExpr [FALSE]
@@ -13,11 +13,11 @@ LetVariable [ Name=x ]
         ]
       ]
       Satifies [
-        Variable [ Name=x ]
+        Variable [ Name=$x ]
       ]
     ]
     QuantifiedExpression SOME [
-      [Variable [ Name=x ]
+      [Variable [ Name=$x ]
       In
         OrderedListConstructor [
           LiteralExpr [TRUE]
@@ -25,11 +25,11 @@ LetVariable [ Name=x ]
         ]
       ]
       Satifies [
-        Variable [ Name=x ]
+        Variable [ Name=$x ]
       ]
     ]
     QuantifiedExpression SOME [
-      [Variable [ Name=x ]
+      [Variable [ Name=$x ]
       In
         OrderedListConstructor [
           LiteralExpr [FALSE]
@@ -37,11 +37,11 @@ LetVariable [ Name=x ]
         ]
       ]
       Satifies [
-        Variable [ Name=x ]
+        Variable [ Name=$x ]
       ]
     ]
     QuantifiedExpression SOME [
-      [Variable [ Name=x ]
+      [Variable [ Name=$x ]
       In
         OrderedListConstructor [
           LiteralExpr [TRUE]
@@ -49,11 +49,11 @@ LetVariable [ Name=x ]
         ]
       ]
       Satifies [
-        Variable [ Name=x ]
+        Variable [ Name=$x ]
       ]
     ]
     QuantifiedExpression SOME [
-      [Variable [ Name=x ]
+      [Variable [ Name=$x ]
       In
         OrderedListConstructor [
           LiteralExpr [FALSE]
@@ -62,12 +62,12 @@ LetVariable [ Name=x ]
       ]
       Satifies [
         FunctionCall test.not@1[
-          Variable [ Name=x ]
+          Variable [ Name=$x ]
         ]
       ]
     ]
     QuantifiedExpression SOME [
-      [Variable [ Name=x ]
+      [Variable [ Name=$x ]
       In
         OrderedListConstructor [
           LiteralExpr [TRUE]
@@ -76,12 +76,12 @@ LetVariable [ Name=x ]
       ]
       Satifies [
         FunctionCall test.not@1[
-          Variable [ Name=x ]
+          Variable [ Name=$x ]
         ]
       ]
     ]
     QuantifiedExpression SOME [
-      [Variable [ Name=x ]
+      [Variable [ Name=$x ]
       In
         OrderedListConstructor [
           LiteralExpr [FALSE]
@@ -90,12 +90,12 @@ LetVariable [ Name=x ]
       ]
       Satifies [
         FunctionCall test.not@1[
-          Variable [ Name=x ]
+          Variable [ Name=$x ]
         ]
       ]
     ]
     QuantifiedExpression SOME [
-      [Variable [ Name=x ]
+      [Variable [ Name=$x ]
       In
         OrderedListConstructor [
           LiteralExpr [TRUE]
@@ -104,15 +104,15 @@ LetVariable [ Name=x ]
       ]
       Satifies [
         FunctionCall test.not@1[
-          Variable [ Name=x ]
+          Variable [ Name=$x ]
         ]
       ]
     ]
   ]
 SELECT ELEMENT [
-Variable [ Name=i ]
+Variable [ Name=$i ]
 ]
-FROM [  Variable [ Name=x ]
+FROM [  Variable [ Name=$x ]
   AS
-  Variable [ Name=i ]
+  Variable [ Name=$i ]
 ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/range-hints/order-by/order-by.4.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/range-hints/order-by/order-by.4.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/range-hints/order-by/order-by.4.ast
index bfdfa6a..b071d6b 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/range-hints/order-by/order-by.4.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/range-hints/order-by/order-by.4.ast
@@ -1,17 +1,17 @@
 DataverseUse TinySocial
 Query:
 SELECT ELEMENT [
-Variable [ Name=user ]
+Variable [ Name=$user ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [TwitterUsers]
   ]
   AS
-  Variable [ Name=user ]
+  Variable [ Name=$user ]
 ]
 Orderby
   FieldAccessor [
-    Variable [ Name=user ]
+    Variable [ Name=$user ]
     Field=screen-name
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/range-hints/order-by/order-by.5.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/range-hints/order-by/order-by.5.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/range-hints/order-by/order-by.5.ast
index bea7ba6..eea3f99 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/range-hints/order-by/order-by.5.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/range-hints/order-by/order-by.5.ast
@@ -1,17 +1,17 @@
 DataverseUse TinySocial
 Query:
 SELECT ELEMENT [
-Variable [ Name=user ]
+Variable [ Name=$user ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [TwitterUsers]
   ]
   AS
-  Variable [ Name=user ]
+  Variable [ Name=$user ]
 ]
 Orderby
   FieldAccessor [
-    Variable [ Name=user ]
+    Variable [ Name=$user ]
     Field=screen-name
   ]
   DESC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/range-hints/order-by/order-by.6.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/range-hints/order-by/order-by.6.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/range-hints/order-by/order-by.6.ast
index f355a3e..b4cd41e 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/range-hints/order-by/order-by.6.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/range-hints/order-by/order-by.6.ast
@@ -1,17 +1,17 @@
 DataverseUse TinySocial
 Query:
 SELECT ELEMENT [
-Variable [ Name=user ]
+Variable [ Name=$user ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [TwitterUsers]
   ]
   AS
-  Variable [ Name=user ]
+  Variable [ Name=$user ]
 ]
 Orderby
   FieldAccessor [
-    Variable [ Name=user ]
+    Variable [ Name=$user ]
     Field=friends_count
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/range-hints/order-by/order-by.7.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/range-hints/order-by/order-by.7.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/range-hints/order-by/order-by.7.ast
index 0a275c4..3aafcb2 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/range-hints/order-by/order-by.7.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/range-hints/order-by/order-by.7.ast
@@ -1,17 +1,17 @@
 DataverseUse TinySocial
 Query:
 SELECT ELEMENT [
-Variable [ Name=user ]
+Variable [ Name=$user ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [TwitterUsers]
   ]
   AS
-  Variable [ Name=user ]
+  Variable [ Name=$user ]
 ]
 Orderby
   FieldAccessor [
-    Variable [ Name=user ]
+    Variable [ Name=$user ]
     Field=friends_count
   ]
   DESC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.10.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.10.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.10.ast
index f0ad634..816bb17 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.10.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.10.ast
@@ -1,26 +1,26 @@
 DataverseUse test
 Query:
 SELECT ELEMENT [
-Variable [ Name=result ]
+Variable [ Name=$result ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Animals]
   ]
   AS
-  Variable [ Name=test ]
+  Variable [ Name=$test ]
 ]
-LetVariable [ Name=result ]
+Let Variable [ Name=$result ]
   :=
   FieldAccessor [
     FieldAccessor [
-      Variable [ Name=test ]
+      Variable [ Name=$test ]
       Field=class
     ]
     Field=fullClassification
   ]
 Orderby
   FieldAccessor [
-    Variable [ Name=result ]
+    Variable [ Name=$result ]
     Field=id
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.11.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.11.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.11.ast
index a6821b5..2198926 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.11.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.11.ast
@@ -1,23 +1,23 @@
 DataverseUse test
 Query:
 SELECT ELEMENT [
-Variable [ Name=result ]
+Variable [ Name=$result ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Animals]
   ]
   AS
-  Variable [ Name=test ]
+  Variable [ Name=$test ]
 ]
-LetVariable [ Name=result ]
+Let Variable [ Name=$result ]
   :=
   FieldAccessor [
-    Variable [ Name=test ]
+    Variable [ Name=$test ]
     Field=class
   ]
 Orderby
   FieldAccessor [
-    Variable [ Name=result ]
+    Variable [ Name=$result ]
     Field=id
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.12.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.12.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.12.ast
index 803de17..4cf3180 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.12.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.12.ast
@@ -1,20 +1,20 @@
 DataverseUse test
 Query:
 SELECT ELEMENT [
-Variable [ Name=result ]
+Variable [ Name=$result ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Animals]
   ]
   AS
-  Variable [ Name=test ]
+  Variable [ Name=$test ]
 ]
-LetVariable [ Name=result ]
+Let Variable [ Name=$result ]
   :=
-  Variable [ Name=test ]
+  Variable [ Name=$test ]
 Orderby
   FieldAccessor [
-    Variable [ Name=result ]
+    Variable [ Name=$result ]
     Field=id
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.3.ast
index 8e283f1..640f2f4 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.3.ast
@@ -1,15 +1,15 @@
 DataverseUse test
 Query:
 SELECT ELEMENT [
-Variable [ Name=result ]
+Variable [ Name=$result ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Animals]
   ]
   AS
-  Variable [ Name=test ]
+  Variable [ Name=$test ]
 ]
-LetVariable [ Name=result ]
+Let Variable [ Name=$result ]
   :=
   FieldAccessor [
     FieldAccessor [
@@ -20,7 +20,7 @@ LetVariable [ Name=result ]
               FieldAccessor [
                 FieldAccessor [
                   FieldAccessor [
-                    Variable [ Name=test ]
+                    Variable [ Name=$test ]
                     Field=class
                   ]
                   Field=fullClassification
@@ -40,6 +40,6 @@ LetVariable [ Name=result ]
     Field=Species
   ]
 Orderby
-  Variable [ Name=result ]
+  Variable [ Name=$result ]
   ASC
 

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.4.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.4.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.4.ast
index 37657b9..8f6dd8a 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.4.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.4.ast
@@ -1,15 +1,15 @@
 DataverseUse test
 Query:
 SELECT ELEMENT [
-Variable [ Name=result ]
+Variable [ Name=$result ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Animals]
   ]
   AS
-  Variable [ Name=test ]
+  Variable [ Name=$test ]
 ]
-LetVariable [ Name=result ]
+Let Variable [ Name=$result ]
   :=
   FieldAccessor [
     FieldAccessor [
@@ -19,7 +19,7 @@ LetVariable [ Name=result ]
             FieldAccessor [
               FieldAccessor [
                 FieldAccessor [
-                  Variable [ Name=test ]
+                  Variable [ Name=$test ]
                   Field=class
                 ]
                 Field=fullClassification
@@ -38,7 +38,7 @@ LetVariable [ Name=result ]
   ]
 Orderby
   FieldAccessor [
-    Variable [ Name=result ]
+    Variable [ Name=$result ]
     Field=id
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.5.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.5.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.5.ast
index d7bf2cc..c990329 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.5.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.5.ast
@@ -1,15 +1,15 @@
 DataverseUse test
 Query:
 SELECT ELEMENT [
-Variable [ Name=result ]
+Variable [ Name=$result ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Animals]
   ]
   AS
-  Variable [ Name=test ]
+  Variable [ Name=$test ]
 ]
-LetVariable [ Name=result ]
+Let Variable [ Name=$result ]
   :=
   FieldAccessor [
     FieldAccessor [
@@ -18,7 +18,7 @@ LetVariable [ Name=result ]
           FieldAccessor [
             FieldAccessor [
               FieldAccessor [
-                Variable [ Name=test ]
+                Variable [ Name=$test ]
                 Field=class
               ]
               Field=fullClassification
@@ -35,7 +35,7 @@ LetVariable [ Name=result ]
   ]
 Orderby
   FieldAccessor [
-    Variable [ Name=result ]
+    Variable [ Name=$result ]
     Field=id
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.6.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.6.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.6.ast
index f1eba54..683e01e 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.6.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.6.ast
@@ -1,15 +1,15 @@
 DataverseUse test
 Query:
 SELECT ELEMENT [
-Variable [ Name=result ]
+Variable [ Name=$result ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Animals]
   ]
   AS
-  Variable [ Name=test ]
+  Variable [ Name=$test ]
 ]
-LetVariable [ Name=result ]
+Let Variable [ Name=$result ]
   :=
   FieldAccessor [
     FieldAccessor [
@@ -17,7 +17,7 @@ LetVariable [ Name=result ]
         FieldAccessor [
           FieldAccessor [
             FieldAccessor [
-              Variable [ Name=test ]
+              Variable [ Name=$test ]
               Field=class
             ]
             Field=fullClassification
@@ -32,7 +32,7 @@ LetVariable [ Name=result ]
   ]
 Orderby
   FieldAccessor [
-    Variable [ Name=result ]
+    Variable [ Name=$result ]
     Field=id
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.7.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.7.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.7.ast
index dc420c6..fb9178e 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.7.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.7.ast
@@ -1,22 +1,22 @@
 DataverseUse test
 Query:
 SELECT ELEMENT [
-Variable [ Name=result ]
+Variable [ Name=$result ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Animals]
   ]
   AS
-  Variable [ Name=test ]
+  Variable [ Name=$test ]
 ]
-LetVariable [ Name=result ]
+Let Variable [ Name=$result ]
   :=
   FieldAccessor [
     FieldAccessor [
       FieldAccessor [
         FieldAccessor [
           FieldAccessor [
-            Variable [ Name=test ]
+            Variable [ Name=$test ]
             Field=class
           ]
           Field=fullClassification
@@ -29,7 +29,7 @@ LetVariable [ Name=result ]
   ]
 Orderby
   FieldAccessor [
-    Variable [ Name=result ]
+    Variable [ Name=$result ]
     Field=id
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.8.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.8.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.8.ast
index b3dd91b..dcf8218 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.8.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.8.ast
@@ -1,21 +1,21 @@
 DataverseUse test
 Query:
 SELECT ELEMENT [
-Variable [ Name=result ]
+Variable [ Name=$result ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Animals]
   ]
   AS
-  Variable [ Name=test ]
+  Variable [ Name=$test ]
 ]
-LetVariable [ Name=result ]
+Let Variable [ Name=$result ]
   :=
   FieldAccessor [
     FieldAccessor [
       FieldAccessor [
         FieldAccessor [
-          Variable [ Name=test ]
+          Variable [ Name=$test ]
           Field=class
         ]
         Field=fullClassification
@@ -26,7 +26,7 @@ LetVariable [ Name=result ]
   ]
 Orderby
   FieldAccessor [
-    Variable [ Name=result ]
+    Variable [ Name=$result ]
     Field=id
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.9.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.9.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.9.ast
index eebd261..c4f4972 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.9.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/access-nested-fields/access-nested-fields.9.ast
@@ -1,20 +1,20 @@
 DataverseUse test
 Query:
 SELECT ELEMENT [
-Variable [ Name=result ]
+Variable [ Name=$result ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Animals]
   ]
   AS
-  Variable [ Name=test ]
+  Variable [ Name=$test ]
 ]
-LetVariable [ Name=result ]
+Let Variable [ Name=$result ]
   :=
   FieldAccessor [
     FieldAccessor [
       FieldAccessor [
-        Variable [ Name=test ]
+        Variable [ Name=$test ]
         Field=class
       ]
       Field=fullClassification
@@ -23,7 +23,7 @@ LetVariable [ Name=result ]
   ]
 Orderby
   FieldAccessor [
-    Variable [ Name=result ]
+    Variable [ Name=$result ]
     Field=id
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/expFieldName/expFieldName.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/expFieldName/expFieldName.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/expFieldName/expFieldName.3.ast
index c13fcb9..b688023 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/expFieldName/expFieldName.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/expFieldName/expFieldName.3.ast
@@ -3,7 +3,7 @@ Query:
 SELECT ELEMENT [
 RecordConstructor [
   (
-    Variable [ Name=x ]
+    Variable [ Name=$x ]
     :
     LiteralExpr [LONG] [1]
   )
@@ -14,5 +14,5 @@ FROM [  OrderedListConstructor [
     LiteralExpr [STRING] [field2]
   ]
   AS
-  Variable [ Name=x ]
+  Variable [ Name=$x ]
 ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/field-access-on-open-field/field-access-on-open-field.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/field-access-on-open-field/field-access-on-open-field.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/field-access-on-open-field/field-access-on-open-field.3.ast
index f429567..5d42e18 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/field-access-on-open-field/field-access-on-open-field.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/field-access-on-open-field/field-access-on-open-field.3.ast
@@ -2,7 +2,7 @@ DataverseUse test
 Query:
 SELECT ELEMENT [
 FieldAccessor [
-  Variable [ Name=a ]
+  Variable [ Name=$a ]
   Field=zip
 ]
 ]
@@ -10,11 +10,11 @@ FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [testds]
   ]
   AS
-  Variable [ Name=l ]
+  Variable [ Name=$l ]
 ]
-LetVariable [ Name=a ]
+Let Variable [ Name=$a ]
   :=
   FieldAccessor [
-    Variable [ Name=l ]
+    Variable [ Name=$l ]
     Field=address
   ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-field-value/highly-nested-closed/highly-nested-open.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-field-value/highly-nested-closed/highly-nested-open.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-field-value/highly-nested-closed/highly-nested-open.3.ast
index 6e63c7e..ae7ba39 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-field-value/highly-nested-closed/highly-nested-open.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-field-value/highly-nested-closed/highly-nested-open.3.ast
@@ -1,23 +1,23 @@
 DataverseUse test
 Query:
 SELECT ELEMENT [
-Variable [ Name=result ]
+Variable [ Name=$result ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Animals]
   ]
   AS
-  Variable [ Name=test ]
+  Variable [ Name=$test ]
 ]
-LetVariable [ Name=result ]
+Let Variable [ Name=$result ]
   :=
   FunctionCall test.get-record-field-value@2[
-    Variable [ Name=test ]
+    Variable [ Name=$test ]
     LiteralExpr [STRING] [class]
   ]
 Orderby
   FieldAccessor [
-    Variable [ Name=result ]
+    Variable [ Name=$result ]
     Field=id
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-field-value/highly-nested-mixed/highly-nested-mixed.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-field-value/highly-nested-mixed/highly-nested-mixed.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-field-value/highly-nested-mixed/highly-nested-mixed.3.ast
index 6e63c7e..ae7ba39 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-field-value/highly-nested-mixed/highly-nested-mixed.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-field-value/highly-nested-mixed/highly-nested-mixed.3.ast
@@ -1,23 +1,23 @@
 DataverseUse test
 Query:
 SELECT ELEMENT [
-Variable [ Name=result ]
+Variable [ Name=$result ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Animals]
   ]
   AS
-  Variable [ Name=test ]
+  Variable [ Name=$test ]
 ]
-LetVariable [ Name=result ]
+Let Variable [ Name=$result ]
   :=
   FunctionCall test.get-record-field-value@2[
-    Variable [ Name=test ]
+    Variable [ Name=$test ]
     LiteralExpr [STRING] [class]
   ]
 Orderby
   FieldAccessor [
-    Variable [ Name=result ]
+    Variable [ Name=$result ]
     Field=id
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-field-value/highly-nested-open/highly-nested-open.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-field-value/highly-nested-open/highly-nested-open.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-field-value/highly-nested-open/highly-nested-open.3.ast
index 6e63c7e..ae7ba39 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-field-value/highly-nested-open/highly-nested-open.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-field-value/highly-nested-open/highly-nested-open.3.ast
@@ -1,23 +1,23 @@
 DataverseUse test
 Query:
 SELECT ELEMENT [
-Variable [ Name=result ]
+Variable [ Name=$result ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Animals]
   ]
   AS
-  Variable [ Name=test ]
+  Variable [ Name=$test ]
 ]
-LetVariable [ Name=result ]
+Let Variable [ Name=$result ]
   :=
   FunctionCall test.get-record-field-value@2[
-    Variable [ Name=test ]
+    Variable [ Name=$test ]
     LiteralExpr [STRING] [class]
   ]
 Orderby
   FieldAccessor [
-    Variable [ Name=result ]
+    Variable [ Name=$result ]
     Field=id
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-field-value/tiny-social-example/tiny-social-example.4.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-field-value/tiny-social-example/tiny-social-example.4.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-field-value/tiny-social-example/tiny-social-example.4.ast
index 5d8ed8c..ca6eb96 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-field-value/tiny-social-example/tiny-social-example.4.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-field-value/tiny-social-example/tiny-social-example.4.ast
@@ -1,39 +1,39 @@
 DataverseUse TinySocial
 Query:
 SELECT ELEMENT [
-Variable [ Name=result ]
+Variable [ Name=$result ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [TweetMessages]
   ]
   AS
-  Variable [ Name=r ]
+  Variable [ Name=$r ]
 ,
   FunctionCall TinySocial.get-record-fields@1[
-    Variable [ Name=r ]
+    Variable [ Name=$r ]
   ]
   AS
-  Variable [ Name=f ]
+  Variable [ Name=$f ]
 ]
-LetVariable [ Name=result ]
+Let Variable [ Name=$result ]
   :=
   FunctionCall TinySocial.get-record-field-value@2[
-    Variable [ Name=r ]
+    Variable [ Name=$r ]
     FieldAccessor [
-      Variable [ Name=f ]
+      Variable [ Name=$f ]
       Field=field-name
     ]
   ]
 Where
   OperatorExpr [
     FieldAccessor [
-      Variable [ Name=f ]
+      Variable [ Name=$f ]
       Field=field-type
     ]
     =
     LiteralExpr [STRING] [STRING]
   ]
 Orderby
-  Variable [ Name=result ]
+  Variable [ Name=$result ]
   ASC
 

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.4.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.4.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.4.ast
index bed8129..7ff030a 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.4.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.4.ast
@@ -2,19 +2,19 @@ DataverseUse TinySocial
 Query:
 SELECT ELEMENT [
 FunctionCall TinySocial.get-record-fields@1[
-  Variable [ Name=user ]
+  Variable [ Name=$user ]
 ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [FacebookUsersAlternate]
   ]
   AS
-  Variable [ Name=user ]
+  Variable [ Name=$user ]
 ]
 Where
   OperatorExpr [
     FieldAccessor [
-      Variable [ Name=user ]
+      Variable [ Name=$user ]
       Field=id
     ]
     =

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.5.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.5.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.5.ast
index 1be4993..dea8797 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.5.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.5.ast
@@ -2,18 +2,18 @@ DataverseUse TinySocial
 Query:
 SELECT ELEMENT [
 FunctionCall TinySocial.get-record-fields@1[
-  Variable [ Name=r ]
+  Variable [ Name=$r ]
 ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [FacebookUsersAlternate]
   ]
   AS
-  Variable [ Name=r ]
+  Variable [ Name=$r ]
 ]
 Orderby
   FieldAccessor [
-    Variable [ Name=r ]
+    Variable [ Name=$r ]
     Field=id
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.6.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.6.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.6.ast
index 5eb193e..d79e7dd 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.6.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.6.ast
@@ -2,18 +2,18 @@ DataverseUse TinySocial
 Query:
 SELECT ELEMENT [
 FunctionCall TinySocial.get-record-fields@1[
-  Variable [ Name=r ]
+  Variable [ Name=$r ]
 ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [FacebookMessagesAlternate]
   ]
   AS
-  Variable [ Name=r ]
+  Variable [ Name=$r ]
 ]
 Orderby
   FieldAccessor [
-    Variable [ Name=r ]
+    Variable [ Name=$r ]
     Field=message-id
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.7.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.7.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.7.ast
index 47fd6ad..a665395 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.7.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.7.ast
@@ -2,18 +2,18 @@ DataverseUse TinySocial
 Query:
 SELECT ELEMENT [
 FunctionCall TinySocial.get-record-fields@1[
-  Variable [ Name=r ]
+  Variable [ Name=$r ]
 ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [TwitterUsersAlternate]
   ]
   AS
-  Variable [ Name=r ]
+  Variable [ Name=$r ]
 ]
 Orderby
   FieldAccessor [
-    Variable [ Name=r ]
+    Variable [ Name=$r ]
     Field=screen-name
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.8.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.8.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.8.ast
index 783d5d6..823c7a5 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.8.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.8.ast
@@ -2,18 +2,18 @@ DataverseUse TinySocial
 Query:
 SELECT ELEMENT [
 FunctionCall TinySocial.get-record-fields@1[
-  Variable [ Name=r ]
+  Variable [ Name=$r ]
 ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [TweetMessagesAlternate]
   ]
   AS
-  Variable [ Name=r ]
+  Variable [ Name=$r ]
 ]
 Orderby
   FieldAccessor [
-    Variable [ Name=r ]
+    Variable [ Name=$r ]
     Field=tweetid
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.9.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.9.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.9.ast
index 3fe1794..ee81dc9 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.9.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.9.ast
@@ -5,17 +5,17 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [field-name]
     :
-    Variable [ Name=n ]
+    Variable [ Name=$n ]
   )
   (
     LiteralExpr [STRING] [field-type]
     :
-    Variable [ Name=t ]
+    Variable [ Name=$t ]
   )
   (
     LiteralExpr [STRING] [count]
     :
-    Variable [ Name=count ]
+    Variable [ Name=$count ]
   )
 ]
 ]
@@ -23,39 +23,55 @@ FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [TweetMessagesAlternate]
   ]
   AS
-  Variable [ Name=r ]
+  Variable [ Name=$r ]
 ,
   FunctionCall TinySocial.get-record-fields@1[
-    Variable [ Name=r ]
+    Variable [ Name=$r ]
   ]
   AS
-  Variable [ Name=f ]
+  Variable [ Name=$f ]
 ]
 Groupby
-  Variable [ Name=n ]
+  Variable [ Name=$n ]
   :=
   FieldAccessor [
-    Variable [ Name=f ]
+    Variable [ Name=$f ]
     Field=field-name
   ]
-  Variable [ Name=t ]
+  Variable [ Name=$t ]
   :=
   FieldAccessor [
-    Variable [ Name=f ]
+    Variable [ Name=$f ]
     Field=field-type
   ]
-  With
-  Variable [ Name=r ]
-  Variable [ Name=f ]
+  GROUP AS
+  Variable [ Name=#1 ]
+  (
+  Variable [ Name=$f ]
+   AS f
+  Variable [ Name=$r ]
+   AS r
+  )
 
-LetVariable [ Name=count ]
+Let Variable [ Name=$count ]
   :=
   FunctionCall TinySocial.count@1[
-    Variable [ Name=r ]
+    (
+      SELECT ELEMENT [
+      FieldAccessor [
+        Variable [ Name=#2 ]
+        Field=r
+      ]
+      ]
+      FROM [        Variable [ Name=#1 ]
+        AS
+        Variable [ Name=#2 ]
+      ]
+    )
   ]
 Orderby
-  Variable [ Name=n ]
+  Variable [ Name=$n ]
   ASC
-  Variable [ Name=t ]
+  Variable [ Name=$t ]
   ASC
 

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.4.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.4.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.4.ast
index bed8129..7ff030a 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.4.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.4.ast
@@ -2,19 +2,19 @@ DataverseUse TinySocial
 Query:
 SELECT ELEMENT [
 FunctionCall TinySocial.get-record-fields@1[
-  Variable [ Name=user ]
+  Variable [ Name=$user ]
 ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [FacebookUsersAlternate]
   ]
   AS
-  Variable [ Name=user ]
+  Variable [ Name=$user ]
 ]
 Where
   OperatorExpr [
     FieldAccessor [
-      Variable [ Name=user ]
+      Variable [ Name=$user ]
       Field=id
     ]
     =

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.5.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.5.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.5.ast
index 1be4993..dea8797 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.5.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.5.ast
@@ -2,18 +2,18 @@ DataverseUse TinySocial
 Query:
 SELECT ELEMENT [
 FunctionCall TinySocial.get-record-fields@1[
-  Variable [ Name=r ]
+  Variable [ Name=$r ]
 ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [FacebookUsersAlternate]
   ]
   AS
-  Variable [ Name=r ]
+  Variable [ Name=$r ]
 ]
 Orderby
   FieldAccessor [
-    Variable [ Name=r ]
+    Variable [ Name=$r ]
     Field=id
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.6.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.6.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.6.ast
index 5eb193e..d79e7dd 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.6.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.6.ast
@@ -2,18 +2,18 @@ DataverseUse TinySocial
 Query:
 SELECT ELEMENT [
 FunctionCall TinySocial.get-record-fields@1[
-  Variable [ Name=r ]
+  Variable [ Name=$r ]
 ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [FacebookMessagesAlternate]
   ]
   AS
-  Variable [ Name=r ]
+  Variable [ Name=$r ]
 ]
 Orderby
   FieldAccessor [
-    Variable [ Name=r ]
+    Variable [ Name=$r ]
     Field=message-id
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.7.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.7.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.7.ast
index 47fd6ad..a665395 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.7.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.7.ast
@@ -2,18 +2,18 @@ DataverseUse TinySocial
 Query:
 SELECT ELEMENT [
 FunctionCall TinySocial.get-record-fields@1[
-  Variable [ Name=r ]
+  Variable [ Name=$r ]
 ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [TwitterUsersAlternate]
   ]
   AS
-  Variable [ Name=r ]
+  Variable [ Name=$r ]
 ]
 Orderby
   FieldAccessor [
-    Variable [ Name=r ]
+    Variable [ Name=$r ]
     Field=screen-name
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.8.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.8.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.8.ast
index 783d5d6..823c7a5 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.8.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.8.ast
@@ -2,18 +2,18 @@ DataverseUse TinySocial
 Query:
 SELECT ELEMENT [
 FunctionCall TinySocial.get-record-fields@1[
-  Variable [ Name=r ]
+  Variable [ Name=$r ]
 ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [TweetMessagesAlternate]
   ]
   AS
-  Variable [ Name=r ]
+  Variable [ Name=$r ]
 ]
 Orderby
   FieldAccessor [
-    Variable [ Name=r ]
+    Variable [ Name=$r ]
     Field=tweetid
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.9.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.9.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.9.ast
index 3fe1794..ee81dc9 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.9.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-lists/tiny-social-example-only-lists.9.ast
@@ -5,17 +5,17 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [field-name]
     :
-    Variable [ Name=n ]
+    Variable [ Name=$n ]
   )
   (
     LiteralExpr [STRING] [field-type]
     :
-    Variable [ Name=t ]
+    Variable [ Name=$t ]
   )
   (
     LiteralExpr [STRING] [count]
     :
-    Variable [ Name=count ]
+    Variable [ Name=$count ]
   )
 ]
 ]
@@ -23,39 +23,55 @@ FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [TweetMessagesAlternate]
   ]
   AS
-  Variable [ Name=r ]
+  Variable [ Name=$r ]
 ,
   FunctionCall TinySocial.get-record-fields@1[
-    Variable [ Name=r ]
+    Variable [ Name=$r ]
   ]
   AS
-  Variable [ Name=f ]
+  Variable [ Name=$f ]
 ]
 Groupby
-  Variable [ Name=n ]
+  Variable [ Name=$n ]
   :=
   FieldAccessor [
-    Variable [ Name=f ]
+    Variable [ Name=$f ]
     Field=field-name
   ]
-  Variable [ Name=t ]
+  Variable [ Name=$t ]
   :=
   FieldAccessor [
-    Variable [ Name=f ]
+    Variable [ Name=$f ]
     Field=field-type
   ]
-  With
-  Variable [ Name=r ]
-  Variable [ Name=f ]
+  GROUP AS
+  Variable [ Name=#1 ]
+  (
+  Variable [ Name=$f ]
+   AS f
+  Variable [ Name=$r ]
+   AS r
+  )
 
-LetVariable [ Name=count ]
+Let Variable [ Name=$count ]
   :=
   FunctionCall TinySocial.count@1[
-    Variable [ Name=r ]
+    (
+      SELECT ELEMENT [
+      FieldAccessor [
+        Variable [ Name=#2 ]
+        Field=r
+      ]
+      ]
+      FROM [        Variable [ Name=#1 ]
+        AS
+        Variable [ Name=#2 ]
+      ]
+    )
   ]
 Orderby
-  Variable [ Name=n ]
+  Variable [ Name=$n ]
   ASC
-  Variable [ Name=t ]
+  Variable [ Name=$t ]
   ASC
 

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.4.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.4.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.4.ast
index bed8129..7ff030a 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.4.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.4.ast
@@ -2,19 +2,19 @@ DataverseUse TinySocial
 Query:
 SELECT ELEMENT [
 FunctionCall TinySocial.get-record-fields@1[
-  Variable [ Name=user ]
+  Variable [ Name=$user ]
 ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [FacebookUsersAlternate]
   ]
   AS
-  Variable [ Name=user ]
+  Variable [ Name=$user ]
 ]
 Where
   OperatorExpr [
     FieldAccessor [
-      Variable [ Name=user ]
+      Variable [ Name=$user ]
       Field=id
     ]
     =

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.5.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.5.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.5.ast
index 1be4993..dea8797 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.5.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.5.ast
@@ -2,18 +2,18 @@ DataverseUse TinySocial
 Query:
 SELECT ELEMENT [
 FunctionCall TinySocial.get-record-fields@1[
-  Variable [ Name=r ]
+  Variable [ Name=$r ]
 ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [FacebookUsersAlternate]
   ]
   AS
-  Variable [ Name=r ]
+  Variable [ Name=$r ]
 ]
 Orderby
   FieldAccessor [
-    Variable [ Name=r ]
+    Variable [ Name=$r ]
     Field=id
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.6.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.6.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.6.ast
index 5eb193e..d79e7dd 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.6.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.6.ast
@@ -2,18 +2,18 @@ DataverseUse TinySocial
 Query:
 SELECT ELEMENT [
 FunctionCall TinySocial.get-record-fields@1[
-  Variable [ Name=r ]
+  Variable [ Name=$r ]
 ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [FacebookMessagesAlternate]
   ]
   AS
-  Variable [ Name=r ]
+  Variable [ Name=$r ]
 ]
 Orderby
   FieldAccessor [
-    Variable [ Name=r ]
+    Variable [ Name=$r ]
     Field=message-id
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.7.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.7.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.7.ast
index 47fd6ad..a665395 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.7.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.7.ast
@@ -2,18 +2,18 @@ DataverseUse TinySocial
 Query:
 SELECT ELEMENT [
 FunctionCall TinySocial.get-record-fields@1[
-  Variable [ Name=r ]
+  Variable [ Name=$r ]
 ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [TwitterUsersAlternate]
   ]
   AS
-  Variable [ Name=r ]
+  Variable [ Name=$r ]
 ]
 Orderby
   FieldAccessor [
-    Variable [ Name=r ]
+    Variable [ Name=$r ]
     Field=screen-name
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.8.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.8.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.8.ast
index 783d5d6..823c7a5 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.8.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.8.ast
@@ -2,18 +2,18 @@ DataverseUse TinySocial
 Query:
 SELECT ELEMENT [
 FunctionCall TinySocial.get-record-fields@1[
-  Variable [ Name=r ]
+  Variable [ Name=$r ]
 ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [TweetMessagesAlternate]
   ]
   AS
-  Variable [ Name=r ]
+  Variable [ Name=$r ]
 ]
 Orderby
   FieldAccessor [
-    Variable [ Name=r ]
+    Variable [ Name=$r ]
     Field=tweetid
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.9.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.9.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.9.ast
index 3fe1794..ee81dc9 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.9.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/get-record-fields/tiny-social-example-only-records/tiny-social-example-only-records.9.ast
@@ -5,17 +5,17 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [field-name]
     :
-    Variable [ Name=n ]
+    Variable [ Name=$n ]
   )
   (
     LiteralExpr [STRING] [field-type]
     :
-    Variable [ Name=t ]
+    Variable [ Name=$t ]
   )
   (
     LiteralExpr [STRING] [count]
     :
-    Variable [ Name=count ]
+    Variable [ Name=$count ]
   )
 ]
 ]
@@ -23,39 +23,55 @@ FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [TweetMessagesAlternate]
   ]
   AS
-  Variable [ Name=r ]
+  Variable [ Name=$r ]
 ,
   FunctionCall TinySocial.get-record-fields@1[
-    Variable [ Name=r ]
+    Variable [ Name=$r ]
   ]
   AS
-  Variable [ Name=f ]
+  Variable [ Name=$f ]
 ]
 Groupby
-  Variable [ Name=n ]
+  Variable [ Name=$n ]
   :=
   FieldAccessor [
-    Variable [ Name=f ]
+    Variable [ Name=$f ]
     Field=field-name
   ]
-  Variable [ Name=t ]
+  Variable [ Name=$t ]
   :=
   FieldAccessor [
-    Variable [ Name=f ]
+    Variable [ Name=$f ]
     Field=field-type
   ]
-  With
-  Variable [ Name=r ]
-  Variable [ Name=f ]
+  GROUP AS
+  Variable [ Name=#1 ]
+  (
+  Variable [ Name=$f ]
+   AS f
+  Variable [ Name=$r ]
+   AS r
+  )
 
-LetVariable [ Name=count ]
+Let Variable [ Name=$count ]
   :=
   FunctionCall TinySocial.count@1[
-    Variable [ Name=r ]
+    (
+      SELECT ELEMENT [
+      FieldAccessor [
+        Variable [ Name=#2 ]
+        Field=r
+      ]
+      ]
+      FROM [        Variable [ Name=#1 ]
+        AS
+        Variable [ Name=#2 ]
+      ]
+    )
   ]
 Orderby
-  Variable [ Name=n ]
+  Variable [ Name=$n ]
   ASC
-  Variable [ Name=t ]
+  Variable [ Name=$t ]
   ASC
 

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/open-closed-fieldname-conflict_issue173/open-closed-fieldname-conflict_issue173.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/open-closed-fieldname-conflict_issue173/open-closed-fieldname-conflict_issue173.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/open-closed-fieldname-conflict_issue173/open-closed-fieldname-conflict_issue173.3.ast
index 0fa6075..87409c1 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/open-closed-fieldname-conflict_issue173/open-closed-fieldname-conflict_issue173.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/open-closed-fieldname-conflict_issue173/open-closed-fieldname-conflict_issue173.3.ast
@@ -4,7 +4,7 @@ SELECT ELEMENT [
 RecordConstructor [
   (
     FieldAccessor [
-      Variable [ Name=x ]
+      Variable [ Name=$x ]
       Field=fname
     ]
     :
@@ -23,5 +23,5 @@ FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [testds]
   ]
   AS
-  Variable [ Name=x ]
+  Variable [ Name=$x ]
 ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/open-open-fieldname-conflict_issue173/open-open-fieldname-conflict_issue173.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/open-open-fieldname-conflict_issue173/open-open-fieldname-conflict_issue173.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/open-open-fieldname-conflict_issue173/open-open-fieldname-conflict_issue173.3.ast
index 6509c79..a9424e7 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/open-open-fieldname-conflict_issue173/open-open-fieldname-conflict_issue173.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/records/open-open-fieldname-conflict_issue173/open-open-fieldname-conflict_issue173.3.ast
@@ -4,7 +4,7 @@ SELECT ELEMENT [
 RecordConstructor [
   (
     FieldAccessor [
-      Variable [ Name=x ]
+      Variable [ Name=$x ]
       Field=fname1
     ]
     :
@@ -12,7 +12,7 @@ RecordConstructor [
   )
   (
     FieldAccessor [
-      Variable [ Name=x ]
+      Variable [ Name=$x ]
       Field=fname2
     ]
     :
@@ -24,5 +24,5 @@ FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [testds]
   ]
   AS
-  Variable [ Name=x ]
+  Variable [ Name=$x ]
 ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/10/10.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/10/10.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/10/10.3.ast
index ddad342..5cf4e83 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/10/10.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/10/10.3.ast
@@ -1,17 +1,17 @@
 DataverseUse test
 Query:
 SELECT ELEMENT [
-Variable [ Name=paper ]
+Variable [ Name=$paper ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP1]
   ]
   AS
-  Variable [ Name=paper ]
+  Variable [ Name=$paper ]
 ]
 Orderby
   FieldAccessor [
-    Variable [ Name=paper ]
+    Variable [ Name=$paper ]
     Field=id
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/20/20.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/20/20.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/20/20.3.ast
index 7f1360c..aa83cd5 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/20/20.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/20/20.3.ast
@@ -1,17 +1,17 @@
 DataverseUse test
 Query:
 SELECT ELEMENT [
-Variable [ Name=paper ]
+Variable [ Name=$paper ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLPadm]
   ]
   AS
-  Variable [ Name=paper ]
+  Variable [ Name=$paper ]
 ]
 Orderby
   FieldAccessor [
-    Variable [ Name=paper ]
+    Variable [ Name=$paper ]
     Field=id
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/30/30.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/30/30.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/30/30.3.ast
index f71c9bc..6dcdc5e 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/30/30.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/30/30.3.ast
@@ -1,11 +1,11 @@
 DataverseUse test
 Query:
 SELECT ELEMENT [
-Variable [ Name=paper ]
+Variable [ Name=$paper ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLPsplits]
   ]
   AS
-  Variable [ Name=paper ]
+  Variable [ Name=$paper ]
 ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/alltypes_01/alltypes_01.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/alltypes_01/alltypes_01.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/alltypes_01/alltypes_01.3.ast
index d119287..bbf821c 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/alltypes_01/alltypes_01.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/alltypes_01/alltypes_01.3.ast
@@ -1,11 +1,11 @@
 DataverseUse test
 Query:
 SELECT ELEMENT [
-Variable [ Name=a ]
+Variable [ Name=$a ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [All]
   ]
   AS
-  Variable [ Name=a ]
+  Variable [ Name=$a ]
 ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/alltypes_02/alltypes_02.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/alltypes_02/alltypes_02.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/alltypes_02/alltypes_02.3.ast
index d119287..bbf821c 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/alltypes_02/alltypes_02.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/alltypes_02/alltypes_02.3.ast
@@ -1,11 +1,11 @@
 DataverseUse test
 Query:
 SELECT ELEMENT [
-Variable [ Name=a ]
+Variable [ Name=$a ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [All]
   ]
   AS
-  Variable [ Name=a ]
+  Variable [ Name=$a ]
 ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/invalid-scan-syntax/invalid-scan-syntax.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/invalid-scan-syntax/invalid-scan-syntax.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/invalid-scan-syntax/invalid-scan-syntax.3.ast
index 2a6caa5..ab80da6 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/invalid-scan-syntax/invalid-scan-syntax.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/invalid-scan-syntax/invalid-scan-syntax.3.ast
@@ -1,11 +1,11 @@
 DataverseUse test
 Query:
 SELECT ELEMENT [
-Variable [ Name=t ]
+Variable [ Name=$t ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [test.Office]
   ]
   AS
-  Variable [ Name=t ]
+  Variable [ Name=$t ]
 ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/issue238_query_1/issue238_query_1.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/issue238_query_1/issue238_query_1.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/issue238_query_1/issue238_query_1.3.ast
index 7f1360c..aa83cd5 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/issue238_query_1/issue238_query_1.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/issue238_query_1/issue238_query_1.3.ast
@@ -1,17 +1,17 @@
 DataverseUse test
 Query:
 SELECT ELEMENT [
-Variable [ Name=paper ]
+Variable [ Name=$paper ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLPadm]
   ]
   AS
-  Variable [ Name=paper ]
+  Variable [ Name=$paper ]
 ]
 Orderby
   FieldAccessor [
-    Variable [ Name=paper ]
+    Variable [ Name=$paper ]
     Field=id
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/issue238_query_2/issue238_query_2.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/issue238_query_2/issue238_query_2.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/issue238_query_2/issue238_query_2.3.ast
index 7f1360c..aa83cd5 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/issue238_query_2/issue238_query_2.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/issue238_query_2/issue238_query_2.3.ast
@@ -1,17 +1,17 @@
 DataverseUse test
 Query:
 SELECT ELEMENT [
-Variable [ Name=paper ]
+Variable [ Name=$paper ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLPadm]
   ]
   AS
-  Variable [ Name=paper ]
+  Variable [ Name=$paper ]
 ]
 Orderby
   FieldAccessor [
-    Variable [ Name=paper ]
+    Variable [ Name=$paper ]
     Field=id
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/numeric_types_01/numeric_types_01.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/numeric_types_01/numeric_types_01.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/numeric_types_01/numeric_types_01.3.ast
index 78fb696..10710a1 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/numeric_types_01/numeric_types_01.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/numeric_types_01/numeric_types_01.3.ast
@@ -1,11 +1,11 @@
 DataverseUse test
 Query:
 SELECT ELEMENT [
-Variable [ Name=a ]
+Variable [ Name=$a ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Numeric]
   ]
   AS
-  Variable [ Name=a ]
+  Variable [ Name=$a ]
 ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/spatial_types_01/spatial_types_01.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/spatial_types_01/spatial_types_01.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/spatial_types_01/spatial_types_01.3.ast
index a9aa43f..0b11a5b 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/spatial_types_01/spatial_types_01.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/spatial_types_01/spatial_types_01.3.ast
@@ -1,11 +1,11 @@
 DataverseUse test
 Query:
 SELECT ELEMENT [
-Variable [ Name=a ]
+Variable [ Name=$a ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Spatial]
   ]
   AS
-  Variable [ Name=a ]
+  Variable [ Name=$a ]
 ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/temp_types_01/temp_types_01.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/temp_types_01/temp_types_01.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/temp_types_01/temp_types_01.3.ast
index 469457b..9b47058 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/temp_types_01/temp_types_01.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/scan/temp_types_01/temp_types_01.3.ast
@@ -1,11 +1,11 @@
 DataverseUse test
 Query:
 SELECT ELEMENT [
-Variable [ Name=a ]
+Variable [ Name=$a ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Temp]
   ]
   AS
-  Variable [ Name=a ]
+  Variable [ Name=$a ]
 ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/semistructured/count-nullable/count-nullable.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/semistructured/count-nullable/count-nullable.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/semistructured/count-nullable/count-nullable.3.ast
index bc36184..5fc4078 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/semistructured/count-nullable/count-nullable.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/semistructured/count-nullable/count-nullable.3.ast
@@ -5,13 +5,24 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [custage]
     :
-    Variable [ Name=age ]
+    Variable [ Name=$age ]
   )
   (
     LiteralExpr [STRING] [count]
     :
     FunctionCall test.count@1[
-      Variable [ Name=c ]
+      (
+        SELECT ELEMENT [
+        FieldAccessor [
+          Variable [ Name=#2 ]
+          Field=c
+        ]
+        ]
+        FROM [          Variable [ Name=#1 ]
+          AS
+          Variable [ Name=#2 ]
+        ]
+      )
     ]
   )
 ]
@@ -20,19 +31,23 @@ FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Customers]
   ]
   AS
-  Variable [ Name=c ]
+  Variable [ Name=$c ]
 ]
 Groupby
-  Variable [ Name=age ]
+  Variable [ Name=$age ]
   :=
   FieldAccessor [
-    Variable [ Name=c ]
+    Variable [ Name=$c ]
     Field=age
   ]
-  With
-  Variable [ Name=c ]
+  GROUP AS
+  Variable [ Name=#1 ]
+  (
+  Variable [ Name=$c ]
+   AS c
+  )
 
 Orderby
-  Variable [ Name=age ]
+  Variable [ Name=$age ]
   ASC
 

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/semistructured/cust-filter/cust-filter.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/semistructured/cust-filter/cust-filter.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/semistructured/cust-filter/cust-filter.3.ast
index 32003f3..5055704 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/semistructured/cust-filter/cust-filter.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/semistructured/cust-filter/cust-filter.3.ast
@@ -6,7 +6,7 @@ RecordConstructor [
     LiteralExpr [STRING] [custname]
     :
     FieldAccessor [
-      Variable [ Name=c ]
+      Variable [ Name=$c ]
       Field=name
     ]
   )
@@ -14,7 +14,7 @@ RecordConstructor [
     LiteralExpr [STRING] [custage]
     :
     FieldAccessor [
-      Variable [ Name=c ]
+      Variable [ Name=$c ]
       Field=age
     ]
   )
@@ -24,12 +24,12 @@ FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Customers]
   ]
   AS
-  Variable [ Name=c ]
+  Variable [ Name=$c ]
 ]
 Where
   OperatorExpr [
     FieldAccessor [
-      Variable [ Name=c ]
+      Variable [ Name=$c ]
       Field=age
     ]
     <
@@ -37,7 +37,7 @@ Where
   ]
 Orderby
   FieldAccessor [
-    Variable [ Name=c ]
+    Variable [ Name=$c ]
     Field=cid
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/semistructured/has-param1/has-param1.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/semistructured/has-param1/has-param1.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/semistructured/has-param1/has-param1.3.ast
index b8827d6..29d89dd 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/semistructured/has-param1/has-param1.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/semistructured/has-param1/has-param1.3.ast
@@ -2,26 +2,26 @@ DataverseUse test
 Set import-private-functions=true
 Query:
 SELECT ELEMENT [
-Variable [ Name=o ]
+Variable [ Name=$o ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Orders]
   ]
   AS
-  Variable [ Name=o ]
+  Variable [ Name=$o ]
 ]
 Where
   FunctionCall test.not@1[
     FunctionCall test.is-null@1[
       FieldAccessor [
-        Variable [ Name=o ]
+        Variable [ Name=$o ]
         Field=param1
       ]
     ]
   ]
 Orderby
   FieldAccessor [
-    Variable [ Name=o ]
+    Variable [ Name=$o ]
     Field=oid
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/similarity/edit-distance-check_ints/edit-distance-check_ints.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/similarity/edit-distance-check_ints/edit-distance-check_ints.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/similarity/edit-distance-check_ints/edit-distance-check_ints.3.ast
index 441a66b..c3dde01 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/similarity/edit-distance-check_ints/edit-distance-check_ints.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/similarity/edit-distance-check_ints/edit-distance-check_ints.3.ast
@@ -1,6 +1,6 @@
 DataverseUse test
 Query:
-LetVariable [ Name=a ]
+Let Variable [ Name=$a ]
   :=
   OrderedListConstructor [
     LiteralExpr [LONG] [1]
@@ -11,7 +11,7 @@ LetVariable [ Name=a ]
     LiteralExpr [LONG] [6]
     LiteralExpr [LONG] [7]
   ]
-LetVariable [ Name=b ]
+Let Variable [ Name=$b ]
   :=
   OrderedListConstructor [
     LiteralExpr [LONG] [1]
@@ -21,34 +21,34 @@ LetVariable [ Name=b ]
     LiteralExpr [LONG] [7]
     LiteralExpr [LONG] [8]
   ]
-LetVariable [ Name=results ]
+Let Variable [ Name=$results ]
   :=
   OrderedListConstructor [
     FunctionCall test.edit-distance-check@3[
-      Variable [ Name=a ]
-      Variable [ Name=b ]
+      Variable [ Name=$a ]
+      Variable [ Name=$b ]
       LiteralExpr [LONG] [3]
     ]
     FunctionCall test.edit-distance-check@3[
-      Variable [ Name=b ]
-      Variable [ Name=a ]
+      Variable [ Name=$b ]
+      Variable [ Name=$a ]
       LiteralExpr [LONG] [3]
     ]
     FunctionCall test.edit-distance-check@3[
-      Variable [ Name=a ]
-      Variable [ Name=b ]
+      Variable [ Name=$a ]
+      Variable [ Name=$b ]
       LiteralExpr [LONG] [2]
     ]
     FunctionCall test.edit-distance-check@3[
-      Variable [ Name=b ]
-      Variable [ Name=a ]
+      Variable [ Name=$b ]
+      Variable [ Name=$a ]
       LiteralExpr [LONG] [2]
     ]
   ]
 SELECT ELEMENT [
-Variable [ Name=i ]
+Variable [ Name=$i ]
 ]
-FROM [  Variable [ Name=results ]
+FROM [  Variable [ Name=$results ]
   AS
-  Variable [ Name=i ]
+  Variable [ Name=$i ]
 ]



Mime
View raw message