asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From buyin...@apache.org
Subject [48/51] [partial] incubator-asterixdb git commit: ASTERIXDB-1226: implement SQL++ core group-by semantics and syntatic sugars.
Date Mon, 28 Mar 2016 20:19:15 GMT
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/btree-index/btree-secondary-60.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/btree-index/btree-secondary-60.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/btree-index/btree-secondary-60.ast
index c002770..eb2ef9d 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/btree-index/btree-secondary-60.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/btree-index/btree-secondary-60.ast
@@ -10,18 +10,18 @@ TypeDecl TestType [
 DatasetDecl testdst(TestType) partitioned by [[id]]
 Query:
 SELECT ELEMENT [
-Variable [ Name=emp ]
+Variable [ Name=$emp ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [testdst]
   ]
   AS
-  Variable [ Name=emp ]
+  Variable [ Name=$emp ]
 ]
 Where
   OperatorExpr [
     FieldAccessor [
-      Variable [ Name=emp ]
+      Variable [ Name=$emp ]
       Field=fname
     ]
     =

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/btree-index/btree-secondary-61.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/btree-index/btree-secondary-61.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/btree-index/btree-secondary-61.ast
index 82f5967..ef77d3d 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/btree-index/btree-secondary-61.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/btree-index/btree-secondary-61.ast
@@ -10,19 +10,19 @@ TypeDecl TestType [
 DatasetDecl testdst(TestType) partitioned by [[id]]
 Query:
 SELECT ELEMENT [
-Variable [ Name=emp ]
+Variable [ Name=$emp ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [testdst]
   ]
   AS
-  Variable [ Name=emp ]
+  Variable [ Name=$emp ]
 ]
 Where
   OperatorExpr [
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=emp ]
+        Variable [ Name=$emp ]
         Field=fname
       ]
       >
@@ -31,7 +31,7 @@ Where
     and
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=emp ]
+        Variable [ Name=$emp ]
         Field=lname
       ]
       >
@@ -40,7 +40,7 @@ Where
     and
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=emp ]
+        Variable [ Name=$emp ]
         Field=fname
       ]
       <=
@@ -49,7 +49,7 @@ Where
     and
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=emp ]
+        Variable [ Name=$emp ]
         Field=lname
       ]
       <

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/btree-index/btree-secondary-62.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/btree-index/btree-secondary-62.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/btree-index/btree-secondary-62.ast
index 6c787a7..88655f2 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/btree-index/btree-secondary-62.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/btree-index/btree-secondary-62.ast
@@ -10,19 +10,19 @@ TypeDecl TestType [
 DatasetDecl testdst(TestType) partitioned by [[id]]
 Query:
 SELECT ELEMENT [
-Variable [ Name=emp ]
+Variable [ Name=$emp ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [testdst]
   ]
   AS
-  Variable [ Name=emp ]
+  Variable [ Name=$emp ]
 ]
 Where
   OperatorExpr [
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=emp ]
+        Variable [ Name=$emp ]
         Field=fname
       ]
       =
@@ -31,7 +31,7 @@ Where
     and
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=emp ]
+        Variable [ Name=$emp ]
         Field=lname
       ]
       >

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/btree-index/btree-secondary-63.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/btree-index/btree-secondary-63.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/btree-index/btree-secondary-63.ast
index bc515e5..d858883 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/btree-index/btree-secondary-63.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/btree-index/btree-secondary-63.ast
@@ -10,19 +10,19 @@ TypeDecl TestType [
 DatasetDecl testdst(TestType) partitioned by [[id]]
 Query:
 SELECT ELEMENT [
-Variable [ Name=emp ]
+Variable [ Name=$emp ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [testdst]
   ]
   AS
-  Variable [ Name=emp ]
+  Variable [ Name=$emp ]
 ]
 Where
   OperatorExpr [
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=emp ]
+        Variable [ Name=$emp ]
         Field=fname
       ]
       <
@@ -31,7 +31,7 @@ Where
     and
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=emp ]
+        Variable [ Name=$emp ]
         Field=lname
       ]
       =

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/collocated.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/collocated.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/collocated.ast
index 0c5b63a..3bdd7a4 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/collocated.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/collocated.ast
@@ -25,7 +25,7 @@ RecordConstructor [
     LiteralExpr [STRING] [user_name]
     :
     FieldAccessor [
-      Variable [ Name=user ]
+      Variable [ Name=$user ]
       Field=name
     ]
   )
@@ -33,7 +33,7 @@ RecordConstructor [
     LiteralExpr [STRING] [visitor_name]
     :
     FieldAccessor [
-      Variable [ Name=visitor ]
+      Variable [ Name=$visitor ]
       Field=name
     ]
   )
@@ -43,23 +43,23 @@ FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Users]
   ]
   AS
-  Variable [ Name=user ]
+  Variable [ Name=$user ]
 ,
   FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Visitors]
   ]
   AS
-  Variable [ Name=visitor ]
+  Variable [ Name=$visitor ]
 ]
 Where
   OperatorExpr [
     FieldAccessor [
-      Variable [ Name=user ]
+      Variable [ Name=$user ]
       Field=uid
     ]
     =
     FieldAccessor [
-      Variable [ Name=visitor ]
+      Variable [ Name=$visitor ]
       Field=vid
     ]
   ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/consolidate-selects-complex.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/consolidate-selects-complex.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/consolidate-selects-complex.ast
index aeb9d72..3082677 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/consolidate-selects-complex.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/consolidate-selects-complex.ast
@@ -16,12 +16,12 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [Paper]
     :
-    Variable [ Name=paper_tokens ]
+    Variable [ Name=$paper_tokens ]
   )
   (
     LiteralExpr [STRING] [Query]
     :
-    Variable [ Name=query_tokens ]
+    Variable [ Name=$query_tokens ]
   )
 ]
 ]
@@ -29,62 +29,62 @@ FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=paper ]
+  Variable [ Name=$paper ]
 ]
-LetVariable [ Name=paper_tokens ]
+Let Variable [ Name=$paper_tokens ]
   :=
   FunctionCall test.word-tokens@1[
     FieldAccessor [
-      Variable [ Name=paper ]
+      Variable [ Name=$paper ]
       Field=title
     ]
   ]
-LetVariable [ Name=query_tokens ]
+Let Variable [ Name=$query_tokens ]
   :=
   FunctionCall test.word-tokens@1[
     LiteralExpr [STRING] [Transactions for Cooperative Environments]
   ]
-LetVariable [ Name=jacca ]
+Let Variable [ Name=$jacca ]
   :=
   FunctionCall test.similarity-jaccard-check@3[
-    Variable [ Name=paper_tokens ]
-    Variable [ Name=query_tokens ]
+    Variable [ Name=$paper_tokens ]
+    Variable [ Name=$query_tokens ]
     LiteralExpr [FLOAT] [0.8]
   ]
-LetVariable [ Name=jaccb ]
+Let Variable [ Name=$jaccb ]
   :=
   FunctionCall test.similarity-jaccard-check@3[
-    Variable [ Name=paper_tokens ]
-    Variable [ Name=query_tokens ]
+    Variable [ Name=$paper_tokens ]
+    Variable [ Name=$query_tokens ]
     LiteralExpr [FLOAT] [0.5]
   ]
-LetVariable [ Name=jaccc ]
+Let Variable [ Name=$jaccc ]
   :=
   FunctionCall test.similarity-jaccard-check@3[
-    Variable [ Name=paper_tokens ]
-    Variable [ Name=query_tokens ]
+    Variable [ Name=$paper_tokens ]
+    Variable [ Name=$query_tokens ]
     LiteralExpr [FLOAT] [0.3]
   ]
 Where
   OperatorExpr [
     IndexAccessor [
-      Variable [ Name=jacca ]
+      Variable [ Name=$jacca ]
       Index:       LiteralExpr [LONG] [0]
     ]
     and
     IndexAccessor [
-      Variable [ Name=jaccb ]
+      Variable [ Name=$jaccb ]
       Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=paper ]
+        Variable [ Name=$paper ]
         Field=authors
       ]
       =
       LiteralExpr [STRING] [testauth]
     ]
     and
-    Variable [ Name=jaccc ]
+    Variable [ Name=$jaccc ]
   ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/consolidate-selects-simple.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/consolidate-selects-simple.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/consolidate-selects-simple.ast
index a1f58f9..3b3e1ec 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/consolidate-selects-simple.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/consolidate-selects-simple.ast
@@ -15,19 +15,19 @@ DatasetDecl Customers(CustomerType) partitioned by [[c_custkey]]
 WriteOutputTo asterix_nc1:rttest/consolidate-selects-simple.aql
 Query:
 SELECT ELEMENT [
-Variable [ Name=c ]
+Variable [ Name=$c ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Customers]
   ]
   AS
-  Variable [ Name=c ]
+  Variable [ Name=$c ]
 ]
 Where
   OperatorExpr [
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=c ]
+        Variable [ Name=$c ]
         Field=c_name
       ]
       =
