asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From buyin...@apache.org
Subject [04/51] [partial] incubator-asterixdb git commit: ASTERIXDB-1226: implement SQL++ core group-by semantics and syntatic sugars.
Date Mon, 28 Mar 2016 20:18:31 GMT
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q07_volume_shipping/q07_volume_shipping.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q07_volume_shipping/q07_volume_shipping.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q07_volume_shipping/q07_volume_shipping.3.ast
index deed492..ac8fbda 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q07_volume_shipping/q07_volume_shipping.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q07_volume_shipping/q07_volume_shipping.3.ast
@@ -7,7 +7,7 @@ FunctionDecl q7_volume_shipping_tmp([]) {
         LiteralExpr [STRING] [supp_nation]
         :
         FieldAccessor [
-          Variable [ Name=n1 ]
+          Variable [ Name=$n1 ]
           Field=n_name
         ]
       )
@@ -15,7 +15,7 @@ FunctionDecl q7_volume_shipping_tmp([]) {
         LiteralExpr [STRING] [cust_nation]
         :
         FieldAccessor [
-          Variable [ Name=n2 ]
+          Variable [ Name=$n2 ]
           Field=n_name
         ]
       )
@@ -23,7 +23,7 @@ FunctionDecl q7_volume_shipping_tmp([]) {
         LiteralExpr [STRING] [s_nationkey]
         :
         FieldAccessor [
-          Variable [ Name=n1 ]
+          Variable [ Name=$n1 ]
           Field=n_nationkey
         ]
       )
@@ -31,25 +31,25 @@ FunctionDecl q7_volume_shipping_tmp([]) {
         LiteralExpr [STRING] [c_nationkey]
         :
         FieldAccessor [
-          Variable [ Name=n2 ]
+          Variable [ Name=$n2 ]
           Field=n_nationkey
         ]
       )
     ]
     ]