@@ -36,7 +36,7 @@ Where
     and
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=c ]
+        Variable [ Name=$c ]
         Field=c_address
       ]
       =
@@ -45,7 +45,7 @@ Where
     and
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=c ]
+        Variable [ Name=$c ]
         Field=c_nationkey
       ]
       =
@@ -54,7 +54,7 @@ Where
     and
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=c ]
+        Variable [ Name=$c ]
         Field=c_phone
       ]
       =

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/count-tweets.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/count-tweets.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/count-tweets.ast
index 8788c8d..b4dd527 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/count-tweets.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/count-tweets.ast
@@ -16,13 +16,24 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [word]
     :
-    Variable [ Name=tok ]
+    Variable [ Name=$tok ]
   )
   (
     LiteralExpr [STRING] [count]
     :
     FunctionCall twitter.count@1[
-      Variable [ Name=token ]
+      (
+        SELECT ELEMENT [
+        FieldAccessor [
+          Variable [ Name=#2 ]
+          Field=token
+        ]
+        ]
+        FROM [          Variable [ Name=#1 ]
+          AS
+          Variable [ Name=#2 ]
+        ]
+      )
     ]
   )
 ]
@@ -31,28 +42,34 @@ FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [TwitterData]
   ]
   AS
-  Variable [ Name=t ]
+  Variable [ Name=$t ]
 ,
   FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [tokens]
   ]
   AS
-  Variable [ Name=token ]
+  Variable [ Name=$token ]
 ]
-LetVariable [ Name=tokens ]
+Let Variable [ Name=$tokens ]
   :=
   FunctionCall twitter.word-tokens@1[
     FieldAccessor [
-      Variable [ Name=t ]
+      Variable [ Name=$t ]
       Field=text
     ]
   ]
 Groupby
-  Variable [ Name=tok ]
+  Variable [ Name=$tok ]
   :=
-  Variable [ Name=token ]
-  With
-  Variable [ Name=tokens ]
-  Variable [ Name=t ]
-  Variable [ Name=token ]
+  Variable [ Name=$token ]
+  GROUP AS
+  Variable [ Name=#1 ]
+  (
+  Variable [ Name=$tokens ]
+   AS tokens
+  Variable [ Name=$token ]
+   AS token
+  Variable [ Name=$t ]
+   AS t
+  )
 

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/cust_group_no_agg.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/cust_group_no_agg.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/cust_group_no_agg.ast
index edbb7b3..7157aa2 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/cust_group_no_agg.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/cust_group_no_agg.ast
@@ -15,21 +15,25 @@ DatasetDecl Customers(CustomerType) partitioned by [[c_custkey]]
 WriteOutputTo asterix_nc1:/tmp/.adm
 Query:
 SELECT ELEMENT [
-Variable [ Name=name ]
+Variable [ Name=$name ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Customers]
   ]
   AS
-  Variable [ Name=c ]
+  Variable [ Name=$c ]
 ]
 Groupby
-  Variable [ Name=name ]
+  Variable [ Name=$name ]
   :=
   FieldAccessor [
-    Variable [ Name=c ]
+    Variable [ Name=$c ]
     Field=c_name
   ]
-  With
-  Variable [ Name=c ]
+  GROUP AS
+  Variable [ Name=#1 ]
+  (
+  Variable [ Name=$c ]
+   AS c
+  )
 

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/denorm-cust-order.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/denorm-cust-order.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/denorm-cust-order.ast
index 76345c9..e734a11 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/denorm-cust-order.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/denorm-cust-order.ast
@@ -38,7 +38,7 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [cid]
     :
-    Variable [ Name=cid ]
+    Variable [ Name=$cid ]
   )
   (
     LiteralExpr [STRING] [cust]
@@ -51,13 +51,24 @@ RecordConstructor [
     LiteralExpr [STRING] [cnt-orders]
     :
     FunctionCall custorder.count@1[
-      Variable [ Name=o ]
+      (
+        SELECT ELEMENT [
+        FieldAccessor [
+          Variable [ Name=#2 ]
+          Field=o
+        ]
+        ]
+        FROM [          Variable [ Name=#1 ]
+          AS
+          Variable [ Name=#2 ]
+        ]
+      )
     ]
   )
   (
     LiteralExpr [STRING] [orders]
     :
-    Variable [ Name=o ]
+    Variable [ Name=$o ]
   )
 ]
 ]
@@ -65,34 +76,39 @@ FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Customers]
   ]
   AS
-  Variable [ Name=c ]
+  Variable [ Name=$c ]
 ,
   FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Orders]
   ]
   AS
-  Variable [ Name=o ]
+  Variable [ Name=$o ]
 ]
 Where
   OperatorExpr [
     FieldAccessor [
-      Variable [ Name=c ]
+      Variable [ Name=$c ]
       Field=cid
     ]
     =
     FieldAccessor [
-      Variable [ Name=o ]
+      Variable [ Name=$o ]
       Field=cid
     ]
   ]
 Groupby
-  Variable [ Name=cid ]
+  Variable [ Name=$cid ]
   :=
   FieldAccessor [
-    Variable [ Name=c ]
+    Variable [ Name=$c ]
     Field=cid
   ]
-  With
-  Variable [ Name=c ]
-  Variable [ Name=o ]
+  GROUP AS
+  Variable [ Name=#1 ]
+  (
+  Variable [ Name=$o ]
+   AS o
+  Variable [ Name=$c ]
+   AS c
+  )
 

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/distinct_aggregate.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/distinct_aggregate.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/distinct_aggregate.ast
index 6c38372..0ef35c0 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/distinct_aggregate.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/distinct_aggregate.ast
@@ -27,18 +27,29 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [l_returnflag]
     :
-    Variable [ Name=l_returnflag ]
+    Variable [ Name=$l_returnflag ]
   )
   (
     LiteralExpr [STRING] [l_linestatus]
     :
-    Variable [ Name=l_linestatus ]
+    Variable [ Name=$l_linestatus ]
   )
   (
     LiteralExpr [STRING] [count_suppkey]
     :
     FunctionCall tpch.count@1[
-      Variable [ Name=g ]
+      (
+        SELECT ELEMENT [
+        FieldAccessor [
+          Variable [ Name=#3 ]
+          Field=g
+        ]
+        ]
+        FROM [          Variable [ Name=#2 ]
+          AS
+          Variable [ Name=#3 ]
+        ]
+      )
     ]
   )
 ]
@@ -49,17 +60,17 @@ FROM [  (
       (
         LiteralExpr [STRING] [l_returnflag]
         :
-        Variable [ Name=l_returnflag ]
+        Variable [ Name=$l_returnflag ]
       )
       (
         LiteralExpr [STRING] [l_linestatus]
         :
-        Variable [ Name=l_linestatus ]
+        Variable [ Name=$l_linestatus ]
       )
       (
         LiteralExpr [STRING] [l_suppkey]
         :
-        Variable [ Name=l_suppkey ]
+        Variable [ Name=$l_suppkey ]
       )
     ]
     ]
@@ -67,62 +78,70 @@ FROM [  (
         LiteralExpr [STRING] [LineItems_q1]
       ]
       AS
-      Variable [ Name=l ]
+      Variable [ Name=$l ]
     ]
     Where
       OperatorExpr [
         FieldAccessor [
-          Variable [ Name=l ]
+          Variable [ Name=$l ]
           Field=l_shipdate
         ]
         <=
         LiteralExpr [STRING] [1998-09-02]
       ]
     Groupby
-      Variable [ Name=l_returnflag ]
+      Variable [ Name=$l_returnflag ]
       :=
       FieldAccessor [
-        Variable [ Name=l ]
+        Variable [ Name=$l ]
         Field=l_returnflag
       ]
-      Variable [ Name=l_linestatus ]
+      Variable [ Name=$l_linestatus ]
       :=
       FieldAccessor [
-        Variable [ Name=l ]
+        Variable [ Name=$l ]
         Field=l_linestatus
       ]
-      Variable [ Name=l_suppkey ]
+      Variable [ Name=$l_suppkey ]
       :=
       FieldAccessor [
-        Variable [ Name=l ]
+        Variable [ Name=$l ]
         Field=l_suppkey
       ]
-      With
-      Variable [ Name=l ]
+      GROUP AS
+      Variable [ Name=#1 ]
+      (
+      Variable [ Name=$l ]
+       AS l
+      )
 
   )
   AS
-  Variable [ Name=g ]
+  Variable [ Name=$g ]
 ]
 Groupby
-  Variable [ Name=l_returnflag ]
+  Variable [ Name=$l_returnflag ]
   :=
   FieldAccessor [
-    Variable [ Name=g ]
+    Variable [ Name=$g ]
     Field=l_returnflag
   ]
-  Variable [ Name=l_linestatus ]
+  Variable [ Name=$l_linestatus ]
   :=
   FieldAccessor [
-    Variable [ Name=g ]
+    Variable [ Name=$g ]
     Field=l_linestatus
   ]
-  With
-  Variable [ Name=g ]
+  GROUP AS
+  Variable [ Name=#2 ]
+  (
+  Variable [ Name=$g ]
+   AS g
+  )
 
 Orderby
-  Variable [ Name=l_returnflag ]
+  Variable [ Name=$l_returnflag ]
   ASC
-  Variable [ Name=l_linestatus ]
+  Variable [ Name=$l_linestatus ]
   ASC
 

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/filter-nested.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/filter-nested.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/filter-nested.ast
index 3152f71..5971ca5 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/filter-nested.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/filter-nested.ast
@@ -15,7 +15,7 @@ DatasetDecl testdst(TestType) partitioned by [[nested, fname]]
 Query:
 SELECT ELEMENT [
 FieldAccessor [
-  Variable [ Name=emp ]
+  Variable [ Name=$emp ]
   Field=nested
 ]
 ]
@@ -23,13 +23,13 @@ FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [testdst]
   ]
   AS
-  Variable [ Name=emp ]
+  Variable [ Name=$emp ]
 ]
 Where
   OperatorExpr [
     FieldAccessor [
       FieldAccessor [
-        Variable [ Name=emp ]
+        Variable [ Name=$emp ]
         Field=nested
       ]
       Field=lname

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/fj-dblp-csx.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/fj-dblp-csx.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/fj-dblp-csx.ast
index 9479898..8eaada8 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/fj-dblp-csx.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/fj-dblp-csx.ast
@@ -26,12 +26,12 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [idDBLP]
     :
-    Variable [ Name=idDBLP ]
+    Variable [ Name=$idDBLP ]
   )
   (
     LiteralExpr [STRING] [idCSX]
     :
-    Variable [ Name=idCSX ]
+    Variable [ Name=$idCSX ]
   )
 ]
 ]
@@ -39,54 +39,54 @@ FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=paperDBLP ]
+  Variable [ Name=$paperDBLP ]
 ,
   FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [tokensDBLP]
   ]
   AS
-  Variable [ Name=prefixTokenDBLP ]
+  Variable [ Name=$prefixTokenDBLP ]
 ,
   FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [CSX]
   ]
   AS
-  Variable [ Name=paperCSX ]
+  Variable [ Name=$paperCSX ]
 ,
   FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [tokensCSX]
   ]
   AS
-  Variable [ Name=prefixTokenCSX ]
+  Variable [ Name=$prefixTokenCSX ]
 ]
-LetVariable [ Name=idDBLP ]
+Let Variable [ Name=$idDBLP ]
   :=
   FieldAccessor [
-    Variable [ Name=paperDBLP ]
+    Variable [ Name=$paperDBLP ]
     Field=id
   ]
-LetVariable [ Name=unrankedTokensDBLP ]
+Let Variable [ Name=$unrankedTokensDBLP ]
   :=
   FunctionCall fj-dblp-csx.counthashed-word-tokens@1[
     FieldAccessor [
-      Variable [ Name=paperDBLP ]
+      Variable [ Name=$paperDBLP ]
       Field=title
     ]
   ]
-LetVariable [ Name=tokensDBLP ]
+Let Variable [ Name=$tokensDBLP ]
   :=
   (
     SELECT ELEMENT [
-    Variable [ Name=i ]
+    Variable [ Name=$i ]
     ]
-    FROM [      Variable [ Name=unrankedTokensDBLP ]
+    FROM [      Variable [ Name=$unrankedTokensDBLP ]
       AS
-      Variable [ Name=token ]
+      Variable [ Name=$token ]
 ,
       (
         SELECT ELEMENT [
         FieldAccessor [
-          Variable [ Name=paper ]
+          Variable [ Name=$paper ]
           Field=title
         ]
         ]
@@ -94,53 +94,53 @@ LetVariable [ Name=tokensDBLP ]
             LiteralExpr [STRING] [DBLP]
           ]
           AS
-          Variable [ Name=paper ]
+          Variable [ Name=$paper ]
         ]
       )
       AS
-      Variable [ Name=tokenRanked ]
+      Variable [ Name=$tokenRanked ]
       AT
-      Variable [ Name=i ]
+      Variable [ Name=$i ]
     ]
     Where
       OperatorExpr [
-        Variable [ Name=token ]
+        Variable [ Name=$token ]
         =
-        Variable [ Name=tokenRanked ]
+        Variable [ Name=$tokenRanked ]
       ]
     Orderby
-      Variable [ Name=i ]
+      Variable [ Name=$i ]
       ASC
 
   )
-LetVariable [ Name=idCSX ]
+Let Variable [ Name=$idCSX ]
   :=
   FieldAccessor [
-    Variable [ Name=paperCSX ]
+    Variable [ Name=$paperCSX ]
     Field=id
   ]
-LetVariable [ Name=unrankedTokensCSX ]
+Let Variable [ Name=$unrankedTokensCSX ]
   :=
   FunctionCall fj-dblp-csx.counthashed-word-tokens@1[
     FieldAccessor [
-      Variable [ Name=paperCSX ]
+      Variable [ Name=$paperCSX ]
       Field=title
     ]
   ]
-LetVariable [ Name=tokensCSX ]
+Let Variable [ Name=$tokensCSX ]
   :=
   (
     SELECT ELEMENT [
-    Variable [ Name=i ]
+    Variable [ Name=$i ]
     ]
-    FROM [      Variable [ Name=unrankedTokensCSX ]
+    FROM [      Variable [ Name=$unrankedTokensCSX ]
       AS
-      Variable [ Name=token ]
+      Variable [ Name=$token ]
 ,
       (
         SELECT ELEMENT [
         FieldAccessor [
-          Variable [ Name=paper ]
+          Variable [ Name=$paper ]
           Field=title
         ]
         ]
@@ -148,53 +148,66 @@ LetVariable [ Name=tokensCSX ]
             LiteralExpr [STRING] [DBLP]
           ]
           AS
-          Variable [ Name=paper ]
+          Variable [ Name=$paper ]
         ]
       )
       AS
-      Variable [ Name=tokenRanked ]
+      Variable [ Name=$tokenRanked ]
       AT
-      Variable [ Name=i ]
+      Variable [ Name=$i ]
     ]
     Where
       OperatorExpr [
-        Variable [ Name=token ]
+        Variable [ Name=$token ]
         =
-        Variable [ Name=tokenRanked ]
+        Variable [ Name=$tokenRanked ]
       ]
     Orderby
-      Variable [ Name=i ]
+      Variable [ Name=$i ]
       ASC
 
   )
 Where
   OperatorExpr [
-    Variable [ Name=prefixTokenDBLP ]
+    Variable [ Name=$prefixTokenDBLP ]
     =
-    Variable [ Name=prefixTokenCSX ]
+    Variable [ Name=$prefixTokenCSX ]
   ]
 Groupby
-  Variable [ Name=idDBLP ]
+  Variable [ Name=$idDBLP ]
   :=
-  Variable [ Name=idDBLP ]
-  Variable [ Name=idCSX ]
+  Variable [ Name=$idDBLP ]
+  Variable [ Name=$idCSX ]
   :=
-  Variable [ Name=idCSX ]
-  With
-  Variable [ Name=tokensCSX ]
-  Variable [ Name=unrankedTokensCSX ]
-  Variable [ Name=idCSX ]
-  Variable [ Name=tokensDBLP ]
-  Variable [ Name=unrankedTokensDBLP ]
-  Variable [ Name=idDBLP ]
-  Variable [ Name=paperDBLP ]
-  Variable [ Name=prefixTokenDBLP ]
-  Variable [ Name=prefixTokenCSX ]
-  Variable [ Name=paperCSX ]
+  Variable [ Name=$idCSX ]
+  GROUP AS
+  Variable [ Name=#1 ]
+  (
+  Variable [ Name=$tokensCSX ]
+   AS tokensCSX
+  Variable [ Name=$unrankedTokensCSX ]
+   AS unrankedTokensCSX
+  Variable [ Name=$idCSX ]
+   AS idCSX
+  Variable [ Name=$tokensDBLP ]
+   AS tokensDBLP
+  Variable [ Name=$unrankedTokensDBLP ]
+   AS unrankedTokensDBLP
+  Variable [ Name=$idDBLP ]
+   AS idDBLP
+  Variable [ Name=$prefixTokenCSX ]
+   AS prefixTokenCSX
+  Variable [ Name=$paperCSX ]
+   AS paperCSX
+  Variable [ Name=$prefixTokenDBLP ]
+   AS prefixTokenDBLP
+  Variable [ Name=$paperDBLP ]
+   AS paperDBLP
+  )
 
 Orderby
-  Variable [ Name=idDBLP ]
+  Variable [ Name=$idDBLP ]
   ASC
-  Variable [ Name=idCSX ]
+  Variable [ Name=$idCSX ]
   ASC
 

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/fj-phase1.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/fj-phase1.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/fj-phase1.ast
index df1d620..665925e 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/fj-phase1.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/fj-phase1.ast
@@ -25,14 +25,14 @@ RecordConstructor [
     LiteralExpr [STRING] [uid]
     :
     FieldAccessor [
-      Variable [ Name=user ]
+      Variable [ Name=$user ]
       Field=uid
     ]
   )
   (
     LiteralExpr [STRING] [tokens]
     :
-    Variable [ Name=tokens ]
+    Variable [ Name=$tokens ]
   )
 ]
 ]