-    FROM [      Variable [ Name=Nation ]
+    FROM [      Variable [ Name=$Nation ]
       AS
-      Variable [ Name=n1 ]
+      Variable [ Name=$n1 ]
 ,
-      Variable [ Name=Nation ]
+      Variable [ Name=$Nation ]
       AS
-      Variable [ Name=n2 ]
+      Variable [ Name=$n2 ]
     ]
     Where
       OperatorExpr [
         OperatorExpr [
           FieldAccessor [
-            Variable [ Name=n2 ]
+            Variable [ Name=$n2 ]
             Field=n_name
           ]
           =
@@ -58,7 +58,7 @@ FunctionDecl q7_volume_shipping_tmp([]) {
         or
         OperatorExpr [
           FieldAccessor [
-            Variable [ Name=n1 ]
+            Variable [ Name=$n1 ]
             Field=n_name
           ]
           =
@@ -74,22 +74,22 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [supp_nation]
     :
-    Variable [ Name=supp_nation ]
+    Variable [ Name=$supp_nation ]
   )
   (
     LiteralExpr [STRING] [cust_nation]
     :
-    Variable [ Name=cust_nation ]
+    Variable [ Name=$cust_nation ]
   )
   (
     LiteralExpr [STRING] [l_year]
     :
-    Variable [ Name=l_year ]
+    Variable [ Name=$l_year ]
   )
   (
     LiteralExpr [STRING] [revenue]
     :
-    Variable [ Name=revenue ]
+    Variable [ Name=$revenue ]
   )
 ]
 ]
@@ -100,7 +100,7 @@ FROM [  (
         LiteralExpr [STRING] [l_shipdate]
         :
         FieldAccessor [
-          Variable [ Name=loc ]
+          Variable [ Name=$loc ]
           Field=l_shipdate
         ]
       )
@@ -108,7 +108,7 @@ FROM [  (
         LiteralExpr [STRING] [l_extendedprice]
         :
         FieldAccessor [
-          Variable [ Name=loc ]
+          Variable [ Name=$loc ]
           Field=l_extendedprice
         ]
       )
@@ -116,7 +116,7 @@ FROM [  (
         LiteralExpr [STRING] [l_discount]
         :
         FieldAccessor [
-          Variable [ Name=loc ]
+          Variable [ Name=$loc ]
           Field=l_discount
         ]
       )
@@ -124,7 +124,7 @@ FROM [  (
         LiteralExpr [STRING] [c_nationkey]
         :
         FieldAccessor [
-          Variable [ Name=loc ]
+          Variable [ Name=$loc ]
           Field=c_nationkey
         ]
       )
@@ -132,7 +132,7 @@ FROM [  (
         LiteralExpr [STRING] [s_nationkey]
         :
         FieldAccessor [
-          Variable [ Name=s ]
+          Variable [ Name=$s ]
           Field=s_nationkey
         ]
       )
@@ -145,7 +145,7 @@ FROM [  (
             LiteralExpr [STRING] [l_shipdate]
             :
             FieldAccessor [
-              Variable [ Name=lo ]
+              Variable [ Name=$lo ]
               Field=l_shipdate
             ]
           )
@@ -153,7 +153,7 @@ FROM [  (
             LiteralExpr [STRING] [l_extendedprice]
             :
             FieldAccessor [
-              Variable [ Name=lo ]
+              Variable [ Name=$lo ]
               Field=l_extendedprice
             ]
           )
@@ -161,7 +161,7 @@ FROM [  (
             LiteralExpr [STRING] [l_discount]
             :
             FieldAccessor [
-              Variable [ Name=lo ]
+              Variable [ Name=$lo ]
               Field=l_discount
             ]
           )
@@ -169,7 +169,7 @@ FROM [  (
             LiteralExpr [STRING] [l_suppkey]
             :
             FieldAccessor [
-              Variable [ Name=lo ]
+              Variable [ Name=$lo ]
               Field=l_suppkey
             ]
           )
@@ -177,7 +177,7 @@ FROM [  (
             LiteralExpr [STRING] [c_nationkey]
             :
             FieldAccessor [
-              Variable [ Name=c ]
+              Variable [ Name=$c ]
               Field=c_nationkey
             ]
           )
@@ -190,7 +190,7 @@ FROM [  (
                 LiteralExpr [STRING] [l_shipdate]
                 :
                 FieldAccessor [
-                  Variable [ Name=l ]
+                  Variable [ Name=$l ]
                   Field=l_shipdate
                 ]
               )
@@ -198,7 +198,7 @@ FROM [  (
                 LiteralExpr [STRING] [l_extendedprice]
                 :
                 FieldAccessor [
-                  Variable [ Name=l ]
+                  Variable [ Name=$l ]
                   Field=l_extendedprice
                 ]
               )
@@ -206,7 +206,7 @@ FROM [  (
                 LiteralExpr [STRING] [l_discount]
                 :
                 FieldAccessor [
-                  Variable [ Name=l ]
+                  Variable [ Name=$l ]
                   Field=l_discount
                 ]
               )
@@ -214,7 +214,7 @@ FROM [  (
                 LiteralExpr [STRING] [l_suppkey]
                 :
                 FieldAccessor [
-                  Variable [ Name=l ]
+                  Variable [ Name=$l ]
                   Field=l_suppkey
                 ]
               )
@@ -222,7 +222,7 @@ FROM [  (
                 LiteralExpr [STRING] [o_custkey]
                 :
                 FieldAccessor [
-                  Variable [ Name=o ]
+                  Variable [ Name=$o ]
                   Field=o_custkey
                 ]
               )
@@ -232,31 +232,31 @@ FROM [  (
                 LiteralExpr [STRING] [LineItem]
               ]
               AS
-              Variable [ Name=l ]
+              Variable [ Name=$l ]
 ,
               FunctionCall Metadata.dataset@1[
                 LiteralExpr [STRING] [Orders]
               ]
               AS
-              Variable [ Name=o ]
+              Variable [ Name=$o ]
             ]
             Where
               OperatorExpr [
                 OperatorExpr [
                   FieldAccessor [
-                    Variable [ Name=o ]
+                    Variable [ Name=$o ]
                     Field=o_orderkey
                   ]
                   =
                   FieldAccessor [
-                    Variable [ Name=l ]
+                    Variable [ Name=$l ]
                     Field=l_orderkey
                   ]
                 ]
                 and
                 OperatorExpr [
                   FieldAccessor [
-                    Variable [ Name=l ]
+                    Variable [ Name=$l ]
                     Field=l_shipdate
                   ]
                   >=
@@ -265,7 +265,7 @@ FROM [  (
                 and
                 OperatorExpr [
                   FieldAccessor [
-                    Variable [ Name=l ]
+                    Variable [ Name=$l ]
                     Field=l_shipdate
                   ]
                   <=
@@ -274,62 +274,62 @@ FROM [  (
               ]
           )
           AS
-          Variable [ Name=lo ]
+          Variable [ Name=$lo ]
 ,
           FunctionCall Metadata.dataset@1[
             LiteralExpr [STRING] [Customer]
           ]
           AS
-          Variable [ Name=c ]
+          Variable [ Name=$c ]
         ]
         Where
           OperatorExpr [
             FieldAccessor [
-              Variable [ Name=c ]
+              Variable [ Name=$c ]
               Field=c_custkey
             ]
             =
             FieldAccessor [
-              Variable [ Name=lo ]
+              Variable [ Name=$lo ]
               Field=o_custkey
             ]
           ]
       )
       AS
-      Variable [ Name=loc ]
+      Variable [ Name=$loc ]
 ,
       FunctionCall Metadata.dataset@1[
         LiteralExpr [STRING] [Supplier]
       ]
       AS
-      Variable [ Name=s ]
+      Variable [ Name=$s ]
     ]
     Where
       OperatorExpr [
         FieldAccessor [
-          Variable [ Name=s ]
+          Variable [ Name=$s ]
           Field=s_suppkey
         ]
         =
         FieldAccessor [
-          Variable [ Name=loc ]
+          Variable [ Name=$loc ]
           Field=l_suppkey
         ]
       ]
   )
   AS
-  Variable [ Name=locs ]
+  Variable [ Name=$locs ]
 ,
   FunctionCall tpch.q7_volume_shipping_tmp@0[
   ]
   AS
-  Variable [ Name=t ]
+  Variable [ Name=$t ]
 ]
-LetVariable [ Name=l_year0 ]
+Let Variable [ Name=$l_year0 ]
   :=
   FunctionCall tpch.get-year@1[
     FieldAccessor [
-      Variable [ Name=locs ]
+      Variable [ Name=$locs ]
       Field=l_shipdate
     ]
   ]
@@ -337,57 +337,63 @@ Where
   OperatorExpr [
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=locs ]
+        Variable [ Name=$locs ]
         Field=c_nationkey
       ]
       =
       FieldAccessor [
-        Variable [ Name=t ]
+        Variable [ Name=$t ]
         Field=c_nationkey
       ]
     ]
     and
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=locs ]
+        Variable [ Name=$locs ]
         Field=s_nationkey
       ]
       =
       FieldAccessor [
-        Variable [ Name=t ]
+        Variable [ Name=$t ]
         Field=s_nationkey
       ]
     ]
   ]
 Groupby
-  Variable [ Name=supp_nation ]
+  Variable [ Name=$supp_nation ]
   :=
   FieldAccessor [
-    Variable [ Name=t ]
+    Variable [ Name=$t ]
     Field=supp_nation
   ]
-  Variable [ Name=cust_nation ]
+  Variable [ Name=$cust_nation ]
   :=
   FieldAccessor [
-    Variable [ Name=t ]
+    Variable [ Name=$t ]
     Field=cust_nation
   ]
-  Variable [ Name=l_year ]
+  Variable [ Name=$l_year ]
   :=
-  Variable [ Name=l_year0 ]
-  With
-  Variable [ Name=l_year0 ]
-  Variable [ Name=locs ]
-  Variable [ Name=t ]
+  Variable [ Name=$l_year0 ]
+  GROUP AS
+  Variable [ Name=#1 ]
+  (
+  Variable [ Name=$l_year0 ]
+   AS l_year0
+  Variable [ Name=$t ]
+   AS t
+  Variable [ Name=$locs ]
+   AS locs
+  )
 
-LetVariable [ Name=revenue ]
+Let Variable [ Name=$revenue ]
   :=
   FunctionCall tpch.sum@1[
     (
       SELECT ELEMENT [
       OperatorExpr [
         FieldAccessor [
-          Variable [ Name=i ]
+          Variable [ Name=$i ]
           Field=l_extendedprice
         ]
         *
@@ -395,23 +401,23 @@ LetVariable [ Name=revenue ]
           LiteralExpr [LONG] [1]
           -
           FieldAccessor [
-            Variable [ Name=i ]
+            Variable [ Name=$i ]
             Field=l_discount
           ]
         ]
       ]
       ]
-      FROM [        Variable [ Name=locs ]
+      FROM [        Variable [ Name=$locs ]
         AS
-        Variable [ Name=i ]
+        Variable [ Name=$i ]
       ]
     )
   ]
 Orderby
-  Variable [ Name=supp_nation ]
+  Variable [ Name=$supp_nation ]
   ASC
-  Variable [ Name=cust_nation ]
+  Variable [ Name=$cust_nation ]
   ASC
-  Variable [ Name=l_year ]
+  Variable [ Name=$l_year ]
   ASC
 

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q08_national_market_share/q08_national_market_share.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q08_national_market_share/q08_national_market_share.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q08_national_market_share/q08_national_market_share.3.ast
index f6dbd18..eca3549 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q08_national_market_share/q08_national_market_share.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q08_national_market_share/q08_national_market_share.3.ast
@@ -5,7 +5,7 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [year]
     :
-    Variable [ Name=year ]
+    Variable [ Name=$year ]
   )
   (
     LiteralExpr [STRING] [mkt_share]
@@ -17,7 +17,7 @@ RecordConstructor [
           FunctionCall tpch.switch-case@5[
             OperatorExpr [
               FieldAccessor [
-                Variable [ Name=i ]
+                Variable [ Name=$i ]
                 Field=s_name
               ]
               =
@@ -25,16 +25,16 @@ RecordConstructor [
             ]
             LiteralExpr [TRUE]
             FieldAccessor [
-              Variable [ Name=i ]
+              Variable [ Name=$i ]
               Field=revenue
             ]
             LiteralExpr [FALSE]
             LiteralExpr [DOUBLE] [0.0]
           ]
           ]
-          FROM [            Variable [ Name=t ]
+          FROM [            Variable [ Name=$t ]
             AS
-            Variable [ Name=i ]
+            Variable [ Name=$i ]
           ]
         )
       ]
@@ -43,13 +43,13 @@ RecordConstructor [
         (
           SELECT ELEMENT [
           FieldAccessor [
-            Variable [ Name=i ]
+            Variable [ Name=$i ]
             Field=revenue
           ]
           ]
-          FROM [            Variable [ Name=t ]
+          FROM [            Variable [ Name=$t ]
             AS
-            Variable [ Name=i ]
+            Variable [ Name=$i ]
           ]
         )
       ]
@@ -63,14 +63,14 @@ FROM [  (
       (
         LiteralExpr [STRING] [year]
         :
-        Variable [ Name=o_year ]
+        Variable [ Name=$o_year ]
       )
       (
         LiteralExpr [STRING] [revenue]
         :
         OperatorExpr [
           FieldAccessor [
-            Variable [ Name=slnrcop ]
+            Variable [ Name=$slnrcop ]
             Field=l_extendedprice
           ]
           *
@@ -78,7 +78,7 @@ FROM [  (
             LiteralExpr [LONG] [1]
             -
             FieldAccessor [
-              Variable [ Name=slnrcop ]
+              Variable [ Name=$slnrcop ]
               Field=l_discount
             ]
           ]
@@ -88,7 +88,7 @@ FROM [  (
         LiteralExpr [STRING] [s_name]
         :
         FieldAccessor [
-          Variable [ Name=n2 ]
+          Variable [ Name=$n2 ]
           Field=n_name
         ]
       )
@@ -101,7 +101,7 @@ FROM [  (
             LiteralExpr [STRING] [o_orderdate]
             :
             FieldAccessor [
-              Variable [ Name=lnrcop ]
+              Variable [ Name=$lnrcop ]
               Field=o_orderdate
             ]
           )
@@ -109,7 +109,7 @@ FROM [  (
             LiteralExpr [STRING] [l_discount]
             :
             FieldAccessor [
-              Variable [ Name=lnrcop ]
+              Variable [ Name=$lnrcop ]
               Field=l_discount
             ]
           )
@@ -117,7 +117,7 @@ FROM [  (
             LiteralExpr [STRING] [l_extendedprice]
             :
             FieldAccessor [
-              Variable [ Name=lnrcop ]
+              Variable [ Name=$lnrcop ]
               Field=l_extendedprice
             ]
           )
@@ -125,7 +125,7 @@ FROM [  (
             LiteralExpr [STRING] [l_suppkey]
             :
             FieldAccessor [
-              Variable [ Name=lnrcop ]
+              Variable [ Name=$lnrcop ]
               Field=l_suppkey
             ]
           )
@@ -133,7 +133,7 @@ FROM [  (
             LiteralExpr [STRING] [s_nationkey]
             :
             FieldAccessor [
-              Variable [ Name=s ]
+              Variable [ Name=$s ]
               Field=s_nationkey
             ]
           )
@@ -143,7 +143,7 @@ FROM [  (
             LiteralExpr [STRING] [Supplier]
           ]
           AS
-          Variable [ Name=s ]
+          Variable [ Name=$s ]
 ,
           (
             SELECT ELEMENT [
@@ -152,7 +152,7 @@ FROM [  (
                 LiteralExpr [STRING] [o_orderdate]
                 :
                 FieldAccessor [
-                  Variable [ Name=lnrco ]
+                  Variable [ Name=$lnrco ]
                   Field=o_orderdate
                 ]
               )
@@ -160,7 +160,7 @@ FROM [  (
                 LiteralExpr [STRING] [l_discount]
                 :
                 FieldAccessor [
-                  Variable [ Name=lnrco ]
+                  Variable [ Name=$lnrco ]
                   Field=l_discount
                 ]
               )
@@ -168,7 +168,7 @@ FROM [  (
                 LiteralExpr [STRING] [l_extendedprice]
                 :
                 FieldAccessor [
-                  Variable [ Name=lnrco ]
+                  Variable [ Name=$lnrco ]
                   Field=l_extendedprice
                 ]
               )
@@ -176,7 +176,7 @@ FROM [  (
                 LiteralExpr [STRING] [l_suppkey]
                 :
                 FieldAccessor [
-                  Variable [ Name=lnrco ]
+                  Variable [ Name=$lnrco ]
                   Field=l_suppkey
                 ]
               )
@@ -189,7 +189,7 @@ FROM [  (
                     LiteralExpr [STRING] [o_orderdate]
                     :
                     FieldAccessor [
-                      Variable [ Name=nrco ]
+                      Variable [ Name=$nrco ]
                       Field=o_orderdate
                     ]
                   )
@@ -197,7 +197,7 @@ FROM [  (
                     LiteralExpr [STRING] [l_partkey]
                     :
                     FieldAccessor [
-                      Variable [ Name=l ]
+                      Variable [ Name=$l ]
                       Field=l_partkey
                     ]
                   )
@@ -205,7 +205,7 @@ FROM [  (
                     LiteralExpr [STRING] [l_discount]
                     :
                     FieldAccessor [
-                      Variable [ Name=l ]
+                      Variable [ Name=$l ]
                       Field=l_discount
                     ]
                   )
@@ -213,7 +213,7 @@ FROM [  (
                     LiteralExpr [STRING] [l_extendedprice]
                     :
                     FieldAccessor [
-                      Variable [ Name=l ]
+                      Variable [ Name=$l ]
                       Field=l_extendedprice
                     ]
                   )
@@ -221,7 +221,7 @@ FROM [  (
                     LiteralExpr [STRING] [l_suppkey]
                     :
                     FieldAccessor [
-                      Variable [ Name=l ]
+                      Variable [ Name=$l ]
                       Field=l_suppkey
                     ]
                   )
@@ -231,7 +231,7 @@ FROM [  (
                     LiteralExpr [STRING] [LineItem]
                   ]
                   AS
-                  Variable [ Name=l ]
+                  Variable [ Name=$l ]
 ,
                   (
                     SELECT ELEMENT [
@@ -240,7 +240,7 @@ FROM [  (
                         LiteralExpr [STRING] [o_orderdate]
                         :
                         FieldAccessor [
-                          Variable [ Name=o ]
+                          Variable [ Name=$o ]
                           Field=o_orderdate
                         ]
                       )
@@ -248,7 +248,7 @@ FROM [  (
                         LiteralExpr [STRING] [o_orderkey]
                         :
                         FieldAccessor [
-                          Variable [ Name=o ]
+                          Variable [ Name=$o ]
                           Field=o_orderkey
                         ]
                       )
@@ -258,7 +258,7 @@ FROM [  (
                         LiteralExpr [STRING] [Orders]
                       ]
                       AS
-                      Variable [ Name=o ]
+                      Variable [ Name=$o ]
 ,
                       (
                         SELECT ELEMENT [
@@ -267,7 +267,7 @@ FROM [  (
                             LiteralExpr [STRING] [c_custkey]
                             :
                             FieldAccessor [
-                              Variable [ Name=c ]
+                              Variable [ Name=$c ]
                               Field=c_custkey
                             ]
                           )
@@ -277,7 +277,7 @@ FROM [  (
                             LiteralExpr [STRING] [Customer]
                           ]
                           AS
-                          Variable [ Name=c ]
+                          Variable [ Name=$c ]
 ,
                           (
                             SELECT ELEMENT [
@@ -286,7 +286,7 @@ FROM [  (
                                 LiteralExpr [STRING] [n_nationkey]
                                 :
                                 FieldAccessor [
-                                  Variable [ Name=n1 ]
+                                  Variable [ Name=$n1 ]
                                   Field=n_nationkey
                                 ]
                               )
@@ -296,31 +296,31 @@ FROM [  (
                                 LiteralExpr [STRING] [Nation]
                               ]
                               AS
-                              Variable [ Name=n1 ]
+                              Variable [ Name=$n1 ]
 ,
                               FunctionCall Metadata.dataset@1[
                                 LiteralExpr [STRING] [Region]
                               ]
                               AS
-                              Variable [ Name=r1 ]
+                              Variable [ Name=$r1 ]
                             ]
                             Where
                               OperatorExpr [
                                 OperatorExpr [
                                   FieldAccessor [
-                                    Variable [ Name=n1 ]
+                                    Variable [ Name=$n1 ]
                                     Field=n_regionkey
                                   ]
                                   =
                                   FieldAccessor [
-                                    Variable [ Name=r1 ]
+                                    Variable [ Name=$r1 ]
                                     Field=r_regionkey
                                   ]
                                 ]
                                 and
                                 OperatorExpr [
                                   FieldAccessor [
-                                    Variable [ Name=r1 ]
+                                    Variable [ Name=$r1 ]
                                     Field=r_name
                                   ]
                                   =
@@ -329,57 +329,57 @@ FROM [  (
                               ]
                           )
                           AS
-                          Variable [ Name=nr ]
+                          Variable [ Name=$nr ]
                         ]
                         Where
                           OperatorExpr [
                             FieldAccessor [
-                              Variable [ Name=c ]
+                              Variable [ Name=$c ]
                               Field=c_nationkey
                             ]
                             =
                             FieldAccessor [
-                              Variable [ Name=nr ]
+                              Variable [ Name=$nr ]
                               Field=n_nationkey
                             ]
                           ]
                       )
                       AS
-                      Variable [ Name=nrc ]
+                      Variable [ Name=$nrc ]
                     ]
                     Where
                       OperatorExpr [
                         FieldAccessor [
-                          Variable [ Name=nrc ]
+                          Variable [ Name=$nrc ]
                           Field=c_custkey
                         ]
                         =
                         FieldAccessor [
-                          Variable [ Name=o ]
+                          Variable [ Name=$o ]
                           Field=o_custkey
                         ]
                       ]
                   )
                   AS
-                  Variable [ Name=nrco ]
+                  Variable [ Name=$nrco ]
                 ]
                 Where
                   OperatorExpr [
                     OperatorExpr [
                       FieldAccessor [
-                        Variable [ Name=l ]
+                        Variable [ Name=$l ]
                         Field=l_orderkey
                       ]
                       =
                       FieldAccessor [
-                        Variable [ Name=nrco ]
+                        Variable [ Name=$nrco ]
                         Field=o_orderkey
                       ]
                     ]
                     and
                     OperatorExpr [
                       FieldAccessor [
-                        Variable [ Name=nrco ]
+                        Variable [ Name=$nrco ]
                         Field=o_orderdate
                       ]
                       >=
@@ -388,7 +388,7 @@ FROM [  (
                     and
                     OperatorExpr [
                       FieldAccessor [
-                        Variable [ Name=nrco ]
+                        Variable [ Name=$nrco ]
                         Field=o_orderdate
                       ]
                       <
@@ -397,31 +397,31 @@ FROM [  (
                   ]
               )
               AS
-              Variable [ Name=lnrco ]
+              Variable [ Name=$lnrco ]
 ,
               FunctionCall Metadata.dataset@1[
                 LiteralExpr [STRING] [Part]
               ]
               AS
-              Variable [ Name=p ]
+              Variable [ Name=$p ]
             ]
             Where
               OperatorExpr [
                 OperatorExpr [
                   FieldAccessor [
-                    Variable [ Name=p ]
+                    Variable [ Name=$p ]
                     Field=p_partkey
                   ]
                   =
                   FieldAccessor [
-                    Variable [ Name=lnrco ]
+                    Variable [ Name=$lnrco ]
                     Field=l_partkey
                   ]
                 ]
                 and
                 OperatorExpr [
                   FieldAccessor [
-                    Variable [ Name=p ]
+                    Variable [ Name=$p ]
                     Field=p_type
                   ]
                   =
@@ -430,65 +430,69 @@ FROM [  (
               ]
           )
           AS
-          Variable [ Name=lnrcop ]
+          Variable [ Name=$lnrcop ]
         ]
         Where
           OperatorExpr [
             FieldAccessor [
-              Variable [ Name=s ]
+              Variable [ Name=$s ]
               Field=s_suppkey
             ]
             =
             FieldAccessor [
-              Variable [ Name=lnrcop ]
+              Variable [ Name=$lnrcop ]
               Field=l_suppkey
             ]
           ]
       )
       AS
-      Variable [ Name=slnrcop ]
+      Variable [ Name=$slnrcop ]
 ,
       FunctionCall Metadata.dataset@1[
         LiteralExpr [STRING] [Nation]
       ]
       AS
-      Variable [ Name=n2 ]
+      Variable [ Name=$n2 ]
     ]
-    LetVariable [ Name=o_year ]
+    Let Variable [ Name=$o_year ]
       :=
       FunctionCall tpch.get-year@1[
         FieldAccessor [
-          Variable [ Name=slnrcop ]
+          Variable [ Name=$slnrcop ]
           Field=o_orderdate
         ]
       ]
     Where
       OperatorExpr [
         FieldAccessor [
-          Variable [ Name=slnrcop ]
+          Variable [ Name=$slnrcop ]
           Field=s_nationkey
         ]
         =
         FieldAccessor [
-          Variable [ Name=n2 ]
+          Variable [ Name=$n2 ]
           Field=n_nationkey
         ]
       ]
   )
   AS
-  Variable [ Name=t ]
+  Variable [ Name=$t ]
 ]
 Groupby
-  Variable [ Name=year ]
+  Variable [ Name=$year ]
   :=
   FieldAccessor [
-    Variable [ Name=t ]
+    Variable [ Name=$t ]
     Field=year
   ]
-  With
-  Variable [ Name=t ]
+  GROUP AS
+  Variable [ Name=#1 ]
+  (
+  Variable [ Name=$t ]
+   AS t
+  )
 
 Orderby
-  Variable [ Name=year ]
+  Variable [ Name=$year ]
   ASC
 

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q09_product_type_profit_nt/q09_product_type_profit_nt.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q09_product_type_profit_nt/q09_product_type_profit_nt.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q09_product_type_profit_nt/q09_product_type_profit_nt.3.ast
index 8052433..e455c20 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q09_product_type_profit_nt/q09_product_type_profit_nt.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q09_product_type_profit_nt/q09_product_type_profit_nt.3.ast
@@ -5,12 +5,12 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [nation]
     :
-    Variable [ Name=nation ]
+    Variable [ Name=$nation ]
   )
   (
     LiteralExpr [STRING] [o_year]
     :
-    Variable [ Name=o_year ]
+    Variable [ Name=$o_year ]
   )
   (
     LiteralExpr [STRING] [sum_profit]
@@ -19,13 +19,13 @@ RecordConstructor [
       (
         SELECT ELEMENT [
         FieldAccessor [
-          Variable [ Name=pr ]
+          Variable [ Name=$pr ]
           Field=amount
         ]
         ]
-        FROM [          Variable [ Name=profit ]
+        FROM [          Variable [ Name=$profit ]
           AS
-          Variable [ Name=pr ]
+          Variable [ Name=$pr ]
         ]
       )
     ]
@@ -39,19 +39,19 @@ FROM [  (
         LiteralExpr [STRING] [nation]
         :
         FieldAccessor [
-          Variable [ Name=l3 ]
+          Variable [ Name=$l3 ]
           Field=n_name
         ]
       )
       (
         LiteralExpr [STRING] [o_year]
         :
-        Variable [ Name=o_year ]
+        Variable [ Name=$o_year ]
       )
       (
         LiteralExpr [STRING] [amount]
         :
-        Variable [ Name=amount ]
+        Variable [ Name=$amount ]
       )
     ]
     ]
@@ -59,7 +59,7 @@ FROM [  (
         LiteralExpr [STRING] [Orders]
       ]
       AS
-      Variable [ Name=o ]
+      Variable [ Name=$o ]
 ,
       (
         SELECT ELEMENT [
@@ -68,7 +68,7 @@ FROM [  (
             LiteralExpr [STRING] [l_extendedprice]
             :
             FieldAccessor [
-              Variable [ Name=l2 ]
+              Variable [ Name=$l2 ]
               Field=l_extendedprice
             ]
           )
@@ -76,7 +76,7 @@ FROM [  (
             LiteralExpr [STRING] [l_discount]
             :
             FieldAccessor [
-              Variable [ Name=l2 ]
+              Variable [ Name=$l2 ]
               Field=l_discount
             ]
           )
@@ -84,7 +84,7 @@ FROM [  (
             LiteralExpr [STRING] [l_quantity]
             :
             FieldAccessor [
-              Variable [ Name=l2 ]
+              Variable [ Name=$l2 ]
               Field=l_quantity
             ]
           )
@@ -92,7 +92,7 @@ FROM [  (
             LiteralExpr [STRING] [l_orderkey]
             :
             FieldAccessor [
-              Variable [ Name=l2 ]
+              Variable [ Name=$l2 ]
               Field=l_orderkey
             ]
           )
@@ -100,7 +100,7 @@ FROM [  (
             LiteralExpr [STRING] [n_name]
             :
             FieldAccessor [
-              Variable [ Name=l2 ]
+              Variable [ Name=$l2 ]
               Field=n_name
             ]
           )
@@ -108,7 +108,7 @@ FROM [  (
             LiteralExpr [STRING] [ps_supplycost]
             :
             FieldAccessor [
-              Variable [ Name=l2 ]
+              Variable [ Name=$l2 ]
               Field=ps_supplycost
             ]
           )
@@ -118,7 +118,7 @@ FROM [  (
             LiteralExpr [STRING] [Part]
           ]
           AS
-          Variable [ Name=p ]
+          Variable [ Name=$p ]
 ,
           (
             SELECT ELEMENT [
@@ -127,7 +127,7 @@ FROM [  (
                 LiteralExpr [STRING] [l_extendedprice]
                 :
                 FieldAccessor [
-                  Variable [ Name=l1 ]
+                  Variable [ Name=$l1 ]
                   Field=l_extendedprice
                 ]
               )
@@ -135,7 +135,7 @@ FROM [  (
                 LiteralExpr [STRING] [l_discount]
                 :
                 FieldAccessor [
-                  Variable [ Name=l1 ]
+                  Variable [ Name=$l1 ]
                   Field=l_discount
                 ]
               )
@@ -143,7 +143,7 @@ FROM [  (
                 LiteralExpr [STRING] [l_quantity]
                 :
                 FieldAccessor [
-                  Variable [ Name=l1 ]
+                  Variable [ Name=$l1 ]
                   Field=l_quantity
                 ]
               )
@@ -151,7 +151,7 @@ FROM [  (
                 LiteralExpr [STRING] [l_partkey]
                 :
                 FieldAccessor [
-                  Variable [ Name=l1 ]
+                  Variable [ Name=$l1 ]
                   Field=l_partkey
                 ]
               )
@@ -159,7 +159,7 @@ FROM [  (
                 LiteralExpr [STRING] [l_orderkey]
                 :
                 FieldAccessor [
-                  Variable [ Name=l1 ]
+                  Variable [ Name=$l1 ]
                   Field=l_orderkey
                 ]
               )
@@ -167,7 +167,7 @@ FROM [  (
                 LiteralExpr [STRING] [n_name]
                 :
                 FieldAccessor [
-                  Variable [ Name=l1 ]
+                  Variable [ Name=$l1 ]
                   Field=n_name
                 ]
               )
@@ -175,7 +175,7 @@ FROM [  (
                 LiteralExpr [STRING] [ps_supplycost]
                 :
                 FieldAccessor [
-                  Variable [ Name=ps ]
+                  Variable [ Name=$ps ]
                   Field=ps_supplycost
                 ]
               )
@@ -185,7 +185,7 @@ FROM [  (
                 LiteralExpr [STRING] [Partsupp]
               ]
               AS
-              Variable [ Name=ps ]
+              Variable [ Name=$ps ]
 ,
               (
                 SELECT ELEMENT [
@@ -194,7 +194,7 @@ FROM [  (
                     LiteralExpr [STRING] [l_suppkey]
                     :
                     FieldAccessor [
-                      Variable [ Name=l ]
+                      Variable [ Name=$l ]
                       Field=l_suppkey
                     ]
                   )
@@ -202,7 +202,7 @@ FROM [  (
                     LiteralExpr [STRING] [l_extendedprice]
                     :
                     FieldAccessor [
-                      Variable [ Name=l ]
+                      Variable [ Name=$l ]
                       Field=l_extendedprice
                     ]
                   )
@@ -210,7 +210,7 @@ FROM [  (
                     LiteralExpr [STRING] [l_discount]
                     :
                     FieldAccessor [
-                      Variable [ Name=l ]
+                      Variable [ Name=$l ]
                       Field=l_discount
                     ]
                   )
@@ -218,7 +218,7 @@ FROM [  (
                     LiteralExpr [STRING] [l_quantity]
                     :
                     FieldAccessor [
-                      Variable [ Name=l ]
+                      Variable [ Name=$l ]
                       Field=l_quantity
                     ]
                   )
@@ -226,7 +226,7 @@ FROM [  (
                     LiteralExpr [STRING] [l_partkey]
                     :
                     FieldAccessor [
-                      Variable [ Name=l ]
+                      Variable [ Name=$l ]
                       Field=l_partkey
                     ]
                   )
@@ -234,7 +234,7 @@ FROM [  (
                     LiteralExpr [STRING] [l_orderkey]
                     :
                     FieldAccessor [
-                      Variable [ Name=l ]
+                      Variable [ Name=$l ]
                       Field=l_orderkey
                     ]
                   )
@@ -242,7 +242,7 @@ FROM [  (
                     LiteralExpr [STRING] [n_name]
                     :
                     FieldAccessor [
-                      Variable [ Name=s1 ]
+                      Variable [ Name=$s1 ]
                       Field=n_name
                     ]
                   )
@@ -255,7 +255,7 @@ FROM [  (
                         LiteralExpr [STRING] [s_suppkey]
                         :
                         FieldAccessor [
-                          Variable [ Name=s ]
+                          Variable [ Name=$s ]
                           Field=s_suppkey
                         ]
                       )
@@ -263,7 +263,7 @@ FROM [  (
                         LiteralExpr [STRING] [n_name]
                         :
                         FieldAccessor [
-                          Variable [ Name=n ]
+                          Variable [ Name=$n ]
                           Field=n_name
                         ]
                       )
@@ -273,87 +273,87 @@ FROM [  (
                         LiteralExpr [STRING] [Supplier]
                       ]
                       AS
-                      Variable [ Name=s ]
+                      Variable [ Name=$s ]
 ,
                       FunctionCall Metadata.dataset@1[
                         LiteralExpr [STRING] [Nation]
                       ]
                       AS
-                      Variable [ Name=n ]
+                      Variable [ Name=$n ]
                     ]
                     Where
                       OperatorExpr [
                         FieldAccessor [
-                          Variable [ Name=n ]
+                          Variable [ Name=$n ]
                           Field=n_nationkey
                         ]
                         =
                         FieldAccessor [
-                          Variable [ Name=s ]
+                          Variable [ Name=$s ]
                           Field=s_nationkey
                         ]
                       ]
                   )
                   AS
-                  Variable [ Name=s1 ]
+                  Variable [ Name=$s1 ]
 ,
                   FunctionCall Metadata.dataset@1[
                     LiteralExpr [STRING] [LineItem]
                   ]
                   AS
-                  Variable [ Name=l ]
+                  Variable [ Name=$l ]
                 ]
                 Where
                   OperatorExpr [
                     FieldAccessor [
-                      Variable [ Name=s1 ]
+                      Variable [ Name=$s1 ]
                       Field=s_suppkey
                     ]
                     =
                     FieldAccessor [
-                      Variable [ Name=l ]
+                      Variable [ Name=$l ]
                       Field=l_suppkey
                     ]
                   ]
               )
               AS
-              Variable [ Name=l1 ]
+              Variable [ Name=$l1 ]
             ]
             Where
               OperatorExpr [
                 OperatorExpr [
                   FieldAccessor [
-                    Variable [ Name=ps ]
+                    Variable [ Name=$ps ]
                     Field=ps_suppkey
                   ]
                   =
                   FieldAccessor [
-                    Variable [ Name=l1 ]
+                    Variable [ Name=$l1 ]
                     Field=l_suppkey
                   ]
                 ]
                 and
                 OperatorExpr [
                   FieldAccessor [
-                    Variable [ Name=ps ]
+                    Variable [ Name=$ps ]
                     Field=ps_partkey
                   ]
                   =
                   FieldAccessor [
-                    Variable [ Name=l1 ]
+                    Variable [ Name=$l1 ]
                     Field=l_partkey
                   ]
                 ]
               ]
           )
           AS
-          Variable [ Name=l2 ]
+          Variable [ Name=$l2 ]
         ]
         Where
           OperatorExpr [
             FunctionCall tpch.contains@2[
               FieldAccessor [
-                Variable [ Name=p ]
+                Variable [ Name=$p ]
                 Field=p_name
               ]
               LiteralExpr [STRING] [green]
@@ -361,26 +361,26 @@ FROM [  (
             and
             OperatorExpr [
               FieldAccessor [
-                Variable [ Name=p ]
+                Variable [ Name=$p ]
                 Field=p_partkey
               ]
               =
               FieldAccessor [
-                Variable [ Name=l2 ]
+                Variable [ Name=$l2 ]
                 Field=l_partkey
               ]
             ]
           ]
       )
       AS
-      Variable [ Name=l3 ]
+      Variable [ Name=$l3 ]
     ]
-    LetVariable [ Name=amount ]
+    Let Variable [ Name=$amount ]
       :=
       OperatorExpr [
         OperatorExpr [
           FieldAccessor [
-            Variable [ Name=l3 ]
+            Variable [ Name=$l3 ]
             Field=l_extendedprice
           ]
           *
@@ -388,7 +388,7 @@ FROM [  (
             LiteralExpr [LONG] [1]
             -
             FieldAccessor [
-              Variable [ Name=l3 ]
+              Variable [ Name=$l3 ]
               Field=l_discount
             ]
           ]
@@ -396,59 +396,63 @@ FROM [  (
         -
         OperatorExpr [
           FieldAccessor [
-            Variable [ Name=l3 ]
+            Variable [ Name=$l3 ]
             Field=ps_supplycost
           ]
           *
           FieldAccessor [
-            Variable [ Name=l3 ]
+            Variable [ Name=$l3 ]
             Field=l_quantity
           ]
         ]
       ]
-    LetVariable [ Name=o_year ]
+    Let Variable [ Name=$o_year ]
       :=
       FunctionCall tpch.get-year@1[
         FieldAccessor [
-          Variable [ Name=o ]
+          Variable [ Name=$o ]
           Field=o_orderdate
         ]
       ]
     Where
       OperatorExpr [
         FieldAccessor [
-          Variable [ Name=o ]
+          Variable [ Name=$o ]
           Field=o_orderkey
         ]
         =
         FieldAccessor [
-          Variable [ Name=l3 ]
+          Variable [ Name=$l3 ]
           Field=l_orderkey
         ]
       ]
   )
   AS
-  Variable [ Name=profit ]
+  Variable [ Name=$profit ]
 ]
 Groupby
-  Variable [ Name=nation ]
+  Variable [ Name=$nation ]
   :=
   FieldAccessor [
-    Variable [ Name=profit ]
+    Variable [ Name=$profit ]
     Field=nation
   ]
-  Variable [ Name=o_year ]
+  Variable [ Name=$o_year ]
   :=
   FieldAccessor [
-    Variable [ Name=profit ]
+    Variable [ Name=$profit ]
     Field=o_year
   ]
-  With
-  Variable [ Name=profit ]
+  GROUP AS
+  Variable [ Name=#1 ]
+  (
+  Variable [ Name=$profit ]
+   AS profit
+  )
 
 Orderby
-  Variable [ Name=nation ]
+  Variable [ Name=$nation ]
   ASC
-  Variable [ Name=o_year ]
+  Variable [ Name=$o_year ]
   DESC
 

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q10_returned_item/q10_returned_item.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q10_returned_item/q10_returned_item.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q10_returned_item/q10_returned_item.3.ast
index 95cef5d..ff09340 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q10_returned_item/q10_returned_item.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q10_returned_item/q10_returned_item.3.ast
@@ -5,42 +5,42 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [c_custkey]
     :
-    Variable [ Name=c_custkey ]
+    Variable [ Name=$c_custkey ]
   )
   (
     LiteralExpr [STRING] [c_name]
     :
-    Variable [ Name=c_name ]
+    Variable [ Name=$c_name ]
   )
   (
     LiteralExpr [STRING] [revenue]
     :
-    Variable [ Name=revenue ]
+    Variable [ Name=$revenue ]
   )
   (
     LiteralExpr [STRING] [c_acctbal]
     :
-    Variable [ Name=c_acctbal ]
+    Variable [ Name=$c_acctbal ]
   )
   (
     LiteralExpr [STRING] [n_name]
     :
-    Variable [ Name=n_name ]
+    Variable [ Name=$n_name ]
   )
   (
     LiteralExpr [STRING] [c_address]
     :
-    Variable [ Name=c_address ]
+    Variable [ Name=$c_address ]
   )
   (
     LiteralExpr [STRING] [c_phone]
     :
-    Variable [ Name=c_phone ]
+    Variable [ Name=$c_phone ]
   )
   (
     LiteralExpr [STRING] [c_comment]
     :
-    Variable [ Name=c_comment ]
+    Variable [ Name=$c_comment ]
   )
 ]
 ]
@@ -51,7 +51,7 @@ FROM [  (
         LiteralExpr [STRING] [c_custkey]
         :
         FieldAccessor [
-          Variable [ Name=ocn ]
+          Variable [ Name=$ocn ]
           Field=c_custkey
         ]
       )
@@ -59,7 +59,7 @@ FROM [  (
         LiteralExpr [STRING] [c_name]
         :
         FieldAccessor [
-          Variable [ Name=ocn ]
+          Variable [ Name=$ocn ]
           Field=c_name
         ]
       )
@@ -67,7 +67,7 @@ FROM [  (
         LiteralExpr [STRING] [c_acctbal]
         :
         FieldAccessor [
-          Variable [ Name=ocn ]
+          Variable [ Name=$ocn ]
           Field=c_acctbal
         ]
       )
@@ -75,7 +75,7 @@ FROM [  (
         LiteralExpr [STRING] [n_name]
         :
         FieldAccessor [
-          Variable [ Name=ocn ]
+          Variable [ Name=$ocn ]
           Field=n_name
         ]
       )
@@ -83,7 +83,7 @@ FROM [  (
         LiteralExpr [STRING] [c_address]
         :
         FieldAccessor [
-          Variable [ Name=ocn ]
+          Variable [ Name=$ocn ]
           Field=c_address
         ]
       )
@@ -91,7 +91,7 @@ FROM [  (
         LiteralExpr [STRING] [c_phone]
         :
         FieldAccessor [
-          Variable [ Name=ocn ]
+          Variable [ Name=$ocn ]
           Field=c_phone
         ]
       )
@@ -99,7 +99,7 @@ FROM [  (
         LiteralExpr [STRING] [c_comment]
         :
         FieldAccessor [
-          Variable [ Name=ocn ]
+          Variable [ Name=$ocn ]
           Field=c_comment
         ]
       )
@@ -107,7 +107,7 @@ FROM [  (
         LiteralExpr [STRING] [l_extendedprice]
         :
         FieldAccessor [
-          Variable [ Name=l ]
+          Variable [ Name=$l ]
           Field=l_extendedprice
         ]
       )
@@ -115,7 +115,7 @@ FROM [  (
         LiteralExpr [STRING] [l_discount]
         :
         FieldAccessor [
-          Variable [ Name=l ]
+          Variable [ Name=$l ]
           Field=l_discount
         ]
       )
@@ -125,7 +125,7 @@ FROM [  (
         LiteralExpr [STRING] [LineItem]
       ]
       AS
-      Variable [ Name=l ]
+      Variable [ Name=$l ]
 ,
       (
         SELECT ELEMENT [
@@ -134,7 +134,7 @@ FROM [  (
             LiteralExpr [STRING] [c_custkey]
             :
             FieldAccessor [
-              Variable [ Name=c ]
+              Variable [ Name=$c ]
               Field=c_custkey
             ]
           )
@@ -142,7 +142,7 @@ FROM [  (
             LiteralExpr [STRING] [c_name]
             :
             FieldAccessor [
-              Variable [ Name=c ]
+              Variable [ Name=$c ]
               Field=c_name
             ]
           )
@@ -150,7 +150,7 @@ FROM [  (
             LiteralExpr [STRING] [c_acctbal]
             :
             FieldAccessor [
-              Variable [ Name=c ]
+              Variable [ Name=$c ]
               Field=c_acctbal
             ]
           )
@@ -158,7 +158,7 @@ FROM [  (
             LiteralExpr [STRING] [n_name]
             :
             FieldAccessor [
-              Variable [ Name=n ]
+              Variable [ Name=$n ]
               Field=n_name
             ]
           )
@@ -166,7 +166,7 @@ FROM [  (
             LiteralExpr [STRING] [c_address]
             :
             FieldAccessor [
-              Variable [ Name=c ]
+              Variable [ Name=$c ]
               Field=c_address
             ]
           )
@@ -174,7 +174,7 @@ FROM [  (
             LiteralExpr [STRING] [c_phone]
             :
             FieldAccessor [
-              Variable [ Name=c ]
+              Variable [ Name=$c ]
               Field=c_phone
             ]
           )
@@ -182,7 +182,7 @@ FROM [  (
             LiteralExpr [STRING] [c_comment]
             :
             FieldAccessor [
-              Variable [ Name=c ]
+              Variable [ Name=$c ]
               Field=c_comment
             ]
           )
@@ -190,7 +190,7 @@ FROM [  (
             LiteralExpr [STRING] [o_orderkey]
             :
             FieldAccessor [
-              Variable [ Name=o ]
+              Variable [ Name=$o ]
               Field=o_orderkey
             ]
           )
@@ -200,38 +200,38 @@ FROM [  (
             LiteralExpr [STRING] [Orders]
           ]
           AS
-          Variable [ Name=o ]
+          Variable [ Name=$o ]
 ,
           FunctionCall Metadata.dataset@1[
             LiteralExpr [STRING] [Customer]
           ]
           AS
-          Variable [ Name=c ]
+          Variable [ Name=$c ]
 ,
           FunctionCall Metadata.dataset@1[
             LiteralExpr [STRING] [Nation]
           ]
           AS
-          Variable [ Name=n ]
+          Variable [ Name=$n ]
         ]
         Where
           OperatorExpr [
             OperatorExpr [
               OperatorExpr [
                 FieldAccessor [
-                  Variable [ Name=c ]
+                  Variable [ Name=$c ]
                   Field=c_custkey
                 ]
                 =
                 FieldAccessor [
-                  Variable [ Name=o ]
+                  Variable [ Name=$o ]
                   Field=o_custkey
                 ]
               ]
               and
               OperatorExpr [
                 FieldAccessor [
-                  Variable [ Name=o ]
+                  Variable [ Name=$o ]
                   Field=o_orderdate
                 ]
                 >=
@@ -240,7 +240,7 @@ FROM [  (
               and
               OperatorExpr [
                 FieldAccessor [
-                  Variable [ Name=o ]
+                  Variable [ Name=$o ]
                   Field=o_orderdate
                 ]
                 <
@@ -250,37 +250,37 @@ FROM [  (
             and
             OperatorExpr [
               FieldAccessor [
-                Variable [ Name=c ]
+                Variable [ Name=$c ]
                 Field=c_nationkey
               ]
               =
               FieldAccessor [
-                Variable [ Name=n ]
+                Variable [ Name=$n ]
                 Field=n_nationkey
               ]
             ]
           ]
       )
       AS
-      Variable [ Name=ocn ]
+      Variable [ Name=$ocn ]
     ]
     Where
       OperatorExpr [
         OperatorExpr [
           FieldAccessor [
-            Variable [ Name=l ]
+            Variable [ Name=$l ]
             Field=l_orderkey
           ]
           =
           FieldAccessor [
-            Variable [ Name=ocn ]
+            Variable [ Name=$ocn ]
             Field=o_orderkey
           ]
         ]
         and
         OperatorExpr [
           FieldAccessor [
-            Variable [ Name=l ]
+            Variable [ Name=$l ]
             Field=l_selectflag
           ]
           =
@@ -289,62 +289,66 @@ FROM [  (
       ]
   )
   AS
-  Variable [ Name=locn ]
+  Variable [ Name=$locn ]
 ]
 Groupby
-  Variable [ Name=c_custkey ]
+  Variable [ Name=$c_custkey ]
   :=
   FieldAccessor [
-    Variable [ Name=locn ]
+    Variable [ Name=$locn ]
     Field=c_custkey
   ]
-  Variable [ Name=c_name ]
+  Variable [ Name=$c_name ]
   :=
   FieldAccessor [
-    Variable [ Name=locn ]
+    Variable [ Name=$locn ]
     Field=c_name
   ]
-  Variable [ Name=c_acctbal ]
+  Variable [ Name=$c_acctbal ]
   :=
   FieldAccessor [
-    Variable [ Name=locn ]
+    Variable [ Name=$locn ]
     Field=c_acctbal
   ]
-  Variable [ Name=c_phone ]
+  Variable [ Name=$c_phone ]
   :=
   FieldAccessor [
-    Variable [ Name=locn ]
+    Variable [ Name=$locn ]
     Field=c_phone
   ]
-  Variable [ Name=n_name ]
+  Variable [ Name=$n_name ]
   :=
   FieldAccessor [
-    Variable [ Name=locn ]
+    Variable [ Name=$locn ]
     Field=n_name
   ]
-  Variable [ Name=c_address ]
+  Variable [ Name=$c_address ]
   :=
   FieldAccessor [
-    Variable [ Name=locn ]
+    Variable [ Name=$locn ]
     Field=c_address
   ]
-  Variable [ Name=c_comment ]
+  Variable [ Name=$c_comment ]
   :=
   FieldAccessor [
-    Variable [ Name=locn ]
+    Variable [ Name=$locn ]
     Field=c_comment
   ]
-  With
-  Variable [ Name=locn ]
+  GROUP AS
+  Variable [ Name=#1 ]
+  (
+  Variable [ Name=$locn ]
+   AS locn
+  )
 
-LetVariable [ Name=revenue ]
+Let Variable [ Name=$revenue ]
   :=
   FunctionCall tpch.sum@1[
     (
       SELECT ELEMENT [
       OperatorExpr [
         FieldAccessor [
-          Variable [ Name=i ]
+          Variable [ Name=$i ]
           Field=l_extendedprice
         ]
         *
@@ -352,20 +356,20 @@ LetVariable [ Name=revenue ]
           LiteralExpr [LONG] [1]
           -
           FieldAccessor [
-            Variable [ Name=i ]
+            Variable [ Name=$i ]
             Field=l_discount
           ]
         ]
       ]
       ]
-      FROM [        Variable [ Name=locn ]
+      FROM [        Variable [ Name=$locn ]
         AS
-        Variable [ Name=i ]
+        Variable [ Name=$i ]
       ]
     )
   ]
 Orderby
-  Variable [ Name=revenue ]
+  Variable [ Name=$revenue ]
   DESC
 
 Limit

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q10_returned_item_int64/q10_returned_item_int64.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q10_returned_item_int64/q10_returned_item_int64.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q10_returned_item_int64/q10_returned_item_int64.3.ast
index 95cef5d..ff09340 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q10_returned_item_int64/q10_returned_item_int64.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q10_returned_item_int64/q10_returned_item_int64.3.ast
@@ -5,42 +5,42 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [c_custkey]
     :
-    Variable [ Name=c_custkey ]
+    Variable [ Name=$c_custkey ]
   )
   (
     LiteralExpr [STRING] [c_name]
     :
-    Variable [ Name=c_name ]
+    Variable [ Name=$c_name ]
   )
   (
     LiteralExpr [STRING] [revenue]
     :
-    Variable [ Name=revenue ]
+    Variable [ Name=$revenue ]
   )
   (
     LiteralExpr [STRING] [c_acctbal]
     :
-    Variable [ Name=c_acctbal ]
+    Variable [ Name=$c_acctbal ]
   )
   (
     LiteralExpr [STRING] [n_name]
     :
-    Variable [ Name=n_name ]
+    Variable [ Name=$n_name ]
   )
   (
     LiteralExpr [STRING] [c_address]
     :
-    Variable [ Name=c_address ]
+    Variable [ Name=$c_address ]
   )
   (
     LiteralExpr [STRING] [c_phone]
     :
-    Variable [ Name=c_phone ]
+    Variable [ Name=$c_phone ]
   )
   (
     LiteralExpr [STRING] [c_comment]
     :
-    Variable [ Name=c_comment ]
+    Variable [ Name=$c_comment ]
   )
 ]
 ]
@@ -51,7 +51,7 @@ FROM [  (
         LiteralExpr [STRING] [c_custkey]
         :
         FieldAccessor [
-          Variable [ Name=ocn ]
+          Variable [ Name=$ocn ]
           Field=c_custkey
         ]
       )
@@ -59,7 +59,7 @@ FROM [  (
         LiteralExpr [STRING] [c_name]
         :
         FieldAccessor [
-          Variable [ Name=ocn ]
+          Variable [ Name=$ocn ]
           Field=c_name
         ]
       )
@@ -67,7 +67,7 @@ FROM [  (
         LiteralExpr [STRING] [c_acctbal]
         :
         FieldAccessor [
-          Variable [ Name=ocn ]
+          Variable [ Name=$ocn ]
           Field=c_acctbal
         ]
       )
@@ -75,7 +75,7 @@ FROM [  (
         LiteralExpr [STRING] [n_name]
         :
         FieldAccessor [
-          Variable [ Name=ocn ]
+          Variable [ Name=$ocn ]
           Field=n_name
         ]
       )
@@ -83,7 +83,7 @@ FROM [  (
         LiteralExpr [STRING] [c_address]
         :
         FieldAccessor [
-          Variable [ Name=ocn ]
+          Variable [ Name=$ocn ]
           Field=c_address
         ]
       )
@@ -91,7 +91,7 @@ FROM [  (
         LiteralExpr [STRING] [c_phone]
         :
         FieldAccessor [
-          Variable [ Name=ocn ]
+          Variable [ Name=$ocn ]
           Field=c_phone
         ]
       )
@@ -99,7 +99,7 @@ FROM [  (
         LiteralExpr [STRING] [c_comment]
         :
         FieldAccessor [
-          Variable [ Name=ocn ]
+          Variable [ Name=$ocn ]
           Field=c_comment
         ]
       )
@@ -107,7 +107,7 @@ FROM [  (
         LiteralExpr [STRING] [l_extendedprice]
         :
         FieldAccessor [
-          Variable [ Name=l ]
+          Variable [ Name=$l ]
           Field=l_extendedprice
         ]
       )
@@ -115,7 +115,7 @@ FROM [  (
         LiteralExpr [STRING] [l_discount]
         :
         FieldAccessor [
-          Variable [ Name=l ]
+          Variable [ Name=$l ]
           Field=l_discount
         ]
       )
@@ -125,7 +125,7 @@ FROM [  (
         LiteralExpr [STRING] [LineItem]
       ]
       AS
-      Variable [ Name=l ]
+      Variable [ Name=$l ]
 ,
       (
         SELECT ELEMENT [
@@ -134,7 +134,7 @@ FROM [  (
             LiteralExpr [STRING] [c_custkey]
             :
             FieldAccessor [
-              Variable [ Name=c ]
+              Variable [ Name=$c ]
               Field=c_custkey
             ]
           )
@@ -142,7 +142,7 @@ FROM [  (
             LiteralExpr [STRING] [c_name]
             :
             FieldAccessor [
-              Variable [ Name=c ]
+              Variable [ Name=$c ]
               Field=c_name
             ]
           )
@@ -150,7 +150,7 @@ FROM [  (
             LiteralExpr [STRING] [c_acctbal]
             :
             FieldAccessor [
-              Variable [ Name=c ]
+              Variable [ Name=$c ]
               Field=c_acctbal
             ]
           )
@@ -158,7 +158,7 @@ FROM [  (
             LiteralExpr [STRING] [n_name]
             :
             FieldAccessor [
-              Variable [ Name=n ]
+              Variable [ Name=$n ]
               Field=n_name
             ]
           )
@@ -166,7 +166,7 @@ FROM [  (
             LiteralExpr [STRING] [c_address]
             :
             FieldAccessor [
-              Variable [ Name=c ]
+              Variable [ Name=$c ]
               Field=c_address
             ]
           )
@@ -174,7 +174,7 @@ FROM [  (
             LiteralExpr [STRING] [c_phone]
             :
             FieldAccessor [
-              Variable [ Name=c ]
+              Variable [ Name=$c ]
               Field=c_phone
             ]
           )
@@ -182,7 +182,7 @@ FROM [  (
             LiteralExpr [STRING] [c_comment]
             :
             FieldAccessor [
-              Variable [ Name=c ]
+              Variable [ Name=$c ]
               Field=c_comment
             ]
           )
@@ -190,7 +190,7 @@ FROM [  (
             LiteralExpr [STRING] [o_orderkey]
             :
             FieldAccessor [
-              Variable [ Name=o ]
+              Variable [ Name=$o ]
               Field=o_orderkey
             ]
           )
@@ -200,38 +200,38 @@ FROM [  (
             LiteralExpr [STRING] [Orders]
           ]
           AS
-          Variable [ Name=o ]
+          Variable [ Name=$o ]
 ,
           FunctionCall Metadata.dataset@1[
             LiteralExpr [STRING] [Customer]
           ]
           AS
-          Variable [ Name=c ]
+          Variable [ Name=$c ]
 ,
           FunctionCall Metadata.dataset@1[
             LiteralExpr [STRING] [Nation]
           ]
           AS
-          Variable [ Name=n ]
+          Variable [ Name=$n ]
         ]
         Where
           OperatorExpr [
             OperatorExpr [
               OperatorExpr [
                 FieldAccessor [
-                  Variable [ Name=c ]
+                  Variable [ Name=$c ]
                   Field=c_custkey
                 ]
                 =
                 FieldAccessor [
-                  Variable [ Name=o ]
+                  Variable [ Name=$o ]
                   Field=o_custkey
                 ]
               ]
               and
               OperatorExpr [
                 FieldAccessor [
-                  Variable [ Name=o ]
+                  Variable [ Name=$o ]
                   Field=o_orderdate
                 ]
                 >=
@@ -240,7 +240,7 @@ FROM [  (
               and
               OperatorExpr [
                 FieldAccessor [
-                  Variable [ Name=o ]
+                  Variable [ Name=$o ]
                   Field=o_orderdate
                 ]
                 <
@@ -250,37 +250,37 @@ FROM [  (
             and
             OperatorExpr [
               FieldAccessor [
-                Variable [ Name=c ]
+                Variable [ Name=$c ]
                 Field=c_nationkey
               ]
               =
               FieldAccessor [
-                Variable [ Name=n ]
+                Variable [ Name=$n ]
                 Field=n_nationkey
               ]
             ]
           ]
       )
       AS
-      Variable [ Name=ocn ]
+      Variable [ Name=$ocn ]
     ]
     Where
       OperatorExpr [
         OperatorExpr [
           FieldAccessor [
-            Variable [ Name=l ]
+            Variable [ Name=$l ]
             Field=l_orderkey
           ]
           =
           FieldAccessor [
-            Variable [ Name=ocn ]
+            Variable [ Name=$ocn ]
             Field=o_orderkey
           ]
         ]
         and
         OperatorExpr [
           FieldAccessor [
-            Variable [ Name=l ]
+            Variable [ Name=$l ]
             Field=l_selectflag
           ]
           =
@@ -289,62 +289,66 @@ FROM [  (
       ]
   )
   AS
-  Variable [ Name=locn ]
+  Variable [ Name=$locn ]
 ]
 Groupby
-  Variable [ Name=c_custkey ]
+  Variable [ Name=$c_custkey ]
   :=
   FieldAccessor [
-    Variable [ Name=locn ]
+    Variable [ Name=$locn ]
     Field=c_custkey
   ]
-  Variable [ Name=c_name ]
+  Variable [ Name=$c_name ]
   :=
   FieldAccessor [
-    Variable [ Name=locn ]
+    Variable [ Name=$locn ]
     Field=c_name
   ]
-  Variable [ Name=c_acctbal ]
+  Variable [ Name=$c_acctbal ]
   :=
   FieldAccessor [
-    Variable [ Name=locn ]
+    Variable [ Name=$locn ]
     Field=c_acctbal
   ]
-  Variable [ Name=c_phone ]
+  Variable [ Name=$c_phone ]
   :=
   FieldAccessor [
-    Variable [ Name=locn ]
+    Variable [ Name=$locn ]
     Field=c_phone
   ]
-  Variable [ Name=n_name ]
+  Variable [ Name=$n_name ]
   :=
   FieldAccessor [
-    Variable [ Name=locn ]
+    Variable [ Name=$locn ]
     Field=n_name
   ]
-  Variable [ Name=c_address ]
+  Variable [ Name=$c_address ]
   :=
   FieldAccessor [
-    Variable [ Name=locn ]
+    Variable [ Name=$locn ]
     Field=c_address
   ]
-  Variable [ Name=c_comment ]
+  Variable [ Name=$c_comment ]
   :=
   FieldAccessor [
-    Variable [ Name=locn ]
+    Variable [ Name=$locn ]
     Field=c_comment
   ]
-  With
-  Variable [ Name=locn ]
+  GROUP AS
+  Variable [ Name=#1 ]
+  (
+  Variable [ Name=$locn ]
+   AS locn
+  )
 
-LetVariable [ Name=revenue ]
+Let Variable [ Name=$revenue ]
   :=
   FunctionCall tpch.sum@1[
     (
       SELECT ELEMENT [
       OperatorExpr [
         FieldAccessor [
-          Variable [ Name=i ]
+          Variable [ Name=$i ]
           Field=l_extendedprice
         ]
         *
@@ -352,20 +356,20 @@ LetVariable [ Name=revenue ]
           LiteralExpr [LONG] [1]
           -
           FieldAccessor [
-            Variable [ Name=i ]
+            Variable [ Name=$i ]
             Field=l_discount
           ]
         ]
       ]
       ]
-      FROM [        Variable [ Name=locn ]
+      FROM [        Variable [ Name=$locn ]
         AS
-        Variable [ Name=i ]
+        Variable [ Name=$i ]
       ]
     )
   ]
 Orderby
-  Variable [ Name=revenue ]
+  Variable [ Name=$revenue ]
   DESC
 
 Limit

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q11_important_stock/q11_important_stock.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q11_important_stock/q11_important_stock.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q11_important_stock/q11_important_stock.3.ast
index 6fb853e..a3e3830 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q11_important_stock/q11_important_stock.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q11_important_stock/q11_important_stock.3.ast
@@ -1,18 +1,18 @@
 DataverseUse tpch
 Query:
-LetVariable [ Name=sum ]
+Let Variable [ Name=$sum ]
   :=
   FunctionCall tpch.sum@1[
     (
       SELECT ELEMENT [
       OperatorExpr [
         FieldAccessor [
-          Variable [ Name=ps ]
+          Variable [ Name=$ps ]
           Field=ps_supplycost
         ]
         *
         FieldAccessor [
-          Variable [ Name=ps ]
+          Variable [ Name=$ps ]
           Field=ps_availqty
         ]
       ]
@@ -21,7 +21,7 @@ LetVariable [ Name=sum ]
           LiteralExpr [STRING] [Partsupp]
         ]
         AS
-        Variable [ Name=ps ]
+        Variable [ Name=$ps ]
 ,
         (
           SELECT ELEMENT [
@@ -30,7 +30,7 @@ LetVariable [ Name=sum ]
               LiteralExpr [STRING] [s_suppkey]
               :
               FieldAccessor [
-                Variable [ Name=s ]
+                Variable [ Name=$s ]
                 Field=s_suppkey
               ]
             )
@@ -40,39 +40,39 @@ LetVariable [ Name=sum ]
               LiteralExpr [STRING] [Supplier]
             ]
             AS
-            Variable [ Name=s ]
+            Variable [ Name=$s ]
 ,
             FunctionCall Metadata.dataset@1[
               LiteralExpr [STRING] [Nation]
             ]
             AS
-            Variable [ Name=n ]
+            Variable [ Name=$n ]
           ]
           Where
             OperatorExpr [
               FieldAccessor [
-                Variable [ Name=s ]
+                Variable [ Name=$s ]
                 Field=s_nationkey
               ]
               =
               FieldAccessor [
-                Variable [ Name=n ]
+                Variable [ Name=$n ]
                 Field=n_nationkey
               ]
             ]
         )
         AS
-        Variable [ Name=sn ]
+        Variable [ Name=$sn ]
       ]
       Where
         OperatorExpr [
           FieldAccessor [
-            Variable [ Name=ps ]
+            Variable [ Name=$ps ]
             Field=ps_suppkey
           ]
           =
           FieldAccessor [
-            Variable [ Name=sn ]
+            Variable [ Name=$sn ]
             Field=s_suppkey
           ]
         ]
@@ -84,7 +84,7 @@ RecordConstructor [
     LiteralExpr [STRING] [partkey]
     :
     FieldAccessor [
-      Variable [ Name=t1 ]
+      Variable [ Name=$t1 ]
       Field=ps_partkey
     ]
   )
@@ -92,7 +92,7 @@ RecordConstructor [
     LiteralExpr [STRING] [part_value]
     :
     FieldAccessor [
-      Variable [ Name=t1 ]
+      Variable [ Name=$t1 ]
       Field=part_value
     ]
   )
@@ -104,7 +104,7 @@ FROM [  (
       (
         LiteralExpr [STRING] [ps_partkey]
         :
-        Variable [ Name=ps_partkey ]
+        Variable [ Name=$ps_partkey ]
       )
       (
         LiteralExpr [STRING] [part_value]
@@ -114,19 +114,19 @@ FROM [  (
             SELECT ELEMENT [
             OperatorExpr [
               FieldAccessor [
-                Variable [ Name=i ]
+                Variable [ Name=$i ]
                 Field=ps_supplycost
               ]
               *
               FieldAccessor [
-                Variable [ Name=i ]
+                Variable [ Name=$i ]
                 Field=ps_availqty
               ]
             ]
             ]
-            FROM [              Variable [ Name=ps ]
+            FROM [              Variable [ Name=$ps ]
               AS
-              Variable [ Name=i ]
+              Variable [ Name=$i ]
             ]
           )
         ]
@@ -137,7 +137,7 @@ FROM [  (
         LiteralExpr [STRING] [Partsupp]
       ]
       AS
-      Variable [ Name=ps ]
+      Variable [ Name=$ps ]
 ,
       (
         SELECT ELEMENT [
@@ -146,7 +146,7 @@ FROM [  (
             LiteralExpr [STRING] [s_suppkey]
             :
             FieldAccessor [
-              Variable [ Name=s ]
+              Variable [ Name=$s ]
               Field=s_suppkey
             ]
           )
@@ -156,74 +156,80 @@ FROM [  (
             LiteralExpr [STRING] [Supplier]
           ]
           AS
-          Variable [ Name=s ]
+          Variable [ Name=$s ]
 ,
           FunctionCall Metadata.dataset@1[
             LiteralExpr [STRING] [Nation]
           ]
           AS
-          Variable [ Name=n ]
+          Variable [ Name=$n ]
         ]
         Where
           OperatorExpr [
             FieldAccessor [
-              Variable [ Name=s ]
+              Variable [ Name=$s ]
               Field=s_nationkey
             ]
             =
             FieldAccessor [
-              Variable [ Name=n ]
+              Variable [ Name=$n ]
               Field=n_nationkey
             ]
           ]
       )
       AS
-      Variable [ Name=sn ]
+      Variable [ Name=$sn ]
     ]
     Where
       OperatorExpr [
         FieldAccessor [
-          Variable [ Name=ps ]
+          Variable [ Name=$ps ]
           Field=ps_suppkey
         ]
         =
         FieldAccessor [
-          Variable [ Name=sn ]
+          Variable [ Name=$sn ]
           Field=s_suppkey
         ]
       ]
     Groupby
-      Variable [ Name=ps_partkey ]
+      Variable [ Name=$ps_partkey ]
       :=
       FieldAccessor [
-        Variable [ Name=ps ]
+        Variable [ Name=$ps ]
         Field=ps_partkey
       ]
-      With
-      Variable [ Name=ps ]
-      Variable [ Name=sn ]
-      Variable [ Name=sum ]
+      GROUP AS
+      Variable [ Name=#1 ]
+      (
+      Variable [ Name=$sn ]
+       AS sn
+      Variable [ Name=$ps ]
+       AS ps
+      Variable [ Name=$sum ]
+       AS sum
+      )
 
   )
   AS
-  Variable [ Name=t1 ]
+  Variable [ Name=$t1 ]
 ]
 Where
   OperatorExpr [
     FieldAccessor [
-      Variable [ Name=t1 ]
+      Variable [ Name=$t1 ]
       Field=part_value
     ]
     >
     OperatorExpr [
-      Variable [ Name=sum ]
+      Variable [ Name=$sum ]
       *
       LiteralExpr [DOUBLE] [1.0E-5]
     ]
   ]
 Orderby
   FieldAccessor [
-    Variable [ Name=t1 ]
+    Variable [ Name=$t1 ]
     Field=part_value
   ]
   DESC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q12_shipping/q12_shipping.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q12_shipping/q12_shipping.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q12_shipping/q12_shipping.3.ast
index c478139..6150bd4 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q12_shipping/q12_shipping.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q12_shipping/q12_shipping.3.ast
@@ -5,7 +5,7 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [l_shipmode]
     :
-    Variable [ Name=l_shipmode ]
+    Variable [ Name=$l_shipmode ]
   )
   (
     LiteralExpr [STRING] [high_line_count]
@@ -17,7 +17,7 @@ RecordConstructor [
           OperatorExpr [
             OperatorExpr [
               FieldAccessor [
-                Variable [ Name=i ]
+                Variable [ Name=$i ]
                 Field=o_orderpriority
               ]
               =
@@ -26,7 +26,7 @@ RecordConstructor [
             or
             OperatorExpr [
               FieldAccessor [
-                Variable [ Name=i ]
+                Variable [ Name=$i ]
                 Field=o_orderpriority
               ]
               =
@@ -39,9 +39,9 @@ RecordConstructor [
           LiteralExpr [LONG] [0]
         ]
         ]
-        FROM [          Variable [ Name=o ]
+        FROM [          Variable [ Name=$o ]
           AS
-          Variable [ Name=i ]
+          Variable [ Name=$i ]
         ]
       )
     ]
@@ -56,7 +56,7 @@ RecordConstructor [
           OperatorExpr [
             OperatorExpr [
               FieldAccessor [
-                Variable [ Name=i ]
+                Variable [ Name=$i ]
                 Field=o_orderpriority
               ]
               =
@@ -65,7 +65,7 @@ RecordConstructor [
             or
             OperatorExpr [
               FieldAccessor [
-                Variable [ Name=i ]
+                Variable [ Name=$i ]
                 Field=o_orderpriority
               ]
               =
@@ -78,9 +78,9 @@ RecordConstructor [
           LiteralExpr [LONG] [1]
         ]
         ]
-        FROM [          Variable [ Name=o ]
+        FROM [          Variable [ Name=$o ]
           AS
-          Variable [ Name=i ]
+          Variable [ Name=$i ]
         ]
       )
     ]
@@ -91,55 +91,55 @@ FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [LineItem]
   ]
   AS
-  Variable [ Name=l ]
+  Variable [ Name=$l ]
 ,
   FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Orders]
   ]
   AS
-  Variable [ Name=o ]
+  Variable [ Name=$o ]
 ]
 Where
   OperatorExpr [
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=o ]
+        Variable [ Name=$o ]
         Field=o_orderkey
       ]
       =
       FieldAccessor [
-        Variable [ Name=l ]
+        Variable [ Name=$l ]
         Field=l_orderkey
       ]
     ]
     and
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=l ]
+        Variable [ Name=$l ]
         Field=l_commitdate
       ]
       <
       FieldAccessor [
-        Variable [ Name=l ]
+        Variable [ Name=$l ]
         Field=l_receiptdate
       ]
     ]
     and
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=l ]
+        Variable [ Name=$l ]
         Field=l_shipdate
       ]
       <
       FieldAccessor [
-        Variable [ Name=l ]
+        Variable [ Name=$l ]
         Field=l_commitdate
       ]
     ]
     and
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=l ]
+        Variable [ Name=$l ]
         Field=l_receiptdate
       ]
       >=
@@ -148,7 +148,7 @@ Where
     and
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=l ]
+        Variable [ Name=$l ]
         Field=l_receiptdate
       ]
       <
@@ -158,7 +158,7 @@ Where
     OperatorExpr [
       OperatorExpr [
         FieldAccessor [
-          Variable [ Name=l ]
+          Variable [ Name=$l ]
           Field=l_shipmode
         ]
         =
@@ -167,7 +167,7 @@ Where
       or
       OperatorExpr [
         FieldAccessor [
-          Variable [ Name=l ]
+          Variable [ Name=$l ]
           Field=l_shipmode
         ]
         =
@@ -176,17 +176,22 @@ Where
     ]
   ]
 Groupby
-  Variable [ Name=l_shipmode ]
+  Variable [ Name=$l_shipmode ]
   :=
   FieldAccessor [
-    Variable [ Name=l ]
+    Variable [ Name=$l ]
     Field=l_shipmode
   ]
-  With
-  Variable [ Name=l ]
-  Variable [ Name=o ]
+  GROUP AS
+  Variable [ Name=#1 ]
+  (
+  Variable [ Name=$o ]
+   AS o
+  Variable [ Name=$l ]
+   AS l
+  )
 
 Orderby
-  Variable [ Name=l_shipmode ]
+  Variable [ Name=$l_shipmode ]
   ASC
 

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q13_customer_distribution/q13_customer_distribution.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q13_customer_distribution/q13_customer_distribution.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q13_customer_distribution/q13_customer_distribution.3.ast
index 2b22632..040038c 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q13_customer_distribution/q13_customer_distribution.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q13_customer_distribution/q13_customer_distribution.3.ast
@@ -6,12 +6,12 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [c_count]
     :
-    Variable [ Name=c_count ]
+    Variable [ Name=$c_count ]
   )
   (
     LiteralExpr [STRING] [custdist]
     :
-    Variable [ Name=custdist ]
+    Variable [ Name=$custdist ]
   )
 ]
 ]
@@ -21,7 +21,7 @@ FROM [  (
       (
         LiteralExpr [STRING] [c_custkey]
         :
-        Variable [ Name=c_custkey ]
+        Variable [ Name=$c_custkey ]
       )
       (
         LiteralExpr [STRING] [c_count]
@@ -30,13 +30,13 @@ FROM [  (
           (
             SELECT ELEMENT [
             FieldAccessor [
-              Variable [ Name=i ]
+              Variable [ Name=$i ]
               Field=o_orderkey_count
             ]
             ]
-            FROM [              Variable [ Name=co ]
+            FROM [              Variable [ Name=$co ]
               AS
-              Variable [ Name=i ]
+              Variable [ Name=$i ]
             ]
           )
         ]
@@ -50,7 +50,7 @@ FROM [  (
             LiteralExpr [STRING] [c_custkey]
             :
             FieldAccessor [
-              Variable [ Name=c ]
+              Variable [ Name=$c ]
               Field=c_custkey
             ]
           )
@@ -61,7 +61,7 @@ FROM [  (
               (
                 SELECT ELEMENT [
                 FieldAccessor [
-                  Variable [ Name=o ]
+                  Variable [ Name=$o ]
                   Field=o_orderkey
                 ]
                 ]
@@ -69,18 +69,18 @@ FROM [  (
                     LiteralExpr [STRING] [Orders]
                   ]
                   AS
-                  Variable [ Name=o ]
+                  Variable [ Name=$o ]
                 ]
                 Where
                   OperatorExpr [
                     OperatorExpr [
                       FieldAccessor [
-                        Variable [ Name=c ]
+                        Variable [ Name=$c ]
                         Field=c_custkey
                       ]
                       =
                       FieldAccessor [
-                        Variable [ Name=o ]
+                        Variable [ Name=$o ]
                         Field=o_custkey
                       ]
                     ]
@@ -88,7 +88,7 @@ FROM [  (
                     FunctionCall tpch.not@1[
                       FunctionCall tpch.like@2[
                         FieldAccessor [
-                          Variable [ Name=o ]
+                          Variable [ Name=$o ]
                           Field=o_comment
                         ]
                         LiteralExpr [STRING] [%special%requests%]
@@ -104,44 +104,63 @@ FROM [  (
             LiteralExpr [STRING] [Customer]
           ]
           AS
-          Variable [ Name=c ]
+          Variable [ Name=$c ]
         ]
       )
       AS
-      Variable [ Name=co ]
+      Variable [ Name=$co ]
     ]
     Groupby
-      Variable [ Name=c_custkey ]
+      Variable [ Name=$c_custkey ]
       :=
       FieldAccessor [
-        Variable [ Name=co ]
+        Variable [ Name=$co ]
         Field=c_custkey
       ]
-      With
-      Variable [ Name=co ]
+      GROUP AS
+      Variable [ Name=#1 ]
+      (
+      Variable [ Name=$co ]
+       AS co
+      )
 
   )
   AS
-  Variable [ Name=gco ]
+  Variable [ Name=$gco ]
 ]
 Groupby
-  Variable [ Name=c_count ]
+  Variable [ Name=$c_count ]
   :=
   FieldAccessor [
-    Variable [ Name=gco ]
+    Variable [ Name=$gco ]
     Field=c_count
   ]
-  With
-  Variable [ Name=gco ]
+  GROUP AS
+  Variable [ Name=#2 ]
+  (
+  Variable [ Name=$gco ]
+   AS gco
+  )
 
-LetVariable [ Name=custdist ]
+Let Variable [ Name=$custdist ]
   :=
   FunctionCall tpch.count@1[
-    Variable [ Name=gco ]
+    (
+      SELECT ELEMENT [
+      FieldAccessor [
+        Variable [ Name=#3 ]
+        Field=gco
+      ]
+      ]
+      FROM [        Variable [ Name=#2 ]
+        AS
+        Variable [ Name=#3 ]
+      ]
+    )
   ]
 Orderby
-  Variable [ Name=custdist ]
+  Variable [ Name=$custdist ]
   DESC
-  Variable [ Name=c_count ]
+  Variable [ Name=$c_count ]
   DESC
 

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q14_promotion_effect/q14_promotion_effect.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q14_promotion_effect/q14_promotion_effect.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q14_promotion_effect/q14_promotion_effect.3.ast
index 57b4c73..86eb727 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q14_promotion_effect/q14_promotion_effect.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/tpch-sql-like/q14_promotion_effect/q14_promotion_effect.3.ast
@@ -10,7 +10,7 @@ OperatorExpr [
       FunctionCall tpch.switch-case@5[
         FunctionCall tpch.like@2[
           FieldAccessor [
-            Variable [ Name=i ]
+            Variable [ Name=$i ]
             Field=p_type
           ]
           LiteralExpr [STRING] [PROMO%]
@@ -18,7 +18,7 @@ OperatorExpr [
         LiteralExpr [TRUE]
         OperatorExpr [
           FieldAccessor [
-            Variable [ Name=i ]
+            Variable [ Name=$i ]
             Field=l_extendedprice
           ]
           *
@@ -26,7 +26,7 @@ OperatorExpr [
             LiteralExpr [LONG] [1]
             -
             FieldAccessor [
-              Variable [ Name=i ]
+              Variable [ Name=$i ]
               Field=l_discount
             ]
           ]
@@ -35,9 +35,9 @@ OperatorExpr [
         LiteralExpr [DOUBLE] [0.0]
       ]
       ]
-      FROM [        Variable [ Name=l ]
+      FROM [        Variable [ Name=$lp ]
         AS
-        Variable [ Name=i ]
+        Variable [ Name=$i ]
       ]
     )
   ]
@@ -47,7 +47,7 @@ OperatorExpr [
       SELECT ELEMENT [
       OperatorExpr [
         FieldAccessor [
-          Variable [ Name=i ]
+          Variable [ Name=$i ]
           Field=l_extendedprice
         ]
         *
@@ -55,15 +55,15 @@ OperatorExpr [
           LiteralExpr [LONG] [1]
           -
           FieldAccessor [
-            Variable [ Name=i ]
+            Variable [ Name=$i ]
             Field=l_discount
           ]
         ]
       ]
       ]
-      FROM [        Variable [ Name=l ]
+      FROM [        Variable [ Name=$lp ]
         AS
-        Variable [ Name=i ]
+        Variable [ Name=$i ]
       ]
     )
   ]
@@ -73,31 +73,59 @@ FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [LineItem]
   ]
   AS
-  Variable [ Name=l ]
+  Variable [ Name=$l ]
 ,
   FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Part]
   ]
   AS
-  Variable [ Name=p ]
+  Variable [ Name=$p ]
 ]
+Let Variable [ Name=$lp ]
+  :=
+  RecordConstructor [
+    (
+      LiteralExpr [STRING] [p_type]
+      :
+      FieldAccessor [
+        Variable [ Name=$p ]
+        Field=p_type
+      ]
+    )
+    (
+      LiteralExpr [STRING] [l_extendedprice]
+      :
+      FieldAccessor [
+        Variable [ Name=$l ]
+        Field=l_extendedprice
+      ]
+    )
+    (
+      LiteralExpr [STRING] [l_discount]
+      :
+      FieldAccessor [
+        Variable [ Name=$l ]
+        Field=l_discount
+      ]
+    )
+  ]
 Where
   OperatorExpr [
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=l ]
+        Variable [ Name=$l ]
         Field=l_partkey
       ]
       =
       FieldAccessor [
-        Variable [ Name=p ]
+        Variable [ Name=$p ]
         Field=p_partkey
       ]
     ]
     and
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=l ]
+        Variable [ Name=$l ]
         Field=l_shipdate
       ]
       >=
@@ -106,7 +134,7 @@ Where
     and
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=l ]
+        Variable [ Name=$l ]
         Field=l_shipdate
       ]
       <
@@ -114,10 +142,17 @@ Where
     ]
   ]
 Groupby
-  Variable [ Name=t ]
+  Variable [ Name=$t ]
   :=
   LiteralExpr [LONG] [1]
-  With
-  Variable [ Name=p ]
-  Variable [ Name=l ]
+  GROUP AS
+  Variable [ Name=#1 ]
+  (
+  Variable [ Name=$lp ]
+   AS lp
+  Variable [ Name=$p ]
+   AS p
+  Variable [ Name=$l ]
+   AS l
+  )
 


Mime
View raw message