@@ -40,69 +40,85 @@ FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Users]
   ]
   AS
-  Variable [ Name=user ]
+  Variable [ Name=$user ]
 ]
-LetVariable [ Name=tokens ]
+Let Variable [ Name=$tokens ]
   :=
   (
     SELECT ELEMENT [
-    Variable [ Name=i ]
+    Variable [ Name=$i ]
     ]
     FROM [      FieldAccessor [
-        Variable [ Name=user ]
+        Variable [ Name=$user ]
         Field=lottery_numbers
       ]
       AS
-      Variable [ Name=lottery_number ]
+      Variable [ Name=$lottery_number ]
 ,
       (
         SELECT ELEMENT [
-        Variable [ Name=item ]
+        Variable [ Name=$item ]
         ]
         FROM [          FunctionCall Metadata.dataset@1[
             LiteralExpr [STRING] [Users]
           ]
           AS
-          Variable [ Name=user ]
+          Variable [ Name=$user ]
 ,
           FieldAccessor [
-            Variable [ Name=user ]
+            Variable [ Name=$user ]
             Field=lottery_numbers
           ]
           AS
-          Variable [ Name=lottery_number ]
+          Variable [ Name=$lottery_number ]
         ]
         Groupby
-          Variable [ Name=item ]
+          Variable [ Name=$item ]
           :=
-          Variable [ Name=lottery_number ]
-          With
-          Variable [ Name=lottery_number ]
-          Variable [ Name=user ]
+          Variable [ Name=$lottery_number ]
+          GROUP AS
+          Variable [ Name=#1 ]
+          (
+          Variable [ Name=$lottery_number ]
+           AS lottery_number
+          Variable [ Name=$user ]
+           AS user
+          )
 
-        LetVariable [ Name=count ]
+        Let Variable [ Name=$count ]
           :=
           FunctionCall rares03.count@1[
-            Variable [ Name=user ]
+            (
+              SELECT ELEMENT [
+              FieldAccessor [
+                Variable [ Name=#2 ]
+                Field=user
+              ]
+              ]
+              FROM [                Variable [ Name=#1 ]
+                AS
+                Variable [ Name=#2 ]
+              ]
+            )
           ]
         Orderby
-          Variable [ Name=count ]
+          Variable [ Name=$count ]
           DESC
 
       )
       AS
-      Variable [ Name=token ]
+      Variable [ Name=$token ]
       AT
-      Variable [ Name=i ]
+      Variable [ Name=$i ]
     ]
     Where
       OperatorExpr [
-        Variable [ Name=lottery_number ]
+        Variable [ Name=$lottery_number ]
         =
-        Variable [ Name=token ]
+        Variable [ Name=$token ]
       ]
     Orderby
-      Variable [ Name=token ]
+      Variable [ Name=$token ]
       ASC
 
   )

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/fj-phase2-with-hints.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/fj-phase2-with-hints.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/fj-phase2-with-hints.ast
index de7bc06..d5f7086 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/fj-phase2-with-hints.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/fj-phase2-with-hints.ast
@@ -17,14 +17,14 @@ RecordConstructor [
     LiteralExpr [STRING] [id]
     :
     FieldAccessor [
-      Variable [ Name=paperDBLP ]
+      Variable [ Name=$paperDBLP ]
       Field=id
     ]
   )
   (
     LiteralExpr [STRING] [tokens]
     :
-    Variable [ Name=tokensDBLP ]
+    Variable [ Name=$tokensDBLP ]
   )
 ]
 ]
@@ -32,83 +32,101 @@ FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP_fuzzyjoin_078]
   ]
   AS
-  Variable [ Name=paperDBLP ]
+  Variable [ Name=$paperDBLP ]
 ]
-LetVariable [ Name=unrankedTokensDBLP ]
+Let Variable [ Name=$unrankedTokensDBLP ]
   :=
   FunctionCall fuzzyjoin_078.counthashed-word-tokens@1[
     FieldAccessor [
-      Variable [ Name=paperDBLP ]
+      Variable [ Name=$paperDBLP ]
       Field=title
     ]
   ]
-LetVariable [ Name=tokensDBLP ]
+Let Variable [ Name=$tokensDBLP ]
   :=
   (
     SELECT ELEMENT [
-    Variable [ Name=i ]
+    Variable [ Name=$i ]
     ]
-    FROM [      Variable [ Name=unrankedTokensDBLP ]
+    FROM [      Variable [ Name=$unrankedTokensDBLP ]
       AS
-      Variable [ Name=token ]
+      Variable [ Name=$token ]
 ,
       (
         SELECT ELEMENT [
-        Variable [ Name=tokenGroupped ]
+        Variable [ Name=$tokenGroupped ]
         ]
         FROM [          FunctionCall Metadata.dataset@1[
             LiteralExpr [STRING] [DBLP_fuzzyjoin_078]
           ]
           AS
-          Variable [ Name=paper ]
+          Variable [ Name=$paper ]
 ,
           FunctionCall fuzzyjoin_078.counthashed-word-tokens@1[
             FieldAccessor [
-              Variable [ Name=paper ]
+              Variable [ Name=$paper ]
               Field=title
             ]
           ]
           AS
-          Variable [ Name=token ]
+          Variable [ Name=$token ]
         ]
         Groupby
-          Variable [ Name=tokenGroupped ]
+          Variable [ Name=$tokenGroupped ]
           :=
-          Variable [ Name=token ]
-          With
-          Variable [ Name=paper ]
-          Variable [ Name=token ]
-          Variable [ Name=unrankedTokensDBLP ]
-          Variable [ Name=paperDBLP ]
+          Variable [ Name=$token ]
+          GROUP AS
+          Variable [ Name=#1 ]
+          (
+          Variable [ Name=$token ]
+           AS token
+          Variable [ Name=$paper ]
+           AS paper
+          Variable [ Name=$unrankedTokensDBLP ]
+           AS unrankedTokensDBLP
+          Variable [ Name=$paperDBLP ]
+           AS paperDBLP
+          )
 
         Orderby
           FunctionCall fuzzyjoin_078.count@1[
-            Variable [ Name=paper ]
+            (
+              SELECT ELEMENT [
+              FieldAccessor [
+                Variable [ Name=#2 ]
+                Field=paper
+              ]
+              ]
+              FROM [                Variable [ Name=#1 ]
+                AS
+                Variable [ Name=#2 ]
+              ]
+            )
           ]
           ASC
-          Variable [ Name=tokenGroupped ]
+          Variable [ Name=$tokenGroupped ]
           ASC
 
       )
       AS
-      Variable [ Name=tokenRanked ]
+      Variable [ Name=$tokenRanked ]
       AT
-      Variable [ Name=i ]
+      Variable [ Name=$i ]
     ]
     Where
       OperatorExpr [
-        Variable [ Name=token ]
+        Variable [ Name=$token ]
         =
-        Variable [ Name=tokenRanked ]
+        Variable [ Name=$tokenRanked ]
       ]
     Orderby
-      Variable [ Name=i ]
+      Variable [ Name=$i ]
       ASC
 
   )
 Orderby
   FieldAccessor [
-    Variable [ Name=paperDBLP ]
+    Variable [ Name=$paperDBLP ]
     Field=id
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/hashjoin-with-unnest.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/hashjoin-with-unnest.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/hashjoin-with-unnest.ast
index cb165d7..ce77f96 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/hashjoin-with-unnest.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/hashjoin-with-unnest.ast
@@ -14,12 +14,12 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [t1]
     :
-    Variable [ Name=m ]
+    Variable [ Name=$m ]
   )
   (
     LiteralExpr [STRING] [t2]
     :
-    Variable [ Name=n ]
+    Variable [ Name=$n ]
   )
 ]
 ]
@@ -27,31 +27,31 @@ FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [t1]
   ]
   AS
-  Variable [ Name=m ]
+  Variable [ Name=$m ]
 ,
   FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [t2]
   ]
   AS
-  Variable [ Name=n ]
+  Variable [ Name=$n ]
 ,
   FieldAccessor [
-    Variable [ Name=m ]
+    Variable [ Name=$m ]
     Field=hobbies
   ]
   AS
-  Variable [ Name=a ]
+  Variable [ Name=$a ]
 ,
   FieldAccessor [
-    Variable [ Name=n ]
+    Variable [ Name=$n ]
     Field=hobbies
   ]
   AS
-  Variable [ Name=b ]
+  Variable [ Name=$b ]
 ]
 Where
   OperatorExpr [
-    Variable [ Name=a ]
+    Variable [ Name=$a ]
     =
-    Variable [ Name=b ]
+    Variable [ Name=$b ]
   ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inlined_q18_large_volume_customer.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inlined_q18_large_volume_customer.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inlined_q18_large_volume_customer.ast
index 5c7a44c..c1a4237 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inlined_q18_large_volume_customer.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inlined_q18_large_volume_customer.ast
@@ -54,27 +54,27 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [c_name]
     :
-    Variable [ Name=c_name ]
+    Variable [ Name=$c_name ]
   )
   (
     LiteralExpr [STRING] [c_custkey]
     :
-    Variable [ Name=c_custkey ]
+    Variable [ Name=$c_custkey ]
   )
   (
     LiteralExpr [STRING] [o_orderkey]
     :
-    Variable [ Name=o_orderkey ]
+    Variable [ Name=$o_orderkey ]
   )
   (
     LiteralExpr [STRING] [o_orderdate]
     :
-    Variable [ Name=o_orderdate ]
+    Variable [ Name=$o_orderdate ]
   )
   (
     LiteralExpr [STRING] [o_totalprice]
     :
-    Variable [ Name=o_totalprice ]
+    Variable [ Name=$o_totalprice ]
   )
   (
     LiteralExpr [STRING] [sum_quantity]
@@ -83,13 +83,13 @@ RecordConstructor [
       (
         SELECT ELEMENT [
         FieldAccessor [
-          Variable [ Name=j ]
+          Variable [ Name=$j ]
           Field=l_quantity
         ]
         ]
-        FROM [          Variable [ Name=l ]
+        FROM [          Variable [ Name=$l ]
           AS
-          Variable [ Name=j ]
+          Variable [ Name=$j ]
         ]
       )
     ]
@@ -100,13 +100,13 @@ FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Customers]
   ]
   AS
-  Variable [ Name=c ]
+  Variable [ Name=$c ]
 ,
   FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Orders]
   ]
   AS
-  Variable [ Name=o ]
+  Variable [ Name=$o ]
 ,
   (
     SELECT ELEMENT [
@@ -114,7 +114,7 @@ FROM [  FunctionCall Metadata.dataset@1[
       (
         LiteralExpr [STRING] [l_orderkey]
         :
-        Variable [ Name=l_orderkey ]
+        Variable [ Name=$l_orderkey ]
       )
       (
         LiteralExpr [STRING] [t_sum_quantity]
@@ -123,13 +123,13 @@ FROM [  FunctionCall Metadata.dataset@1[
           (
             SELECT ELEMENT [
             FieldAccessor [
-              Variable [ Name=i ]
+              Variable [ Name=$i ]
               Field=l_quantity
             ]
             ]
-            FROM [              Variable [ Name=l ]
+            FROM [              Variable [ Name=$l ]
               AS
-              Variable [ Name=i ]
+              Variable [ Name=$i ]
             ]
           )
         ]
@@ -140,40 +140,46 @@ FROM [  FunctionCall Metadata.dataset@1[
         LiteralExpr [STRING] [LineItems]
       ]
       AS
-      Variable [ Name=l ]
+      Variable [ Name=$l ]
     ]
     Groupby
-      Variable [ Name=l_orderkey ]
+      Variable [ Name=$l_orderkey ]
       :=
       FieldAccessor [
-        Variable [ Name=l ]
+        Variable [ Name=$l ]
         Field=l_orderkey
       ]
-      With
-      Variable [ Name=l ]
-      Variable [ Name=c ]
-      Variable [ Name=o ]
+      GROUP AS
+      Variable [ Name=#1 ]
+      (
+      Variable [ Name=$l ]
+       AS l
+      Variable [ Name=$o ]
+       AS o
+      Variable [ Name=$c ]
+       AS c
+      )
 
   )
   AS
-  Variable [ Name=t ]
+  Variable [ Name=$t ]
 ,
   FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [LineItems]
   ]
   AS
-  Variable [ Name=l ]
+  Variable [ Name=$l ]
 ]
 Where
   OperatorExpr [
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=c ]
+        Variable [ Name=$c ]
         Field=c_custkey
       ]
       =
       FieldAccessor [
-        Variable [ Name=o ]
+        Variable [ Name=$o ]
         Field=o_custkey
       ]
     ]
@@ -181,19 +187,19 @@ Where
     OperatorExpr [
       OperatorExpr [
         FieldAccessor [
-          Variable [ Name=o ]
+          Variable [ Name=$o ]
           Field=o_orderkey
         ]
         =
         FieldAccessor [
-          Variable [ Name=t ]
+          Variable [ Name=$t ]
           Field=l_orderkey
         ]
       ]
       and
       OperatorExpr [
         FieldAccessor [
-          Variable [ Name=t ]
+          Variable [ Name=$t ]
           Field=t_sum_quantity
         ]
         >
@@ -203,57 +209,64 @@ Where
     and
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=l ]
+        Variable [ Name=$l ]
         Field=l_orderkey
       ]
       =
       FieldAccessor [
-        Variable [ Name=o ]
+        Variable [ Name=$o ]
         Field=o_orderkey
       ]
     ]
   ]
 Groupby
-  Variable [ Name=c_name ]
+  Variable [ Name=$c_name ]
   :=
   FieldAccessor [
-    Variable [ Name=c ]
+    Variable [ Name=$c ]
     Field=c_name
   ]
-  Variable [ Name=c_custkey ]
+  Variable [ Name=$c_custkey ]
   :=
   FieldAccessor [
-    Variable [ Name=c ]
+    Variable [ Name=$c ]
     Field=c_custkey
   ]
-  Variable [ Name=o_orderkey ]
+  Variable [ Name=$o_orderkey ]
   :=
   FieldAccessor [
-    Variable [ Name=o ]
+    Variable [ Name=$o ]
     Field=o_orderkey
   ]
-  Variable [ Name=o_orderdate ]
+  Variable [ Name=$o_orderdate ]
   :=
   FieldAccessor [
-    Variable [ Name=o ]
+    Variable [ Name=$o ]
     Field=o_orderdate
   ]
-  Variable [ Name=o_totalprice ]
+  Variable [ Name=$o_totalprice ]
   :=
   FieldAccessor [
-    Variable [ Name=o ]
+    Variable [ Name=$o ]
     Field=o_totalprice
   ]
-  With
-  Variable [ Name=c ]
-  Variable [ Name=t ]
-  Variable [ Name=l ]
-  Variable [ Name=o ]
+  GROUP AS
+  Variable [ Name=#2 ]
+  (
+  Variable [ Name=$l ]
+   AS l
+  Variable [ Name=$t ]
+   AS t
+  Variable [ Name=$o ]
+   AS o
+  Variable [ Name=$c ]
+   AS c
+  )
 
 Orderby
-  Variable [ Name=o_totalprice ]
+  Variable [ Name=$o_totalprice ]
   DESC
-  Variable [ Name=o_orderdate ]
+  Variable [ Name=$o_orderdate ]
   ASC
 
 Limit

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/introhashpartitionmerge.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/introhashpartitionmerge.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/introhashpartitionmerge.ast
index bc8eebf..c54a88a 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/introhashpartitionmerge.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/introhashpartitionmerge.ast
@@ -10,7 +10,7 @@ WriteOutputTo asterix_nc1:rttest/introhashpartitionmerge.adm
 Query:
 SELECT ELEMENT [
 FieldAccessor [
-  Variable [ Name=token2 ]
+  Variable [ Name=$token2 ]
   Field=rank
 ]
 ]
@@ -18,44 +18,44 @@ FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [TOKENSRANKEDADM]
   ]
   AS
-  Variable [ Name=token1 ]
+  Variable [ Name=$token1 ]
 ,
   (
     SELECT ELEMENT [
-    Variable [ Name=tokenRanked ]
+    Variable [ Name=$tokenRanked ]
     ]
     FROM [      FunctionCall Metadata.dataset@1[
         LiteralExpr [STRING] [TOKENSRANKEDADM]
       ]
       AS
-      Variable [ Name=tokenRanked ]
+      Variable [ Name=$tokenRanked ]
     ]
     Orderby
       FieldAccessor [
-        Variable [ Name=tokenRanked ]
+        Variable [ Name=$tokenRanked ]
         Field=rank
       ]
       ASC
 
   )
   AS
-  Variable [ Name=token2 ]
+  Variable [ Name=$token2 ]
 ]
 Where
   OperatorExpr [
     FieldAccessor [
-      Variable [ Name=token1 ]
+      Variable [ Name=$token1 ]
       Field=token
     ]
     =
     FieldAccessor [
-      Variable [ Name=token2 ]
+      Variable [ Name=$token2 ]
       Field=token
     ]
   ]
 Orderby
   FieldAccessor [
-    Variable [ Name=token2 ]
+    Variable [ Name=$token2 ]
     Field=rank
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-contains-panic.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-contains-panic.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-contains-panic.ast
index b30136e..8fb8650 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-contains-panic.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-contains-panic.ast
@@ -12,25 +12,25 @@ DatasetDecl DBLP(DBLPType) partitioned by [[id]]
 WriteOutputTo asterix_nc1:rttest/inverted-index-basic_ngram-contains-panic.adm
 Query:
 SELECT ELEMENT [
-Variable [ Name=o ]
+Variable [ Name=$o ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=o ]
+  Variable [ Name=$o ]
 ]
 Where
   FunctionCall test.contains@2[
     FieldAccessor [
-      Variable [ Name=o ]
+      Variable [ Name=$o ]
       Field=title
     ]
     LiteralExpr [STRING] [Mu]
   ]
 Orderby
   FieldAccessor [
-    Variable [ Name=o ]
+    Variable [ Name=$o ]
     Field=id
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-contains.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-contains.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-contains.ast
index 4e27860..87e800c 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-contains.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-contains.ast
@@ -12,25 +12,25 @@ DatasetDecl DBLP(DBLPType) partitioned by [[id]]
 WriteOutputTo asterix_nc1:rttest/inverted-index-basic_ngram-contains.adm
 Query:
 SELECT ELEMENT [
-Variable [ Name=o ]
+Variable [ Name=$o ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=o ]
+  Variable [ Name=$o ]
 ]
 Where
   FunctionCall test.contains@2[
     FieldAccessor [
-      Variable [ Name=o ]
+      Variable [ Name=$o ]
       Field=title
     ]
     LiteralExpr [STRING] [Multimedia]
   ]
 Orderby
   FieldAccessor [
-    Variable [ Name=o ]
+    Variable [ Name=$o ]
     Field=id
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-edit-distance-check-panic.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-edit-distance-check-panic.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-edit-distance-check-panic.ast
index 4345e17..0923370 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-edit-distance-check-panic.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-edit-distance-check-panic.ast
@@ -12,19 +12,19 @@ DatasetDecl DBLP(DBLPType) partitioned by [[id]]
 WriteOutputTo asterix_nc1:rttest/inverted-index-basic_ngram-edit-distance-check-panic.adm
 Query:
 SELECT ELEMENT [
-Variable [ Name=o ]
+Variable [ Name=$o ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=o ]
+  Variable [ Name=$o ]
 ]
-LetVariable [ Name=ed ]
+Let Variable [ Name=$ed ]
   :=
   FunctionCall test.edit-distance-check@3[
     FieldAccessor [
-      Variable [ Name=o ]
+      Variable [ Name=$o ]
       Field=authors
     ]
     LiteralExpr [STRING] [Amihay Motro]
@@ -32,6 +32,6 @@ LetVariable [ Name=ed ]
   ]
 Where
   IndexAccessor [
-    Variable [ Name=ed ]
+    Variable [ Name=$ed ]
     Index:     LiteralExpr [LONG] [0]
   ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-edit-distance-check.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-edit-distance-check.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-edit-distance-check.ast
index ce4a606..719e6dc 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-edit-distance-check.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-edit-distance-check.ast
@@ -12,19 +12,19 @@ DatasetDecl DBLP(DBLPType) partitioned by [[id]]
 WriteOutputTo asterix_nc1:rttest/inverted-index-basic_ngram-edit-distance-check.adm
 Query:
 SELECT ELEMENT [
-Variable [ Name=o ]
+Variable [ Name=$o ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=o ]
+  Variable [ Name=$o ]
 ]
 Where
   IndexAccessor [
     FunctionCall test.edit-distance-check@3[
       FieldAccessor [
-        Variable [ Name=o ]
+        Variable [ Name=$o ]
         Field=authors
       ]
       LiteralExpr [STRING] [Amihay Motro]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-edit-distance-panic.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-edit-distance-panic.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-edit-distance-panic.ast
index 39e024d..69b25e7 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-edit-distance-panic.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-edit-distance-panic.ast
@@ -12,19 +12,19 @@ DatasetDecl DBLP(DBLPType) partitioned by [[id]]
 WriteOutputTo asterix_nc1:rttest/inverted-index-basic_ngram-edit-distance-panic.adm
 Query:
 SELECT ELEMENT [
-Variable [ Name=o ]
+Variable [ Name=$o ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=o ]
+  Variable [ Name=$o ]
 ]
 Where
   OperatorExpr [
     FunctionCall test.edit-distance@2[
       FieldAccessor [
-        Variable [ Name=o ]
+        Variable [ Name=$o ]
         Field=authors
       ]
       LiteralExpr [STRING] [Amihay Motro]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-edit-distance.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-edit-distance.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-edit-distance.ast
index 3c6286f..563cd79 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-edit-distance.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-edit-distance.ast
@@ -12,19 +12,19 @@ DatasetDecl DBLP(DBLPType) partitioned by [[id]]
 WriteOutputTo asterix_nc1:rttest/inverted-index-basic_ngram-edit-distance.adm
 Query:
 SELECT ELEMENT [
-Variable [ Name=o ]
+Variable [ Name=$o ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=o ]
+  Variable [ Name=$o ]
 ]
 Where
   OperatorExpr [
     FunctionCall test.edit-distance@2[
       FieldAccessor [
-        Variable [ Name=o ]
+        Variable [ Name=$o ]
         Field=authors
       ]
       LiteralExpr [STRING] [Amihay Motro]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-fuzzyeq-edit-distance.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-fuzzyeq-edit-distance.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-fuzzyeq-edit-distance.ast
index b4036df..2f7113f 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-fuzzyeq-edit-distance.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-fuzzyeq-edit-distance.ast
@@ -14,18 +14,18 @@ Set simfunction=edit-distance
 Set simthreshold=1
 Query:
 SELECT ELEMENT [
-Variable [ Name=o ]
+Variable [ Name=$o ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=o ]
+  Variable [ Name=$o ]
 ]
 Where
   OperatorExpr [
     FieldAccessor [
-      Variable [ Name=o ]
+      Variable [ Name=$o ]
       Field=authors
     ]
     ~=

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-fuzzyeq-jaccard.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-fuzzyeq-jaccard.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-fuzzyeq-jaccard.ast
index 96a7c20..7293d9f 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-fuzzyeq-jaccard.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-fuzzyeq-jaccard.ast
@@ -15,19 +15,19 @@ Set simfunction=jaccard
 Set simthreshold=0.8f
 Query:
 SELECT ELEMENT [
-Variable [ Name=o ]
+Variable [ Name=$o ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=o ]
+  Variable [ Name=$o ]
 ]
 Where
   OperatorExpr [
     FunctionCall test.gram-tokens@3[
       FieldAccessor [
-        Variable [ Name=o ]
+        Variable [ Name=$o ]
         Field=title
       ]
       LiteralExpr [LONG] [3]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-jaccard-check.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-jaccard-check.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-jaccard-check.ast
index b6413da..043ca2d 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-jaccard-check.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-jaccard-check.ast
@@ -13,20 +13,20 @@ DatasetDecl DBLP(DBLPType) partitioned by [[id]]
 WriteOutputTo asterix_nc1:rttest/inverted-index-basic_ngram-jaccard-check.adm
 Query:
 SELECT ELEMENT [
-Variable [ Name=o ]
+Variable [ Name=$o ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=o ]
+  Variable [ Name=$o ]
 ]
 Where
   IndexAccessor [
     FunctionCall test.similarity-jaccard-check@3[
       FunctionCall test.gram-tokens@3[
         FieldAccessor [
-          Variable [ Name=o ]
+          Variable [ Name=$o ]
           Field=title
         ]
         LiteralExpr [LONG] [3]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-jaccard.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-jaccard.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-jaccard.ast
index fa52fe6..b38a521 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-jaccard.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-jaccard.ast
@@ -13,20 +13,20 @@ DatasetDecl DBLP(DBLPType) partitioned by [[id]]
 WriteOutputTo asterix_nc1:rttest/inverted-index-basic_ngram-jaccard.adm
 Query:
 SELECT ELEMENT [
-Variable [ Name=o ]
+Variable [ Name=$o ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=o ]
+  Variable [ Name=$o ]
 ]
 Where
   OperatorExpr [
     FunctionCall test.similarity-jaccard@2[
       FunctionCall test.gram-tokens@3[
         FieldAccessor [
-          Variable [ Name=o ]
+          Variable [ Name=$o ]
           Field=title
         ]
         LiteralExpr [LONG] [3]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-edit-distance-check-panic.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-edit-distance-check-panic.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-edit-distance-check-panic.ast
index 64104cf..9a3be27 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-edit-distance-check-panic.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-edit-distance-check-panic.ast
@@ -26,19 +26,19 @@ DatasetDecl Customers(CustomerType) partitioned by [[cid]]
 WriteOutputTo asterix_nc1:rttest/inverted-index-basic_olist-edit-distance-check-panic.adm
 Query:
 SELECT ELEMENT [
-Variable [ Name=c ]
+Variable [ Name=$c ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Customers]
   ]
   AS
-  Variable [ Name=c ]
+  Variable [ Name=$c ]
 ]
 Where
   IndexAccessor [
     FunctionCall test.edit-distance-check@3[
       FieldAccessor [
-        Variable [ Name=c ]
+        Variable [ Name=$c ]
         Field=interests
       ]
       OrderedListConstructor [
@@ -52,7 +52,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/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-edit-distance-check.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-edit-distance-check.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-edit-distance-check.ast
index 3de2c14..c287438 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-edit-distance-check.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-edit-distance-check.ast
@@ -26,19 +26,19 @@ DatasetDecl Customers(CustomerType) partitioned by [[cid]]
 WriteOutputTo asterix_nc1:rttest/inverted-index-basic_olist-edit-distance-check.adm
 Query:
 SELECT ELEMENT [
-Variable [ Name=c ]
+Variable [ Name=$c ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Customers]
   ]
   AS
-  Variable [ Name=c ]
+  Variable [ Name=$c ]
 ]
 Where
   IndexAccessor [
     FunctionCall test.edit-distance-check@3[
       FieldAccessor [
-        Variable [ Name=c ]
+        Variable [ Name=$c ]
         Field=interests
       ]
       OrderedListConstructor [
@@ -52,7 +52,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/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-edit-distance-panic.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-edit-distance-panic.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-edit-distance-panic.ast
index 93be9fa..a89ea63 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-edit-distance-panic.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-edit-distance-panic.ast
@@ -26,19 +26,19 @@ DatasetDecl Customers(CustomerType) partitioned by [[cid]]
 WriteOutputTo asterix_nc1:rttest/inverted-index-basic_olist-edit-distance-panic.adm
 Query:
 SELECT ELEMENT [
-Variable [ Name=c ]
+Variable [ Name=$c ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Customers]
   ]
   AS
-  Variable [ Name=c ]
+  Variable [ Name=$c ]
 ]
 Where
   OperatorExpr [
     FunctionCall test.edit-distance@2[
       FieldAccessor [
-        Variable [ Name=c ]
+        Variable [ Name=$c ]
         Field=interests
       ]
       OrderedListConstructor [
@@ -52,7 +52,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/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-edit-distance.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-edit-distance.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-edit-distance.ast
index 9e2dcae..2678e6f 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-edit-distance.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-edit-distance.ast
@@ -26,19 +26,19 @@ DatasetDecl Customers(CustomerType) partitioned by [[cid]]
 WriteOutputTo asterix_nc1:rttest/inverted-index-basic_olist-edit-distance.adm
 Query:
 SELECT ELEMENT [
-Variable [ Name=c ]
+Variable [ Name=$c ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Customers]
   ]
   AS
-  Variable [ Name=c ]
+  Variable [ Name=$c ]
 ]
 Where
   OperatorExpr [
     FunctionCall test.edit-distance@2[
       FieldAccessor [
-        Variable [ Name=c ]
+        Variable [ Name=$c ]
         Field=interests
       ]
       OrderedListConstructor [
@@ -52,7 +52,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/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-fuzzyeq-edit-distance.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-fuzzyeq-edit-distance.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-fuzzyeq-edit-distance.ast
index a50ae16..60c51d5 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-fuzzyeq-edit-distance.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-fuzzyeq-edit-distance.ast
@@ -28,18 +28,18 @@ Set simfunction=edit-distance
 Set simthreshold=1
 Query:
 SELECT ELEMENT [
-Variable [ Name=c ]
+Variable [ Name=$c ]
 ]
 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=interests
     ]
     ~=
@@ -51,7 +51,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/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-fuzzyeq-jaccard.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-fuzzyeq-jaccard.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-fuzzyeq-jaccard.ast
index 906d2cb..06f21ab 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-fuzzyeq-jaccard.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-fuzzyeq-jaccard.ast
@@ -28,18 +28,18 @@ Set simfunction=jaccard
 Set simthreshold=0.8f
 Query:
 SELECT ELEMENT [
-Variable [ Name=c ]
+Variable [ Name=$c ]
 ]
 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=interests
     ]
     ~=

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-jaccard-check.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-jaccard-check.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-jaccard-check.ast
index a4a83d9..36d3a68 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-jaccard-check.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-jaccard-check.ast
@@ -26,19 +26,19 @@ DatasetDecl Customers(CustomerType) partitioned by [[cid]]
 WriteOutputTo asterix_nc1:rttest/inverted-index-basic_olist-jaccard-check.adm
 Query:
 SELECT ELEMENT [
-Variable [ Name=c ]
+Variable [ Name=$c ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Customers]
   ]
   AS
-  Variable [ Name=c ]
+  Variable [ Name=$c ]
 ]
 Where
   IndexAccessor [
     FunctionCall test.similarity-jaccard-check@3[
       FieldAccessor [
-        Variable [ Name=c ]
+        Variable [ Name=$c ]
         Field=interests
       ]
       OrderedListConstructor [

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-jaccard.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-jaccard.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-jaccard.ast
index 2afa3e9..62ee708 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-jaccard.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-jaccard.ast
@@ -26,19 +26,19 @@ DatasetDecl Customers(CustomerType) partitioned by [[cid]]
 WriteOutputTo asterix_nc1:rttest/inverted-index-basic_olist-jaccard.adm
 Query:
 SELECT ELEMENT [
-Variable [ Name=c ]
+Variable [ Name=$c ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Customers]
   ]
   AS
-  Variable [ Name=c ]
+  Variable [ Name=$c ]
 ]
 Where
   OperatorExpr [
     FunctionCall test.similarity-jaccard@2[
       FieldAccessor [
-        Variable [ Name=c ]
+        Variable [ Name=$c ]
         Field=interests
       ]
       OrderedListConstructor [

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ulist-fuzzyeq-jaccard.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ulist-fuzzyeq-jaccard.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ulist-fuzzyeq-jaccard.ast
index 7ea8d9e..c17bafa 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ulist-fuzzyeq-jaccard.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ulist-fuzzyeq-jaccard.ast
@@ -28,18 +28,18 @@ Set simfunction=jaccard
 Set simthreshold=0.8f
 Query:
 SELECT ELEMENT [
-Variable [ Name=c ]
+Variable [ Name=$c ]
 ]
 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=interests
     ]
     ~=

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ulist-jaccard-check.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ulist-jaccard-check.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ulist-jaccard-check.ast
index d257b52..d676a98 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ulist-jaccard-check.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ulist-jaccard-check.ast
@@ -26,19 +26,19 @@ DatasetDecl Customers(CustomerType) partitioned by [[cid]]
 WriteOutputTo asterix_nc1:rttest/inverted-index-basic_ulist-jaccard.adm
 Query:
 SELECT ELEMENT [
-Variable [ Name=c ]
+Variable [ Name=$c ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Customers]
   ]
   AS
-  Variable [ Name=c ]
+  Variable [ Name=$c ]
 ]
 Where
   IndexAccessor [
     FunctionCall test.similarity-jaccard-check@3[
       FieldAccessor [
-        Variable [ Name=c ]
+        Variable [ Name=$c ]
         Field=interests
       ]
       UnorderedListConstructor [

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ulist-jaccard.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ulist-jaccard.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ulist-jaccard.ast
index 1868664..6fe9da2 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ulist-jaccard.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ulist-jaccard.ast
@@ -26,19 +26,19 @@ DatasetDecl Customers(CustomerType) partitioned by [[cid]]
 WriteOutputTo asterix_nc1:rttest/inverted-index-basic_ulist-jaccard.adm
 Query:
 SELECT ELEMENT [
-Variable [ Name=c ]
+Variable [ Name=$c ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [Customers]
   ]
   AS
-  Variable [ Name=c ]
+  Variable [ Name=$c ]
 ]
 Where
   OperatorExpr [
     FunctionCall test.similarity-jaccard@2[
       FieldAccessor [
-        Variable [ Name=c ]
+        Variable [ Name=$c ]
         Field=interests
       ]
       UnorderedListConstructor [

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/word-contains.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/word-contains.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/word-contains.ast
index 06c7a39..20c0e4d 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/word-contains.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/word-contains.ast
@@ -12,25 +12,25 @@ DatasetDecl DBLP(DBLPType) partitioned by [[id]]
 WriteOutputTo asterix_nc1:rttest/inverted-index-basic_word-contains.adm
 Query:
 SELECT ELEMENT [
-Variable [ Name=o ]
+Variable [ Name=$o ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=o ]
+  Variable [ Name=$o ]
 ]
 Where
   FunctionCall test.contains@2[
     FieldAccessor [
-      Variable [ Name=o ]
+      Variable [ Name=$o ]
       Field=title
     ]
     LiteralExpr [STRING] [Multimedia]
   ]
 Orderby
   FieldAccessor [
-    Variable [ Name=o ]
+    Variable [ Name=$o ]
     Field=id
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/word-fuzzyeq-jaccard.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/word-fuzzyeq-jaccard.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/word-fuzzyeq-jaccard.ast
index 61455c6..89251b0 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/word-fuzzyeq-jaccard.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/word-fuzzyeq-jaccard.ast
@@ -14,19 +14,19 @@ Set simfunction=jaccard
 Set simthreshold=0.5f
 Query:
 SELECT ELEMENT [
-Variable [ Name=o ]
+Variable [ Name=$o ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=o ]
+  Variable [ Name=$o ]
 ]
 Where
   OperatorExpr [
     FunctionCall test.word-tokens@1[
       FieldAccessor [
-        Variable [ Name=o ]
+        Variable [ Name=$o ]
         Field=title
       ]
     ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/word-jaccard-check.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/word-jaccard-check.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/word-jaccard-check.ast
index 87333d8..455c444 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/word-jaccard-check.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/word-jaccard-check.ast
@@ -12,20 +12,20 @@ DatasetDecl DBLP(DBLPType) partitioned by [[id]]
 WriteOutputTo asterix_nc1:rttest/inverted-index-basic_word-jaccard-check.adm
 Query:
 SELECT ELEMENT [
-Variable [ Name=o ]
+Variable [ Name=$o ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=o ]
+  Variable [ Name=$o ]
 ]
 Where
   IndexAccessor [
     FunctionCall test.similarity-jaccard-check@3[
       FunctionCall test.word-tokens@1[
         FieldAccessor [
-          Variable [ Name=o ]
+          Variable [ Name=$o ]
           Field=title
         ]
       ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/word-jaccard.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/word-jaccard.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/word-jaccard.ast
index aa497c6..157c61c 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/word-jaccard.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/word-jaccard.ast
@@ -12,20 +12,20 @@ DatasetDecl DBLP(DBLPType) partitioned by [[id]]
 WriteOutputTo asterix_nc1:rttest/inverted-index-basic_word-jaccard.adm
 Query:
 SELECT ELEMENT [
-Variable [ Name=o ]
+Variable [ Name=$o ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=o ]
+  Variable [ Name=$o ]
 ]
 Where
   OperatorExpr [
     FunctionCall test.similarity-jaccard@2[
       FunctionCall test.word-tokens@1[
         FieldAccessor [
-          Variable [ Name=o ]
+          Variable [ Name=$o ]
           Field=title
         ]
       ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.ast
index 5f0e3a2..70e1376 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.ast
@@ -12,29 +12,29 @@ DatasetDecl DBLP(DBLPType) partitioned by [[id]]
 WriteOutputTo asterix_nc1:rttest/inverted-index-complex_ngram-edit-distance-check-let-panic-nopanic_01.adm
 Query:
 SELECT ELEMENT [
-Variable [ Name=o ]
+Variable [ Name=$o ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=o ]
+  Variable [ Name=$o ]
 ]
-LetVariable [ Name=eda ]
+Let Variable [ Name=$eda ]
   :=
   FunctionCall test.edit-distance-check@3[
     FieldAccessor [
-      Variable [ Name=o ]
+      Variable [ Name=$o ]
       Field=authors
     ]
     LiteralExpr [STRING] [Amihay Motro]
     LiteralExpr [LONG] [3]
   ]
-LetVariable [ Name=edb ]
+Let Variable [ Name=$edb ]
   :=
   FunctionCall test.edit-distance-check@3[
     FieldAccessor [
-      Variable [ Name=o ]
+      Variable [ Name=$o ]
       Field=authors
     ]
     LiteralExpr [STRING] [Amihay Motro]
@@ -43,12 +43,12 @@ LetVariable [ Name=edb ]
 Where
   OperatorExpr [
     IndexAccessor [
-      Variable [ Name=eda ]
+      Variable [ Name=$eda ]
       Index:       LiteralExpr [LONG] [0]
     ]
     and
     IndexAccessor [
-      Variable [ Name=edb ]
+      Variable [ Name=$edb ]
       Index:       LiteralExpr [LONG] [0]
     ]
   ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.ast
index 0c5e916..cf61129 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.ast
@@ -12,29 +12,29 @@ DatasetDecl DBLP(DBLPType) partitioned by [[id]]
 WriteOutputTo asterix_nc1:rttest/inverted-index-complex_ngram-edit-distance-check-let-panic-nopanic_01.adm
 Query:
 SELECT ELEMENT [
-Variable [ Name=o ]
+Variable [ Name=$o ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=o ]
+  Variable [ Name=$o ]
 ]
-LetVariable [ Name=edb ]
+Let Variable [ Name=$edb ]
   :=
   FunctionCall test.edit-distance-check@3[
     FieldAccessor [
-      Variable [ Name=o ]
+      Variable [ Name=$o ]
       Field=authors
     ]
     LiteralExpr [STRING] [Amihay Motro]
     LiteralExpr [LONG] [5]
   ]
-LetVariable [ Name=eda ]
+Let Variable [ Name=$eda ]
   :=
   FunctionCall test.edit-distance-check@3[
     FieldAccessor [
-      Variable [ Name=o ]
+      Variable [ Name=$o ]
       Field=authors
     ]
     LiteralExpr [STRING] [Amihay Motro]
@@ -43,12 +43,12 @@ LetVariable [ Name=eda ]
 Where
   OperatorExpr [
     IndexAccessor [
-      Variable [ Name=edb ]
+      Variable [ Name=$edb ]
       Index:       LiteralExpr [LONG] [0]
     ]
     and
     IndexAccessor [
-      Variable [ Name=eda ]
+      Variable [ Name=$eda ]
       Index:       LiteralExpr [LONG] [0]
     ]
   ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let-panic.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let-panic.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let-panic.ast
index a063f1a..fbf5775 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let-panic.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let-panic.ast
@@ -12,19 +12,19 @@ DatasetDecl DBLP(DBLPType) partitioned by [[id]]
 WriteOutputTo asterix_nc1:rttest/inverted-index-complex_ngram-edit-distance-check-let-panic.adm
 Query:
 SELECT ELEMENT [
-Variable [ Name=o ]
+Variable [ Name=$o ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=o ]
+  Variable [ Name=$o ]
 ]
-LetVariable [ Name=ed ]
+Let Variable [ Name=$ed ]
   :=
   FunctionCall test.edit-distance-check@3[
     FieldAccessor [
-      Variable [ Name=o ]
+      Variable [ Name=$o ]
       Field=authors
     ]
     LiteralExpr [STRING] [Amihay Motro]
@@ -32,6 +32,6 @@ LetVariable [ Name=ed ]
   ]
 Where
   IndexAccessor [
-    Variable [ Name=ed ]
+    Variable [ Name=$ed ]
     Index:     LiteralExpr [LONG] [0]
   ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let.ast
index 78c46ed..9e5a08e 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let.ast
@@ -12,19 +12,19 @@ DatasetDecl DBLP(DBLPType) partitioned by [[id]]
 WriteOutputTo asterix_nc1:rttest/inverted-index-complex_ngram-edit-distance-check-let.adm
 Query:
 SELECT ELEMENT [
-Variable [ Name=o ]
+Variable [ Name=$o ]
 ]
 FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=o ]
+  Variable [ Name=$o ]
 ]
-LetVariable [ Name=ed ]
+Let Variable [ Name=$ed ]
   :=
   FunctionCall test.edit-distance-check@3[
     FieldAccessor [
-      Variable [ Name=o ]
+      Variable [ Name=$o ]
       Field=authors
     ]
     LiteralExpr [STRING] [Amihay Motro]
@@ -32,6 +32,6 @@ LetVariable [ Name=ed ]
   ]
 Where
   IndexAccessor [
-    Variable [ Name=ed ]
+    Variable [ Name=$ed ]
     Index:     LiteralExpr [LONG] [0]
   ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-substring.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-substring.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-substring.ast
index 7b33e08..e3f9037 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-substring.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-substring.ast
@@ -17,7 +17,7 @@ RecordConstructor [
     LiteralExpr [STRING] [id]
     :
     FieldAccessor [
-      Variable [ Name=paper ]
+      Variable [ Name=$paper ]
       Field=id
     ]
   )
@@ -25,7 +25,7 @@ RecordConstructor [
     LiteralExpr [STRING] [title]
     :
     FieldAccessor [
-      Variable [ Name=paper ]
+      Variable [ Name=$paper ]
       Field=title
     ]
   )
@@ -35,14 +35,14 @@ FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=paper ]
+  Variable [ Name=$paper ]
 ]
 Where
   IndexAccessor [
     FunctionCall test.edit-distance-check@3[
       FunctionCall test.substring@3[
         FieldAccessor [
-          Variable [ Name=paper ]
+          Variable [ Name=$paper ]
           Field=title
         ]
         LiteralExpr [LONG] [0]



Mime
View raw message