asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From buyin...@apache.org
Subject [18/51] [partial] incubator-asterixdb git commit: ASTERIXDB-1226: implement SQL++ core group-by semantics and syntatic sugars.
Date Mon, 28 Mar 2016 20:18:45 GMT
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-2_5/dblp-csx-2_5.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-2_5/dblp-csx-2_5.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-2_5/dblp-csx-2_5.3.ast
index 5844826..8ddc7b1 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-2_5/dblp-csx-2_5.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-2_5/dblp-csx-2_5.3.ast
@@ -6,18 +6,18 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [idDBLP]
     :
-    Variable [ Name=idDBLP ]
+    Variable [ Name=$idDBLP ]
   )
   (
     LiteralExpr [STRING] [idCSX]
     :
-    Variable [ Name=idCSX ]
+    Variable [ Name=$idCSX ]
   )
   (
     LiteralExpr [STRING] [sim]
     :
     IndexAccessor [
-      Variable [ Name=sim ]
+      Variable [ Name=$sim ]
       Index:       LiteralExpr [LONG] [0]
     ]
   )
@@ -27,7 +27,7 @@ FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=paperDBLP ]
+  Variable [ Name=$paperDBLP ]
 ,
   FunctionCall fuzzyjoin.subset-collection@3[
     FunctionCall Metadata.dataset@1[
@@ -44,13 +44,13 @@ FROM [  FunctionCall Metadata.dataset@1[
     ]
   ]
   AS
-  Variable [ Name=prefixTokenDBLP ]
+  Variable [ Name=$prefixTokenDBLP ]
 ,
   FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [CSX]
   ]
   AS
-  Variable [ Name=paperCSX ]
+  Variable [ Name=$paperCSX ]
 ,
   FunctionCall fuzzyjoin.subset-collection@3[
     FunctionCall Metadata.dataset@1[
@@ -67,256 +67,326 @@ FROM [  FunctionCall Metadata.dataset@1[
     ]
   ]
   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=tokensUnrankedDBLP ]
+Let Variable [ Name=$tokensUnrankedDBLP ]
   :=
   FunctionCall fuzzyjoin.counthashed-word-tokens@1[
     FieldAccessor [
-      Variable [ Name=paperDBLP ]
+      Variable [ Name=$paperDBLP ]
       Field=title
     ]
   ]
-LetVariable [ Name=lenDBLP ]
+Let Variable [ Name=$lenDBLP ]
   :=
   FunctionCall fuzzyjoin.len@1[
-    Variable [ Name=tokensUnrankedDBLP ]
+    Variable [ Name=$tokensUnrankedDBLP ]
   ]
-LetVariable [ Name=tokensDBLP ]
+Let Variable [ Name=$tokensDBLP ]
   :=
   (
     SELECT ELEMENT [
-    Variable [ Name=i ]
+    Variable [ Name=$i ]
     ]
-    FROM [      Variable [ Name=tokensUnrankedDBLP ]
+    FROM [      Variable [ Name=$tokensUnrankedDBLP ]
       AS
-      Variable [ Name=tokenUnranked ]
+      Variable [ Name=$tokenUnranked ]
 ,
       (
         SELECT ELEMENT [
-        Variable [ Name=tokenGroupped ]
+        Variable [ Name=$tokenGroupped ]
         ]
         FROM [          FunctionCall Metadata.dataset@1[
             LiteralExpr [STRING] [DBLP]
           ]
           AS
-          Variable [ Name=paper ]
+          Variable [ Name=$paper ]
 ,
           FunctionCall fuzzyjoin.counthashed-word-tokens@1[
             FieldAccessor [
-              Variable [ Name=paper ]
+              Variable [ Name=$paper ]
               Field=title
             ]
           ]
           AS
-          Variable [ Name=token ]
+          Variable [ Name=$token ]
         ]
-        LetVariable [ Name=id ]
+        Let Variable [ Name=$id ]
           :=
           FieldAccessor [
-            Variable [ Name=paper ]
+            Variable [ Name=$paper ]
             Field=id
           ]
         Groupby
-          Variable [ Name=tokenGroupped ]
+          Variable [ Name=$tokenGroupped ]
           :=
-          Variable [ Name=token ]
-          With
-          Variable [ Name=id ]
-          Variable [ Name=paper ]
-          Variable [ Name=token ]
-          Variable [ Name=tokenUnranked ]
-          Variable [ Name=lenDBLP ]
-          Variable [ Name=tokensUnrankedDBLP ]
-          Variable [ Name=idDBLP ]
-          Variable [ Name=paperDBLP ]
-          Variable [ Name=prefixTokenDBLP ]
-          Variable [ Name=prefixTokenCSX ]
-          Variable [ Name=paperCSX ]
+          Variable [ Name=$token ]
+          GROUP AS
+          Variable [ Name=#1 ]
+          (
+          Variable [ Name=$id ]
+           AS id
+          Variable [ Name=$token ]
+           AS token
+          Variable [ Name=$paper ]
+           AS paper
+          Variable [ Name=$tokenUnranked ]
+           AS tokenUnranked
+          Variable [ Name=$lenDBLP ]
+           AS lenDBLP
+          Variable [ Name=$tokensUnrankedDBLP ]
+           AS tokensUnrankedDBLP
+          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
           FunctionCall fuzzyjoin.count@1[
-            Variable [ Name=id ]
+            (
+              SELECT ELEMENT [
+              FieldAccessor [
+                Variable [ Name=#2 ]
+                Field=id
+              ]
+              ]
+              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=tokenUnranked ]
+        Variable [ Name=$tokenUnranked ]
         =
-        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=tokensUnrankedCSX ]
+Let Variable [ Name=$tokensUnrankedCSX ]
   :=
   FunctionCall fuzzyjoin.counthashed-word-tokens@1[
     FieldAccessor [
-      Variable [ Name=paperCSX ]
+      Variable [ Name=$paperCSX ]
       Field=title
     ]
   ]
-LetVariable [ Name=lenCSX ]
+Let Variable [ Name=$lenCSX ]
   :=
   FunctionCall fuzzyjoin.len@1[
-    Variable [ Name=tokensUnrankedCSX ]
+    Variable [ Name=$tokensUnrankedCSX ]
   ]
-LetVariable [ Name=tokensCSX ]
+Let Variable [ Name=$tokensCSX ]
   :=
   (
     SELECT ELEMENT [
-    Variable [ Name=i ]
+    Variable [ Name=$i ]
     ]
-    FROM [      Variable [ Name=tokensUnrankedCSX ]
+    FROM [      Variable [ Name=$tokensUnrankedCSX ]
       AS
-      Variable [ Name=tokenUnranked ]
+      Variable [ Name=$tokenUnranked ]
 ,
       (
         SELECT ELEMENT [
-        Variable [ Name=tokenGroupped ]
+        Variable [ Name=$tokenGroupped ]
         ]
         FROM [          FunctionCall Metadata.dataset@1[
             LiteralExpr [STRING] [DBLP]
           ]
           AS
-          Variable [ Name=paper ]
+          Variable [ Name=$paper ]
 ,
           FunctionCall fuzzyjoin.counthashed-word-tokens@1[
             FieldAccessor [
-              Variable [ Name=paper ]
+              Variable [ Name=$paper ]
               Field=title
             ]
           ]
           AS
-          Variable [ Name=token ]
+          Variable [ Name=$token ]
         ]
-        LetVariable [ Name=id ]
+        Let Variable [ Name=$id ]
           :=
           FieldAccessor [
-            Variable [ Name=paper ]
+            Variable [ Name=$paper ]
             Field=id
           ]
         Groupby
-          Variable [ Name=tokenGroupped ]
+          Variable [ Name=$tokenGroupped ]
           :=
-          Variable [ Name=token ]
-          With
-          Variable [ Name=id ]
-          Variable [ Name=paper ]
-          Variable [ Name=token ]
-          Variable [ Name=tokenUnranked ]
-          Variable [ Name=lenCSX ]
-          Variable [ Name=tokensUnrankedCSX ]
-          Variable [ Name=idCSX ]
-          Variable [ Name=tokensDBLP ]
-          Variable [ Name=lenDBLP ]
-          Variable [ Name=tokensUnrankedDBLP ]
-          Variable [ Name=idDBLP ]
-          Variable [ Name=paperDBLP ]
-          Variable [ Name=prefixTokenDBLP ]
-          Variable [ Name=prefixTokenCSX ]
-          Variable [ Name=paperCSX ]
+          Variable [ Name=$token ]
+          GROUP AS
+          Variable [ Name=#3 ]
+          (
+          Variable [ Name=$id ]
+           AS id
+          Variable [ Name=$token ]
+           AS token
+          Variable [ Name=$paper ]
+           AS paper
+          Variable [ Name=$tokenUnranked ]
+           AS tokenUnranked
+          Variable [ Name=$lenCSX ]
+           AS lenCSX
+          Variable [ Name=$tokensUnrankedCSX ]
+           AS tokensUnrankedCSX
+          Variable [ Name=$idCSX ]
+           AS idCSX
+          Variable [ Name=$tokensDBLP ]
+           AS tokensDBLP
+          Variable [ Name=$lenDBLP ]
+           AS lenDBLP
+          Variable [ Name=$tokensUnrankedDBLP ]
+           AS tokensUnrankedDBLP
+          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
           FunctionCall fuzzyjoin.count@1[
-            Variable [ Name=id ]
+            (
+              SELECT ELEMENT [
+              FieldAccessor [
+                Variable [ Name=#4 ]
+                Field=id
+              ]
+              ]
+              FROM [                Variable [ Name=#3 ]
+                AS
+                Variable [ Name=#4 ]
+              ]
+            )
           ]
           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=tokenUnranked ]
+        Variable [ Name=$tokenUnranked ]
         =
-        Variable [ Name=tokenRanked ]
+        Variable [ Name=$tokenRanked ]
       ]
     Orderby
-      Variable [ Name=i ]
+      Variable [ Name=$i ]
       ASC
 
   )
-LetVariable [ Name=sim ]
+Let Variable [ Name=$sim ]
   :=
   FunctionCall fuzzyjoin.similarity-jaccard-prefix@6[
-    Variable [ Name=lenDBLP ]
-    Variable [ Name=tokensDBLP ]
-    Variable [ Name=lenCSX ]
-    Variable [ Name=tokensCSX ]
-    Variable [ Name=prefixTokenDBLP ]
+    Variable [ Name=$lenDBLP ]
+    Variable [ Name=$tokensDBLP ]
+    Variable [ Name=$lenCSX ]
+    Variable [ Name=$tokensCSX ]
+    Variable [ Name=$prefixTokenDBLP ]
     LiteralExpr [FLOAT] [0.5]
   ]
 Where
   OperatorExpr [
     OperatorExpr [
-      Variable [ Name=prefixTokenDBLP ]
+      Variable [ Name=$prefixTokenDBLP ]
       =
-      Variable [ Name=prefixTokenCSX ]
+      Variable [ Name=$prefixTokenCSX ]
     ]
     and
     OperatorExpr [
-      Variable [ Name=sim ]
+      Variable [ Name=$sim ]
       >=
       LiteralExpr [FLOAT] [0.5]
     ]
   ]
 Groupby
-  Variable [ Name=idDBLP ]
+  Variable [ Name=$idDBLP ]
   :=
-  Variable [ Name=idDBLP ]
-  Variable [ Name=idCSX ]
+  Variable [ Name=$idDBLP ]
+  Variable [ Name=$idCSX ]
   :=
-  Variable [ Name=idCSX ]
-  Variable [ Name=sim ]
+  Variable [ Name=$idCSX ]
+  Variable [ Name=$sim ]
   :=
-  Variable [ Name=sim ]
-  With
-  Variable [ Name=sim ]
-  Variable [ Name=tokensCSX ]
-  Variable [ Name=lenCSX ]
-  Variable [ Name=tokensUnrankedCSX ]
-  Variable [ Name=idCSX ]
-  Variable [ Name=tokensDBLP ]
-  Variable [ Name=lenDBLP ]
-  Variable [ Name=tokensUnrankedDBLP ]
-  Variable [ Name=idDBLP ]
-  Variable [ Name=paperDBLP ]
-  Variable [ Name=prefixTokenDBLP ]
-  Variable [ Name=prefixTokenCSX ]
-  Variable [ Name=paperCSX ]
+  Variable [ Name=$sim ]
+  GROUP AS
+  Variable [ Name=#5 ]
+  (
+  Variable [ Name=$sim ]
+   AS sim
+  Variable [ Name=$tokensCSX ]
+   AS tokensCSX
+  Variable [ Name=$lenCSX ]
+   AS lenCSX
+  Variable [ Name=$tokensUnrankedCSX ]
+   AS tokensUnrankedCSX
+  Variable [ Name=$idCSX ]
+   AS idCSX
+  Variable [ Name=$tokensDBLP ]
+   AS tokensDBLP
+  Variable [ Name=$lenDBLP ]
+   AS lenDBLP
+  Variable [ Name=$tokensUnrankedDBLP ]
+   AS tokensUnrankedDBLP
+  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/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-3_1/dblp-csx-3_1.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-3_1/dblp-csx-3_1.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-3_1/dblp-csx-3_1.3.ast
index 75fe415..74480b0 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-3_1/dblp-csx-3_1.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-3_1/dblp-csx-3_1.3.ast
@@ -6,18 +6,18 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [dblp]
     :
-    Variable [ Name=paperDBLP ]
+    Variable [ Name=$paperDBLP ]
   )
   (
     LiteralExpr [STRING] [csx]
     :
-    Variable [ Name=paperCSX ]
+    Variable [ Name=$paperCSX ]
   )
   (
     LiteralExpr [STRING] [sim]
     :
     FieldAccessor [
-      Variable [ Name=ridpair ]
+      Variable [ Name=$ridpair ]
       Field=sim
     ]
   )
@@ -29,18 +29,18 @@ FROM [  (
       (
         LiteralExpr [STRING] [idDBLP]
         :
-        Variable [ Name=idDBLP ]
+        Variable [ Name=$idDBLP ]
       )
       (
         LiteralExpr [STRING] [idCSX]
         :
-        Variable [ Name=idCSX ]
+        Variable [ Name=$idCSX ]
       )
       (
         LiteralExpr [STRING] [sim]
         :
         IndexAccessor [
-          Variable [ Name=sim ]
+          Variable [ Name=$sim ]
           Index:           LiteralExpr [LONG] [0]
         ]
       )
@@ -50,7 +50,7 @@ FROM [  (
         LiteralExpr [STRING] [DBLP]
       ]
       AS
-      Variable [ Name=paperDBLP ]
+      Variable [ Name=$paperDBLP ]
 ,
       FunctionCall fuzzyjoin.subset-collection@3[
         FunctionCall Metadata.dataset@1[
@@ -67,13 +67,13 @@ FROM [  (
         ]
       ]
       AS
-      Variable [ Name=prefixTokenDBLP ]
+      Variable [ Name=$prefixTokenDBLP ]
 ,
       FunctionCall Metadata.dataset@1[
         LiteralExpr [STRING] [CSX]
       ]
       AS
-      Variable [ Name=paperCSX ]
+      Variable [ Name=$paperCSX ]
 ,
       FunctionCall fuzzyjoin.subset-collection@3[
         FunctionCall Metadata.dataset@1[
@@ -90,266 +90,319 @@ FROM [  (
         ]
       ]
       AS
-      Variable [ Name=prefixTokenCSX ]
+      Variable [ Name=$prefixTokenCSX ]
     ]
-    LetVariable [ Name=tokensDBLP ]
+    Let Variable [ Name=$tokensDBLP ]
       :=
       (
         SELECT ELEMENT [
-        Variable [ Name=i ]
+        Variable [ Name=$i ]
         ]
         FROM [          FunctionCall fuzzyjoin.counthashed-word-tokens@1[
             FieldAccessor [
-              Variable [ Name=paperDBLP ]
+              Variable [ Name=$paperDBLP ]
               Field=title
             ]
           ]
           AS
-          Variable [ Name=tokenUnranked ]
+          Variable [ Name=$tokenUnranked ]
 ,
           (
             SELECT ELEMENT [
-            Variable [ Name=tokenGroupped ]
+            Variable [ Name=$tokenGroupped ]
             ]
             FROM [              FunctionCall Metadata.dataset@1[
                 LiteralExpr [STRING] [DBLP]
               ]
               AS
-              Variable [ Name=paper ]
+              Variable [ Name=$paper ]
 ,
               FunctionCall fuzzyjoin.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=tokenUnranked ]
-              Variable [ Name=paperDBLP ]
-              Variable [ Name=prefixTokenDBLP ]
-              Variable [ Name=prefixTokenCSX ]
-              Variable [ Name=paperCSX ]
+              Variable [ Name=$token ]
+              GROUP AS
+              Variable [ Name=#1 ]
+              (
+              Variable [ Name=$token ]
+               AS token
+              Variable [ Name=$paper ]
+               AS paper
+              Variable [ Name=$tokenUnranked ]
+               AS tokenUnranked
+              Variable [ Name=$prefixTokenCSX ]
+               AS prefixTokenCSX
+              Variable [ Name=$paperCSX ]
+               AS paperCSX
+              Variable [ Name=$prefixTokenDBLP ]
+               AS prefixTokenDBLP
+              Variable [ Name=$paperDBLP ]
+               AS paperDBLP
+              )
 
             Orderby
               FunctionCall fuzzyjoin.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=tokenUnranked ]
+            Variable [ Name=$tokenUnranked ]
             =
-            Variable [ Name=tokenRanked ]
+            Variable [ Name=$tokenRanked ]
           ]
         Orderby
-          Variable [ Name=i ]
+          Variable [ Name=$i ]
           ASC
 
       )
-    LetVariable [ Name=tokensCSX ]
+    Let Variable [ Name=$tokensCSX ]
       :=
       (
         SELECT ELEMENT [
-        Variable [ Name=i ]
+        Variable [ Name=$i ]
         ]
         FROM [          FunctionCall fuzzyjoin.counthashed-word-tokens@1[
             FieldAccessor [
-              Variable [ Name=paperCSX ]
+              Variable [ Name=$paperCSX ]
               Field=title
             ]
           ]
           AS
-          Variable [ Name=tokenUnranked ]
+          Variable [ Name=$tokenUnranked ]
 ,
           (
             SELECT ELEMENT [
-            Variable [ Name=tokenGroupped ]
+            Variable [ Name=$tokenGroupped ]
             ]
             FROM [              FunctionCall Metadata.dataset@1[
                 LiteralExpr [STRING] [DBLP]
               ]
               AS
-              Variable [ Name=paper ]
+              Variable [ Name=$paper ]
 ,
               FunctionCall fuzzyjoin.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=tokenUnranked ]
-              Variable [ Name=tokensDBLP ]
-              Variable [ Name=paperDBLP ]
-              Variable [ Name=prefixTokenDBLP ]
-              Variable [ Name=prefixTokenCSX ]
-              Variable [ Name=paperCSX ]
+              Variable [ Name=$token ]
+              GROUP AS
+              Variable [ Name=#3 ]
+              (
+              Variable [ Name=$token ]
+               AS token
+              Variable [ Name=$paper ]
+               AS paper
+              Variable [ Name=$tokenUnranked ]
+               AS tokenUnranked
+              Variable [ Name=$tokensDBLP ]
+               AS tokensDBLP
+              Variable [ Name=$prefixTokenCSX ]
+               AS prefixTokenCSX
+              Variable [ Name=$paperCSX ]
+               AS paperCSX
+              Variable [ Name=$prefixTokenDBLP ]
+               AS prefixTokenDBLP
+              Variable [ Name=$paperDBLP ]
+               AS paperDBLP
+              )
 
             Orderby
               FunctionCall fuzzyjoin.count@1[
-                Variable [ Name=paper ]
+                (
+                  SELECT ELEMENT [
+                  FieldAccessor [
+                    Variable [ Name=#4 ]
+                    Field=paper
+                  ]
+                  ]
+                  FROM [                    Variable [ Name=#3 ]
+                    AS
+                    Variable [ Name=#4 ]
+                  ]
+                )
               ]
               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=tokenUnranked ]
+            Variable [ Name=$tokenUnranked ]
             =
-            Variable [ Name=tokenRanked ]
+            Variable [ Name=$tokenRanked ]
           ]
         Orderby
-          Variable [ Name=i ]
+          Variable [ Name=$i ]
           ASC
 
       )
-    LetVariable [ Name=sim ]
+    Let Variable [ Name=$sim ]
       :=
       FunctionCall fuzzyjoin.similarity-jaccard-prefix@6[
         FunctionCall fuzzyjoin.len@1[
           FunctionCall fuzzyjoin.counthashed-word-tokens@1[
             FieldAccessor [
-              Variable [ Name=paperDBLP ]
+              Variable [ Name=$paperDBLP ]
               Field=title
             ]
           ]
         ]
-        Variable [ Name=tokensDBLP ]
+        Variable [ Name=$tokensDBLP ]
         FunctionCall fuzzyjoin.len@1[
           FunctionCall fuzzyjoin.counthashed-word-tokens@1[
             FieldAccessor [
-              Variable [ Name=paperCSX ]
+              Variable [ Name=$paperCSX ]
               Field=title
             ]
           ]
         ]
-        Variable [ Name=tokensCSX ]
-        Variable [ Name=prefixTokenDBLP ]
+        Variable [ Name=$tokensCSX ]
+        Variable [ Name=$prefixTokenDBLP ]
         LiteralExpr [FLOAT] [0.5]
       ]
     Where
       OperatorExpr [
         OperatorExpr [
-          Variable [ Name=prefixTokenDBLP ]
+          Variable [ Name=$prefixTokenDBLP ]
           =
-          Variable [ Name=prefixTokenCSX ]
+          Variable [ Name=$prefixTokenCSX ]
         ]
         and
         OperatorExpr [
-          Variable [ Name=sim ]
+          Variable [ Name=$sim ]
           >=
           LiteralExpr [FLOAT] [0.5]
         ]
       ]
     Groupby
-      Variable [ Name=idDBLP ]
+      Variable [ Name=$idDBLP ]
       :=
       FieldAccessor [
-        Variable [ Name=paperDBLP ]
+        Variable [ Name=$paperDBLP ]
         Field=id
       ]
-      Variable [ Name=idCSX ]
+      Variable [ Name=$idCSX ]
       :=
       FieldAccessor [
-        Variable [ Name=paperCSX ]
+        Variable [ Name=$paperCSX ]
         Field=id
       ]
-      Variable [ Name=sim ]
+      Variable [ Name=$sim ]
       :=
-      Variable [ Name=sim ]
-      With
-      Variable [ Name=sim ]
-      Variable [ Name=tokensCSX ]
-      Variable [ Name=tokensDBLP ]
-      Variable [ Name=paperDBLP ]
-      Variable [ Name=prefixTokenDBLP ]
-      Variable [ Name=prefixTokenCSX ]
-      Variable [ Name=paperCSX ]
+      Variable [ Name=$sim ]
+      GROUP AS
+      Variable [ Name=#5 ]
+      (
+      Variable [ Name=$sim ]
+       AS sim
+      Variable [ Name=$tokensCSX ]
+       AS tokensCSX
+      Variable [ Name=$tokensDBLP ]
+       AS tokensDBLP
+      Variable [ Name=$prefixTokenCSX ]
+       AS prefixTokenCSX
+      Variable [ Name=$paperCSX ]
+       AS paperCSX
+      Variable [ Name=$prefixTokenDBLP ]
+       AS prefixTokenDBLP
+      Variable [ Name=$paperDBLP ]
+       AS paperDBLP
+      )
 
   )
   AS
-  Variable [ Name=ridpair ]
+  Variable [ Name=$ridpair ]
 ,
   FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=paperDBLP ]
+  Variable [ Name=$paperDBLP ]
 ,
   FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [CSX]
   ]
   AS
-  Variable [ Name=paperCSX ]
+  Variable [ Name=$paperCSX ]
 ]
 Where
   OperatorExpr [
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=ridpair ]
+        Variable [ Name=$ridpair ]
         Field=idDBLP
       ]
       =
       FieldAccessor [
-        Variable [ Name=paperDBLP ]
+        Variable [ Name=$paperDBLP ]
         Field=id
       ]
     ]
     and
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=ridpair ]
+        Variable [ Name=$ridpair ]
         Field=idCSX
       ]
       =
       FieldAccessor [
-        Variable [ Name=paperCSX ]
+        Variable [ Name=$paperCSX ]
         Field=id
       ]
     ]
   ]
 Orderby
   FieldAccessor [
-    Variable [ Name=paperDBLP ]
+    Variable [ Name=$paperDBLP ]
     Field=id
   ]
   ASC
   FieldAccessor [
-    Variable [ Name=paperCSX ]
+    Variable [ Name=$paperCSX ]
     Field=id
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-3_2/dblp-csx-3_2.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-3_2/dblp-csx-3_2.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-3_2/dblp-csx-3_2.3.ast
index 45ee790..4ee78c2 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-3_2/dblp-csx-3_2.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-3_2/dblp-csx-3_2.3.ast
@@ -6,18 +6,18 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [dblp]
     :
-    Variable [ Name=paperDBLP ]
+    Variable [ Name=$paperDBLP ]
   )
   (
     LiteralExpr [STRING] [csx]
     :
-    Variable [ Name=paperCSX ]
+    Variable [ Name=$paperCSX ]
   )
   (
     LiteralExpr [STRING] [sim]
     :
     FieldAccessor [
-      Variable [ Name=ridpair ]
+      Variable [ Name=$ridpair ]
       Field=sim
     ]
   )
@@ -29,18 +29,18 @@ FROM [  (
       (
         LiteralExpr [STRING] [idDBLP]
         :
-        Variable [ Name=idDBLP ]
+        Variable [ Name=$idDBLP ]
       )
       (
         LiteralExpr [STRING] [idCSX]
         :
-        Variable [ Name=idCSX ]
+        Variable [ Name=$idCSX ]
       )
       (
         LiteralExpr [STRING] [sim]
         :
         IndexAccessor [
-          Variable [ Name=sim ]
+          Variable [ Name=$sim ]
           Index:           LiteralExpr [LONG] [0]
         ]
       )
@@ -50,7 +50,7 @@ FROM [  (
         LiteralExpr [STRING] [DBLP]
       ]
       AS
-      Variable [ Name=paperDBLP ]
+      Variable [ Name=$paperDBLP ]
 ,
       FunctionCall fuzzyjoin.subset-collection@3[
         FunctionCall Metadata.dataset@1[
@@ -67,13 +67,13 @@ FROM [  (
         ]
       ]
       AS
-      Variable [ Name=prefixTokenDBLP ]
+      Variable [ Name=$prefixTokenDBLP ]
 ,
       FunctionCall Metadata.dataset@1[
         LiteralExpr [STRING] [CSX]
       ]
       AS
-      Variable [ Name=paperCSX ]
+      Variable [ Name=$paperCSX ]
 ,
       FunctionCall fuzzyjoin.subset-collection@3[
         FunctionCall Metadata.dataset@1[
@@ -90,280 +90,335 @@ FROM [  (
         ]
       ]
       AS
-      Variable [ Name=prefixTokenCSX ]
+      Variable [ Name=$prefixTokenCSX ]
     ]
-    LetVariable [ Name=tokensDBLP ]
+    Let Variable [ Name=$tokensDBLP ]
       :=
       (
         SELECT ELEMENT [
-        Variable [ Name=i ]
+        Variable [ Name=$i ]
         ]
         FROM [          FunctionCall fuzzyjoin.counthashed-word-tokens@1[
             FieldAccessor [
-              Variable [ Name=paperDBLP ]
+              Variable [ Name=$paperDBLP ]
               Field=title
             ]
           ]
           AS
-          Variable [ Name=tokenUnranked ]
+          Variable [ Name=$tokenUnranked ]
 ,
           (
             SELECT ELEMENT [
-            Variable [ Name=tokenGroupped ]
+            Variable [ Name=$tokenGroupped ]
             ]
             FROM [              FunctionCall Metadata.dataset@1[
                 LiteralExpr [STRING] [DBLP]
               ]
               AS
-              Variable [ Name=paper ]
+              Variable [ Name=$paper ]
 ,
               FunctionCall fuzzyjoin.counthashed-word-tokens@1[
                 FieldAccessor [
-                  Variable [ Name=paper ]
+                  Variable [ Name=$paper ]
                   Field=title
                 ]
               ]
               AS
-              Variable [ Name=token ]
+              Variable [ Name=$token ]
             ]
-            LetVariable [ Name=id ]
+            Let Variable [ Name=$id ]
               :=
               FieldAccessor [
-                Variable [ Name=paper ]
+                Variable [ Name=$paper ]
                 Field=id
               ]
             Groupby
-              Variable [ Name=tokenGroupped ]
+              Variable [ Name=$tokenGroupped ]
               :=
-              Variable [ Name=token ]
-              With
-              Variable [ Name=id ]
-              Variable [ Name=paper ]
-              Variable [ Name=token ]
-              Variable [ Name=tokenUnranked ]
-              Variable [ Name=paperDBLP ]
-              Variable [ Name=prefixTokenDBLP ]
-              Variable [ Name=prefixTokenCSX ]
-              Variable [ Name=paperCSX ]
+              Variable [ Name=$token ]
+              GROUP AS
+              Variable [ Name=#1 ]
+              (
+              Variable [ Name=$id ]
+               AS id
+              Variable [ Name=$token ]
+               AS token
+              Variable [ Name=$paper ]
+               AS paper
+              Variable [ Name=$tokenUnranked ]
+               AS tokenUnranked
+              Variable [ Name=$prefixTokenCSX ]
+               AS prefixTokenCSX
+              Variable [ Name=$paperCSX ]
+               AS paperCSX
+              Variable [ Name=$prefixTokenDBLP ]
+               AS prefixTokenDBLP
+              Variable [ Name=$paperDBLP ]
+               AS paperDBLP
+              )
 
             Orderby
               FunctionCall fuzzyjoin.count@1[
-                Variable [ Name=id ]
+                (
+                  SELECT ELEMENT [
+                  FieldAccessor [
+                    Variable [ Name=#2 ]
+                    Field=id
+                  ]
+                  ]
+                  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=tokenUnranked ]
+            Variable [ Name=$tokenUnranked ]
             =
-            Variable [ Name=tokenRanked ]
+            Variable [ Name=$tokenRanked ]
           ]
         Orderby
-          Variable [ Name=i ]
+          Variable [ Name=$i ]
           ASC
 
       )
-    LetVariable [ Name=tokensCSX ]
+    Let Variable [ Name=$tokensCSX ]
       :=
       (
         SELECT ELEMENT [
-        Variable [ Name=i ]
+        Variable [ Name=$i ]
         ]
         FROM [          FunctionCall fuzzyjoin.counthashed-word-tokens@1[
             FieldAccessor [
-              Variable [ Name=paperCSX ]
+              Variable [ Name=$paperCSX ]
               Field=title
             ]
           ]
           AS
-          Variable [ Name=tokenUnranked ]
+          Variable [ Name=$tokenUnranked ]
 ,
           (
             SELECT ELEMENT [
-            Variable [ Name=tokenGroupped ]
+            Variable [ Name=$tokenGroupped ]
             ]
             FROM [              FunctionCall Metadata.dataset@1[
                 LiteralExpr [STRING] [DBLP]
               ]
               AS
-              Variable [ Name=paper ]
+              Variable [ Name=$paper ]
 ,
               FunctionCall fuzzyjoin.counthashed-word-tokens@1[
                 FieldAccessor [
-                  Variable [ Name=paper ]
+                  Variable [ Name=$paper ]
                   Field=title
                 ]
               ]
               AS
-              Variable [ Name=token ]
+              Variable [ Name=$token ]
             ]
-            LetVariable [ Name=id ]
+            Let Variable [ Name=$id ]
               :=
               FieldAccessor [
-                Variable [ Name=paper ]
+                Variable [ Name=$paper ]
                 Field=id
               ]
             Groupby
-              Variable [ Name=tokenGroupped ]
+              Variable [ Name=$tokenGroupped ]
               :=
-              Variable [ Name=token ]
-              With
-              Variable [ Name=id ]
-              Variable [ Name=paper ]
-              Variable [ Name=token ]
-              Variable [ Name=tokenUnranked ]
-              Variable [ Name=tokensDBLP ]
-              Variable [ Name=paperDBLP ]
-              Variable [ Name=prefixTokenDBLP ]
-              Variable [ Name=prefixTokenCSX ]
-              Variable [ Name=paperCSX ]
+              Variable [ Name=$token ]
+              GROUP AS
+              Variable [ Name=#3 ]
+              (
+              Variable [ Name=$id ]
+               AS id
+              Variable [ Name=$token ]
+               AS token
+              Variable [ Name=$paper ]
+               AS paper
+              Variable [ Name=$tokenUnranked ]
+               AS tokenUnranked
+              Variable [ Name=$tokensDBLP ]
+               AS tokensDBLP
+              Variable [ Name=$prefixTokenCSX ]
+               AS prefixTokenCSX
+              Variable [ Name=$paperCSX ]
+               AS paperCSX
+              Variable [ Name=$prefixTokenDBLP ]
+               AS prefixTokenDBLP
+              Variable [ Name=$paperDBLP ]
+               AS paperDBLP
+              )
 
             Orderby
               FunctionCall fuzzyjoin.count@1[
-                Variable [ Name=id ]
+                (
+                  SELECT ELEMENT [
+                  FieldAccessor [
+                    Variable [ Name=#4 ]
+                    Field=id
+                  ]
+                  ]
+                  FROM [                    Variable [ Name=#3 ]
+                    AS
+                    Variable [ Name=#4 ]
+                  ]
+                )
               ]
               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=tokenUnranked ]
+            Variable [ Name=$tokenUnranked ]
             =
-            Variable [ Name=tokenRanked ]
+            Variable [ Name=$tokenRanked ]
           ]
         Orderby
-          Variable [ Name=i ]
+          Variable [ Name=$i ]
           ASC
 
       )
-    LetVariable [ Name=sim ]
+    Let Variable [ Name=$sim ]
       :=
       FunctionCall fuzzyjoin.similarity-jaccard-prefix@6[
         FunctionCall fuzzyjoin.len@1[
           FunctionCall fuzzyjoin.counthashed-word-tokens@1[
             FieldAccessor [
-              Variable [ Name=paperDBLP ]
+              Variable [ Name=$paperDBLP ]
               Field=title
             ]
           ]
         ]
-        Variable [ Name=tokensDBLP ]
+        Variable [ Name=$tokensDBLP ]
         FunctionCall fuzzyjoin.len@1[
           FunctionCall fuzzyjoin.counthashed-word-tokens@1[
             FieldAccessor [
-              Variable [ Name=paperCSX ]
+              Variable [ Name=$paperCSX ]
               Field=title
             ]
           ]
         ]
-        Variable [ Name=tokensCSX ]
-        Variable [ Name=prefixTokenDBLP ]
+        Variable [ Name=$tokensCSX ]
+        Variable [ Name=$prefixTokenDBLP ]
         LiteralExpr [FLOAT] [0.5]
       ]
     Where
       OperatorExpr [
         OperatorExpr [
-          Variable [ Name=prefixTokenDBLP ]
+          Variable [ Name=$prefixTokenDBLP ]
           =
-          Variable [ Name=prefixTokenCSX ]
+          Variable [ Name=$prefixTokenCSX ]
         ]
         and
         OperatorExpr [
-          Variable [ Name=sim ]
+          Variable [ Name=$sim ]
           >=
           LiteralExpr [FLOAT] [0.5]
         ]
       ]
     Groupby
-      Variable [ Name=idDBLP ]
+      Variable [ Name=$idDBLP ]
       :=
       FieldAccessor [
-        Variable [ Name=paperDBLP ]
+        Variable [ Name=$paperDBLP ]
         Field=id
       ]
-      Variable [ Name=idCSX ]
+      Variable [ Name=$idCSX ]
       :=
       FieldAccessor [
-        Variable [ Name=paperCSX ]
+        Variable [ Name=$paperCSX ]
         Field=id
       ]
-      Variable [ Name=sim ]
+      Variable [ Name=$sim ]
       :=
-      Variable [ Name=sim ]
-      With
-      Variable [ Name=sim ]
-      Variable [ Name=tokensCSX ]
-      Variable [ Name=tokensDBLP ]
-      Variable [ Name=paperDBLP ]
-      Variable [ Name=prefixTokenDBLP ]
-      Variable [ Name=prefixTokenCSX ]
-      Variable [ Name=paperCSX ]
+      Variable [ Name=$sim ]
+      GROUP AS
+      Variable [ Name=#5 ]
+      (
+      Variable [ Name=$sim ]
+       AS sim
+      Variable [ Name=$tokensCSX ]
+       AS tokensCSX
+      Variable [ Name=$tokensDBLP ]
+       AS tokensDBLP
+      Variable [ Name=$prefixTokenCSX ]
+       AS prefixTokenCSX
+      Variable [ Name=$paperCSX ]
+       AS paperCSX
+      Variable [ Name=$prefixTokenDBLP ]
+       AS prefixTokenDBLP
+      Variable [ Name=$paperDBLP ]
+       AS paperDBLP
+      )
 
   )
   AS
-  Variable [ Name=ridpair ]
+  Variable [ Name=$ridpair ]
 ,
   FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=paperDBLP ]
+  Variable [ Name=$paperDBLP ]
 ,
   FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [CSX]
   ]
   AS
-  Variable [ Name=paperCSX ]
+  Variable [ Name=$paperCSX ]
 ]
 Where
   OperatorExpr [
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=ridpair ]
+        Variable [ Name=$ridpair ]
         Field=idDBLP
       ]
       =
       FieldAccessor [
-        Variable [ Name=paperDBLP ]
+        Variable [ Name=$paperDBLP ]
         Field=id
       ]
     ]
     and
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=ridpair ]
+        Variable [ Name=$ridpair ]
         Field=idCSX
       ]
       =
       FieldAccessor [
-        Variable [ Name=paperCSX ]
+        Variable [ Name=$paperCSX ]
         Field=id
       ]
     ]
   ]
 Orderby
   FieldAccessor [
-    Variable [ Name=paperDBLP ]
+    Variable [ Name=$paperDBLP ]
     Field=id
   ]
   ASC
   FieldAccessor [
-    Variable [ Name=paperCSX ]
+    Variable [ Name=$paperCSX ]
     Field=id
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-3_3/dblp-csx-3_3.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-3_3/dblp-csx-3_3.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-3_3/dblp-csx-3_3.3.ast
index 133f403..f22a4e2 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-3_3/dblp-csx-3_3.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-3_3/dblp-csx-3_3.3.ast
@@ -6,18 +6,18 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [dblp]
     :
-    Variable [ Name=paperDBLP ]
+    Variable [ Name=$paperDBLP ]
   )
   (
     LiteralExpr [STRING] [csx]
     :
-    Variable [ Name=paperCSX ]
+    Variable [ Name=$paperCSX ]
   )
   (
     LiteralExpr [STRING] [sim]
     :
     FieldAccessor [
-      Variable [ Name=ridpair ]
+      Variable [ Name=$ridpair ]
       Field=sim
     ]
   )
@@ -29,18 +29,18 @@ FROM [  (
       (
         LiteralExpr [STRING] [idDBLP]
         :
-        Variable [ Name=idDBLP ]
+        Variable [ Name=$idDBLP ]
       )
       (
         LiteralExpr [STRING] [idCSX]
         :
-        Variable [ Name=idCSX ]
+        Variable [ Name=$idCSX ]
       )
       (
         LiteralExpr [STRING] [sim]
         :
         IndexAccessor [
-          Variable [ Name=sim ]
+          Variable [ Name=$sim ]
           Index:           LiteralExpr [LONG] [0]
         ]
       )
@@ -50,7 +50,7 @@ FROM [  (
         LiteralExpr [STRING] [DBLP]
       ]
       AS
-      Variable [ Name=paperDBLP ]
+      Variable [ Name=$paperDBLP ]
 ,
       FunctionCall fuzzyjoin.subset-collection@3[
         FunctionCall Metadata.dataset@1[
@@ -67,13 +67,13 @@ FROM [  (
         ]
       ]
       AS
-      Variable [ Name=prefixTokenDBLP ]
+      Variable [ Name=$prefixTokenDBLP ]
 ,
       FunctionCall Metadata.dataset@1[
         LiteralExpr [STRING] [CSX]
       ]
       AS
-      Variable [ Name=paperCSX ]
+      Variable [ Name=$paperCSX ]
 ,
       FunctionCall fuzzyjoin.subset-collection@3[
         FunctionCall Metadata.dataset@1[
@@ -90,291 +90,351 @@ FROM [  (
         ]
       ]
       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=tokensDBLP ]
+    Let Variable [ Name=$tokensDBLP ]
       :=
       (
         SELECT ELEMENT [
-        Variable [ Name=i ]
+        Variable [ Name=$i ]
         ]
         FROM [          FunctionCall fuzzyjoin.counthashed-word-tokens@1[
             FieldAccessor [
-              Variable [ Name=paperDBLP ]
+              Variable [ Name=$paperDBLP ]
               Field=title
             ]
           ]
           AS
-          Variable [ Name=tokenUnranked ]
+          Variable [ Name=$tokenUnranked ]
 ,
           (
             SELECT ELEMENT [
-            Variable [ Name=tokenGroupped ]
+            Variable [ Name=$tokenGroupped ]
             ]
             FROM [              FunctionCall Metadata.dataset@1[
                 LiteralExpr [STRING] [DBLP]
               ]
               AS
-              Variable [ Name=paper ]
+              Variable [ Name=$paper ]
 ,
               FunctionCall fuzzyjoin.counthashed-word-tokens@1[
                 FieldAccessor [
-                  Variable [ Name=paper ]
+                  Variable [ Name=$paper ]
                   Field=title
                 ]
               ]
               AS
-              Variable [ Name=token ]
+              Variable [ Name=$token ]
             ]
-            LetVariable [ Name=id ]
+            Let Variable [ Name=$id ]
               :=
               FieldAccessor [
-                Variable [ Name=paper ]
+                Variable [ Name=$paper ]
                 Field=id
               ]
             Groupby
-              Variable [ Name=tokenGroupped ]
+              Variable [ Name=$tokenGroupped ]
               :=
-              Variable [ Name=token ]
-              With
-              Variable [ Name=id ]
-              Variable [ Name=paper ]
-              Variable [ Name=token ]
-              Variable [ Name=tokenUnranked ]
-              Variable [ Name=idDBLP ]
-              Variable [ Name=paperDBLP ]
-              Variable [ Name=prefixTokenDBLP ]
-              Variable [ Name=prefixTokenCSX ]
-              Variable [ Name=paperCSX ]
+              Variable [ Name=$token ]
+              GROUP AS
+              Variable [ Name=#1 ]
+              (
+              Variable [ Name=$id ]
+               AS id
+              Variable [ Name=$token ]
+               AS token
+              Variable [ Name=$paper ]
+               AS paper
+              Variable [ Name=$tokenUnranked ]
+               AS tokenUnranked
+              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
               FunctionCall fuzzyjoin.count@1[
-                Variable [ Name=id ]
+                (
+                  SELECT ELEMENT [
+                  FieldAccessor [
+                    Variable [ Name=#2 ]
+                    Field=id
+                  ]
+                  ]
+                  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=tokenUnranked ]
+            Variable [ Name=$tokenUnranked ]
             =
-            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=tokensCSX ]
+    Let Variable [ Name=$tokensCSX ]
       :=
       (
         SELECT ELEMENT [
-        Variable [ Name=i ]
+        Variable [ Name=$i ]
         ]
         FROM [          FunctionCall fuzzyjoin.counthashed-word-tokens@1[
             FieldAccessor [
-              Variable [ Name=paperCSX ]
+              Variable [ Name=$paperCSX ]
               Field=title
             ]
           ]
           AS
-          Variable [ Name=tokenUnranked ]
+          Variable [ Name=$tokenUnranked ]
 ,
           (
             SELECT ELEMENT [
-            Variable [ Name=tokenGroupped ]
+            Variable [ Name=$tokenGroupped ]
             ]
             FROM [              FunctionCall Metadata.dataset@1[
                 LiteralExpr [STRING] [DBLP]
               ]
               AS
-              Variable [ Name=paper ]
+              Variable [ Name=$paper ]
 ,
               FunctionCall fuzzyjoin.counthashed-word-tokens@1[
                 FieldAccessor [
-                  Variable [ Name=paper ]
+                  Variable [ Name=$paper ]
                   Field=title
                 ]
               ]
               AS
-              Variable [ Name=token ]
+              Variable [ Name=$token ]
             ]
-            LetVariable [ Name=id ]
+            Let Variable [ Name=$id ]
               :=
               FieldAccessor [
-                Variable [ Name=paper ]
+                Variable [ Name=$paper ]
                 Field=id
               ]
             Groupby
-              Variable [ Name=tokenGroupped ]
+              Variable [ Name=$tokenGroupped ]
               :=
-              Variable [ Name=token ]
-              With
-              Variable [ Name=id ]
-              Variable [ Name=paper ]
-              Variable [ Name=token ]
-              Variable [ Name=tokenUnranked ]
-              Variable [ Name=idCSX ]
-              Variable [ Name=tokensDBLP ]
-              Variable [ Name=idDBLP ]
-              Variable [ Name=paperDBLP ]
-              Variable [ Name=prefixTokenDBLP ]
-              Variable [ Name=prefixTokenCSX ]
-              Variable [ Name=paperCSX ]
+              Variable [ Name=$token ]
+              GROUP AS
+              Variable [ Name=#3 ]
+              (
+              Variable [ Name=$id ]
+               AS id
+              Variable [ Name=$token ]
+               AS token
+              Variable [ Name=$paper ]
+               AS paper
+              Variable [ Name=$tokenUnranked ]
+               AS tokenUnranked
+              Variable [ Name=$idCSX ]
+               AS idCSX
+              Variable [ Name=$tokensDBLP ]
+               AS tokensDBLP
+              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
               FunctionCall fuzzyjoin.count@1[
-                Variable [ Name=id ]
+                (
+                  SELECT ELEMENT [
+                  FieldAccessor [
+                    Variable [ Name=#4 ]
+                    Field=id
+                  ]
+                  ]
+                  FROM [                    Variable [ Name=#3 ]
+                    AS
+                    Variable [ Name=#4 ]
+                  ]
+                )
               ]
               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=tokenUnranked ]
+            Variable [ Name=$tokenUnranked ]
             =
-            Variable [ Name=tokenRanked ]
+            Variable [ Name=$tokenRanked ]
           ]
         Orderby
-          Variable [ Name=i ]
+          Variable [ Name=$i ]
           ASC
 
       )
-    LetVariable [ Name=sim ]
+    Let Variable [ Name=$sim ]
       :=
       FunctionCall fuzzyjoin.similarity-jaccard-prefix@6[
         FunctionCall fuzzyjoin.len@1[
           FunctionCall fuzzyjoin.counthashed-word-tokens@1[
             FieldAccessor [
-              Variable [ Name=paperDBLP ]
+              Variable [ Name=$paperDBLP ]
               Field=title
             ]
           ]
         ]
-        Variable [ Name=tokensDBLP ]
+        Variable [ Name=$tokensDBLP ]
         FunctionCall fuzzyjoin.len@1[
           FunctionCall fuzzyjoin.counthashed-word-tokens@1[
             FieldAccessor [
-              Variable [ Name=paperCSX ]
+              Variable [ Name=$paperCSX ]
               Field=title
             ]
           ]
         ]
-        Variable [ Name=tokensCSX ]
-        Variable [ Name=prefixTokenDBLP ]
+        Variable [ Name=$tokensCSX ]
+        Variable [ Name=$prefixTokenDBLP ]
         LiteralExpr [FLOAT] [0.5]
       ]
     Where
       OperatorExpr [
         OperatorExpr [
-          Variable [ Name=prefixTokenDBLP ]
+          Variable [ Name=$prefixTokenDBLP ]
           =
-          Variable [ Name=prefixTokenCSX ]
+          Variable [ Name=$prefixTokenCSX ]
         ]
         and
         OperatorExpr [
-          Variable [ Name=sim ]
+          Variable [ Name=$sim ]
           >=
           LiteralExpr [FLOAT] [0.5]
         ]
       ]
     Groupby
-      Variable [ Name=idDBLP ]
+      Variable [ Name=$idDBLP ]
       :=
-      Variable [ Name=idDBLP ]
-      Variable [ Name=idCSX ]
+      Variable [ Name=$idDBLP ]
+      Variable [ Name=$idCSX ]
       :=
-      Variable [ Name=idCSX ]
-      Variable [ Name=sim ]
+      Variable [ Name=$idCSX ]
+      Variable [ Name=$sim ]
       :=
-      Variable [ Name=sim ]
-      With
-      Variable [ Name=sim ]
-      Variable [ Name=tokensCSX ]
-      Variable [ Name=idCSX ]
-      Variable [ Name=tokensDBLP ]
-      Variable [ Name=idDBLP ]
-      Variable [ Name=paperDBLP ]
-      Variable [ Name=prefixTokenDBLP ]
-      Variable [ Name=prefixTokenCSX ]
-      Variable [ Name=paperCSX ]
+      Variable [ Name=$sim ]
+      GROUP AS
+      Variable [ Name=#5 ]
+      (
+      Variable [ Name=$sim ]
+       AS sim
+      Variable [ Name=$tokensCSX ]
+       AS tokensCSX
+      Variable [ Name=$idCSX ]
+       AS idCSX
+      Variable [ Name=$tokensDBLP ]
+       AS tokensDBLP
+      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
+      )
 
   )
   AS
-  Variable [ Name=ridpair ]
+  Variable [ Name=$ridpair ]
 ,
   FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=paperDBLP ]
+  Variable [ Name=$paperDBLP ]
 ,
   FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [CSX]
   ]
   AS
-  Variable [ Name=paperCSX ]
+  Variable [ Name=$paperCSX ]
 ]
 Where
   OperatorExpr [
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=ridpair ]
+        Variable [ Name=$ridpair ]
         Field=idDBLP
       ]
       =
       FieldAccessor [
-        Variable [ Name=paperDBLP ]
+        Variable [ Name=$paperDBLP ]
         Field=id
       ]
     ]
     and
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=ridpair ]
+        Variable [ Name=$ridpair ]
         Field=idCSX
       ]
       =
       FieldAccessor [
-        Variable [ Name=paperCSX ]
+        Variable [ Name=$paperCSX ]
         Field=id
       ]
     ]
   ]
 Orderby
   FieldAccessor [
-    Variable [ Name=paperDBLP ]
+    Variable [ Name=$paperDBLP ]
     Field=id
   ]
   ASC
   FieldAccessor [
-    Variable [ Name=paperCSX ]
+    Variable [ Name=$paperCSX ]
     Field=id
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-3_4/dblp-csx-3_4.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-3_4/dblp-csx-3_4.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-3_4/dblp-csx-3_4.3.ast
index 342922b..4e9103a 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-3_4/dblp-csx-3_4.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-3_4/dblp-csx-3_4.3.ast
@@ -6,18 +6,18 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [dblp]
     :
-    Variable [ Name=paperDBLP ]
+    Variable [ Name=$paperDBLP ]
   )
   (
     LiteralExpr [STRING] [csx]
     :
-    Variable [ Name=paperCSX ]
+    Variable [ Name=$paperCSX ]
   )
   (
     LiteralExpr [STRING] [sim]
     :
     FieldAccessor [
-      Variable [ Name=ridpair ]
+      Variable [ Name=$ridpair ]
       Field=sim
     ]
   )
@@ -29,18 +29,18 @@ FROM [  (
       (
         LiteralExpr [STRING] [idDBLP]
         :
-        Variable [ Name=idDBLP ]
+        Variable [ Name=$idDBLP ]
       )
       (
         LiteralExpr [STRING] [idCSX]
         :
-        Variable [ Name=idCSX ]
+        Variable [ Name=$idCSX ]
       )
       (
         LiteralExpr [STRING] [sim]
         :
         IndexAccessor [
-          Variable [ Name=sim ]
+          Variable [ Name=$sim ]
           Index:           LiteralExpr [LONG] [0]
         ]
       )
@@ -50,7 +50,7 @@ FROM [  (
         LiteralExpr [STRING] [DBLP]
       ]
       AS
-      Variable [ Name=paperDBLP ]
+      Variable [ Name=$paperDBLP ]
 ,
       FunctionCall fuzzyjoin.subset-collection@3[
         FunctionCall Metadata.dataset@1[
@@ -67,13 +67,13 @@ FROM [  (
         ]
       ]
       AS
-      Variable [ Name=prefixTokenDBLP ]
+      Variable [ Name=$prefixTokenDBLP ]
 ,
       FunctionCall Metadata.dataset@1[
         LiteralExpr [STRING] [CSX]
       ]
       AS
-      Variable [ Name=paperCSX ]
+      Variable [ Name=$paperCSX ]
 ,
       FunctionCall fuzzyjoin.subset-collection@3[
         FunctionCall Metadata.dataset@1[
@@ -90,292 +90,357 @@ FROM [  (
         ]
       ]
       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=tokensUnrankedDBLP ]
+    Let Variable [ Name=$tokensUnrankedDBLP ]
       :=
       FunctionCall fuzzyjoin.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=tokensUnrankedDBLP ]
+        FROM [          Variable [ Name=$tokensUnrankedDBLP ]
           AS
-          Variable [ Name=tokenUnranked ]
+          Variable [ Name=$tokenUnranked ]
 ,
           (
             SELECT ELEMENT [
-            Variable [ Name=tokenGroupped ]
+            Variable [ Name=$tokenGroupped ]
             ]
             FROM [              FunctionCall Metadata.dataset@1[
                 LiteralExpr [STRING] [DBLP]
               ]
               AS
-              Variable [ Name=paper ]
+              Variable [ Name=$paper ]
 ,
               FunctionCall fuzzyjoin.counthashed-word-tokens@1[
                 FieldAccessor [
-                  Variable [ Name=paper ]
+                  Variable [ Name=$paper ]
                   Field=title
                 ]
               ]
               AS
-              Variable [ Name=token ]
+              Variable [ Name=$token ]
             ]
-            LetVariable [ Name=id ]
+            Let Variable [ Name=$id ]
               :=
               FieldAccessor [
-                Variable [ Name=paper ]
+                Variable [ Name=$paper ]
                 Field=id
               ]
             Groupby
-              Variable [ Name=tokenGroupped ]
+              Variable [ Name=$tokenGroupped ]
               :=
-              Variable [ Name=token ]
-              With
-              Variable [ Name=id ]
-              Variable [ Name=paper ]
-              Variable [ Name=token ]
-              Variable [ Name=tokenUnranked ]
-              Variable [ Name=tokensUnrankedDBLP ]
-              Variable [ Name=idDBLP ]
-              Variable [ Name=paperDBLP ]
-              Variable [ Name=prefixTokenDBLP ]
-              Variable [ Name=prefixTokenCSX ]
-              Variable [ Name=paperCSX ]
+              Variable [ Name=$token ]
+              GROUP AS
+              Variable [ Name=#1 ]
+              (
+              Variable [ Name=$id ]
+               AS id
+              Variable [ Name=$token ]
+               AS token
+              Variable [ Name=$paper ]
+               AS paper
+              Variable [ Name=$tokenUnranked ]
+               AS tokenUnranked
+              Variable [ Name=$tokensUnrankedDBLP ]
+               AS tokensUnrankedDBLP
+              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
               FunctionCall fuzzyjoin.count@1[
-                Variable [ Name=id ]
+                (
+                  SELECT ELEMENT [
+                  FieldAccessor [
+                    Variable [ Name=#2 ]
+                    Field=id
+                  ]
+                  ]
+                  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=tokenUnranked ]
+            Variable [ Name=$tokenUnranked ]
             =
-            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=tokensUnrankedCSX ]
+    Let Variable [ Name=$tokensUnrankedCSX ]
       :=
       FunctionCall fuzzyjoin.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=tokensUnrankedCSX ]
+        FROM [          Variable [ Name=$tokensUnrankedCSX ]
           AS
-          Variable [ Name=tokenUnranked ]
+          Variable [ Name=$tokenUnranked ]
 ,
           (
             SELECT ELEMENT [
-            Variable [ Name=tokenGroupped ]
+            Variable [ Name=$tokenGroupped ]
             ]
             FROM [              FunctionCall Metadata.dataset@1[
                 LiteralExpr [STRING] [DBLP]
               ]
               AS
-              Variable [ Name=paper ]
+              Variable [ Name=$paper ]
 ,
               FunctionCall fuzzyjoin.counthashed-word-tokens@1[
                 FieldAccessor [
-                  Variable [ Name=paper ]
+                  Variable [ Name=$paper ]
                   Field=title
                 ]
               ]
               AS
-              Variable [ Name=token ]
+              Variable [ Name=$token ]
             ]
-            LetVariable [ Name=id ]
+            Let Variable [ Name=$id ]
               :=
               FieldAccessor [
-                Variable [ Name=paper ]
+                Variable [ Name=$paper ]
                 Field=id
               ]
             Groupby
-              Variable [ Name=tokenGroupped ]
+              Variable [ Name=$tokenGroupped ]
               :=
-              Variable [ Name=token ]
-              With
-              Variable [ Name=id ]
-              Variable [ Name=paper ]
-              Variable [ Name=token ]
-              Variable [ Name=tokenUnranked ]
-              Variable [ Name=tokensUnrankedCSX ]
-              Variable [ Name=idCSX ]
-              Variable [ Name=tokensDBLP ]
-              Variable [ Name=tokensUnrankedDBLP ]
-              Variable [ Name=idDBLP ]
-              Variable [ Name=paperDBLP ]
-              Variable [ Name=prefixTokenDBLP ]
-              Variable [ Name=prefixTokenCSX ]
-              Variable [ Name=paperCSX ]
+              Variable [ Name=$token ]
+              GROUP AS
+              Variable [ Name=#3 ]
+              (
+              Variable [ Name=$id ]
+               AS id
+              Variable [ Name=$token ]
+               AS token
+              Variable [ Name=$paper ]
+               AS paper
+              Variable [ Name=$tokenUnranked ]
+               AS tokenUnranked
+              Variable [ Name=$tokensUnrankedCSX ]
+               AS tokensUnrankedCSX
+              Variable [ Name=$idCSX ]
+               AS idCSX
+              Variable [ Name=$tokensDBLP ]
+               AS tokensDBLP
+              Variable [ Name=$tokensUnrankedDBLP ]
+               AS tokensUnrankedDBLP
+              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
               FunctionCall fuzzyjoin.count@1[
-                Variable [ Name=id ]
+                (
+                  SELECT ELEMENT [
+                  FieldAccessor [
+                    Variable [ Name=#4 ]
+                    Field=id
+                  ]
+                  ]
+                  FROM [                    Variable [ Name=#3 ]
+                    AS
+                    Variable [ Name=#4 ]
+                  ]
+                )
               ]
               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=tokenUnranked ]
+            Variable [ Name=$tokenUnranked ]
             =
-            Variable [ Name=tokenRanked ]
+            Variable [ Name=$tokenRanked ]
           ]
         Orderby
-          Variable [ Name=i ]
+          Variable [ Name=$i ]
           ASC
 
       )
-    LetVariable [ Name=sim ]
+    Let Variable [ Name=$sim ]
       :=
       FunctionCall fuzzyjoin.similarity-jaccard-prefix@6[
         FunctionCall fuzzyjoin.len@1[
-          Variable [ Name=tokensUnrankedDBLP ]
+          Variable [ Name=$tokensUnrankedDBLP ]
         ]
-        Variable [ Name=tokensDBLP ]
+        Variable [ Name=$tokensDBLP ]
         FunctionCall fuzzyjoin.len@1[
-          Variable [ Name=tokensUnrankedCSX ]
+          Variable [ Name=$tokensUnrankedCSX ]
         ]
-        Variable [ Name=tokensCSX ]
-        Variable [ Name=prefixTokenDBLP ]
+        Variable [ Name=$tokensCSX ]
+        Variable [ Name=$prefixTokenDBLP ]
         LiteralExpr [FLOAT] [0.5]
       ]
     Where
       OperatorExpr [
         OperatorExpr [
-          Variable [ Name=prefixTokenDBLP ]
+          Variable [ Name=$prefixTokenDBLP ]
           =
-          Variable [ Name=prefixTokenCSX ]
+          Variable [ Name=$prefixTokenCSX ]
         ]
         and
         OperatorExpr [
-          Variable [ Name=sim ]
+          Variable [ Name=$sim ]
           >=
           LiteralExpr [FLOAT] [0.5]
         ]
       ]
     Groupby
-      Variable [ Name=idDBLP ]
+      Variable [ Name=$idDBLP ]
       :=
-      Variable [ Name=idDBLP ]
-      Variable [ Name=idCSX ]
+      Variable [ Name=$idDBLP ]
+      Variable [ Name=$idCSX ]
       :=
-      Variable [ Name=idCSX ]
-      Variable [ Name=sim ]
+      Variable [ Name=$idCSX ]
+      Variable [ Name=$sim ]
       :=
-      Variable [ Name=sim ]
-      With
-      Variable [ Name=sim ]
-      Variable [ Name=tokensCSX ]
-      Variable [ Name=tokensUnrankedCSX ]
-      Variable [ Name=idCSX ]
-      Variable [ Name=tokensDBLP ]
-      Variable [ Name=tokensUnrankedDBLP ]
-      Variable [ Name=idDBLP ]
-      Variable [ Name=paperDBLP ]
-      Variable [ Name=prefixTokenDBLP ]
-      Variable [ Name=prefixTokenCSX ]
-      Variable [ Name=paperCSX ]
+      Variable [ Name=$sim ]
+      GROUP AS
+      Variable [ Name=#5 ]
+      (
+      Variable [ Name=$sim ]
+       AS sim
+      Variable [ Name=$tokensCSX ]
+       AS tokensCSX
+      Variable [ Name=$tokensUnrankedCSX ]
+       AS tokensUnrankedCSX
+      Variable [ Name=$idCSX ]
+       AS idCSX
+      Variable [ Name=$tokensDBLP ]
+       AS tokensDBLP
+      Variable [ Name=$tokensUnrankedDBLP ]
+       AS tokensUnrankedDBLP
+      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
+      )
 
   )
   AS
-  Variable [ Name=ridpair ]
+  Variable [ Name=$ridpair ]
 ,
   FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=paperDBLP ]
+  Variable [ Name=$paperDBLP ]
 ,
   FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [CSX]
   ]
   AS
-  Variable [ Name=paperCSX ]
+  Variable [ Name=$paperCSX ]
 ]
 Where
   OperatorExpr [
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=ridpair ]
+        Variable [ Name=$ridpair ]
         Field=idDBLP
       ]
       =
       FieldAccessor [
-        Variable [ Name=paperDBLP ]
+        Variable [ Name=$paperDBLP ]
         Field=id
       ]
     ]
     and
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=ridpair ]
+        Variable [ Name=$ridpair ]
         Field=idCSX
       ]
       =
       FieldAccessor [
-        Variable [ Name=paperCSX ]
+        Variable [ Name=$paperCSX ]
         Field=id
       ]
     ]
   ]
 Orderby
   FieldAccessor [
-    Variable [ Name=paperDBLP ]
+    Variable [ Name=$paperDBLP ]
     Field=id
   ]
   ASC
   FieldAccessor [
-    Variable [ Name=paperCSX ]
+    Variable [ Name=$paperCSX ]
     Field=id
   ]
   ASC

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-3_5.1/dblp-csx-3_5.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-3_5.1/dblp-csx-3_5.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-3_5.1/dblp-csx-3_5.3.ast
index bf53a65..7f6a679 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-3_5.1/dblp-csx-3_5.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-3_5.1/dblp-csx-3_5.3.ast
@@ -6,18 +6,18 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [dblp]
     :
-    Variable [ Name=paperDBLP ]
+    Variable [ Name=$paperDBLP ]
   )
   (
     LiteralExpr [STRING] [csx]
     :
-    Variable [ Name=paperCSX ]
+    Variable [ Name=$paperCSX ]
   )
   (
     LiteralExpr [STRING] [sim]
     :
     FieldAccessor [
-      Variable [ Name=ridpair ]
+      Variable [ Name=$ridpair ]
       Field=sim
     ]
   )
@@ -29,18 +29,18 @@ FROM [  (
       (
         LiteralExpr [STRING] [idDBLP]
         :
-        Variable [ Name=idDBLP ]
+        Variable [ Name=$idDBLP ]
       )
       (
         LiteralExpr [STRING] [idCSX]
         :
-        Variable [ Name=idCSX ]
+        Variable [ Name=$idCSX ]
       )
       (
         LiteralExpr [STRING] [sim]
         :
         IndexAccessor [
-          Variable [ Name=sim ]
+          Variable [ Name=$sim ]
           Index:           LiteralExpr [LONG] [0]
         ]
       )
@@ -50,7 +50,7 @@ FROM [  (
         LiteralExpr [STRING] [DBLP]
       ]
       AS
-      Variable [ Name=paperDBLP ]
+      Variable [ Name=$paperDBLP ]
 ,
       FunctionCall fuzzyjoin.subset-collection@3[
         FunctionCall Metadata.dataset@1[
@@ -67,13 +67,13 @@ FROM [  (
         ]
       ]
       AS
-      Variable [ Name=prefixTokenDBLP ]
+      Variable [ Name=$prefixTokenDBLP ]
 ,
       FunctionCall Metadata.dataset@1[
         LiteralExpr [STRING] [CSX]
       ]
       AS
-      Variable [ Name=paperCSX ]
+      Variable [ Name=$paperCSX ]
 ,
       FunctionCall fuzzyjoin.subset-collection@3[
         FunctionCall Metadata.dataset@1[
@@ -90,300 +90,370 @@ FROM [  (
         ]
       ]
       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=tokensUnrankedDBLP ]
+    Let Variable [ Name=$tokensUnrankedDBLP ]
       :=
       FunctionCall fuzzyjoin.counthashed-word-tokens@1[
         FieldAccessor [
-          Variable [ Name=paperDBLP ]
+          Variable [ Name=$paperDBLP ]
           Field=title
         ]
       ]
-    LetVariable [ Name=lenDBLP ]
+    Let Variable [ Name=$lenDBLP ]
       :=
       FunctionCall fuzzyjoin.len@1[
-        Variable [ Name=tokensUnrankedDBLP ]
+        Variable [ Name=$tokensUnrankedDBLP ]
       ]
-    LetVariable [ Name=tokensDBLP ]
+    Let Variable [ Name=$tokensDBLP ]
       :=
       (
         SELECT ELEMENT [
-        Variable [ Name=i ]
+        Variable [ Name=$i ]
         ]
-        FROM [          Variable [ Name=tokensUnrankedDBLP ]
+        FROM [          Variable [ Name=$tokensUnrankedDBLP ]
           AS
-          Variable [ Name=tokenUnranked ]
+          Variable [ Name=$tokenUnranked ]
 ,
           (
             SELECT ELEMENT [
-            Variable [ Name=tokenGrouped ]
+            Variable [ Name=$tokenGrouped ]
             ]
             FROM [              FunctionCall Metadata.dataset@1[
                 LiteralExpr [STRING] [DBLP]
               ]
               AS
-              Variable [ Name=paper ]
+              Variable [ Name=$paper ]
 ,
               FunctionCall fuzzyjoin.counthashed-word-tokens@1[
                 FieldAccessor [
-                  Variable [ Name=paper ]
+                  Variable [ Name=$paper ]
                   Field=title
                 ]
               ]
               AS
-              Variable [ Name=token ]
+              Variable [ Name=$token ]
             ]
-            LetVariable [ Name=id ]
+            Let Variable [ Name=$id ]
               :=
               FieldAccessor [
-                Variable [ Name=paper ]
+                Variable [ Name=$paper ]
                 Field=id
               ]
             Groupby
-              Variable [ Name=tokenGrouped ]
+              Variable [ Name=$tokenGrouped ]
               :=
-              Variable [ Name=token ]
-              With
-              Variable [ Name=id ]
-              Variable [ Name=paper ]
-              Variable [ Name=token ]
-              Variable [ Name=tokenUnranked ]
-              Variable [ Name=lenDBLP ]
-              Variable [ Name=tokensUnrankedDBLP ]
-              Variable [ Name=idDBLP ]
-              Variable [ Name=paperDBLP ]
-              Variable [ Name=prefixTokenDBLP ]
-              Variable [ Name=prefixTokenCSX ]
-              Variable [ Name=paperCSX ]
+              Variable [ Name=$token ]
+              GROUP AS
+              Variable [ Name=#1 ]
+              (
+              Variable [ Name=$id ]
+               AS id
+              Variable [ Name=$token ]
+               AS token
+              Variable [ Name=$paper ]
+               AS paper
+              Variable [ Name=$tokenUnranked ]
+               AS tokenUnranked
+              Variable [ Name=$lenDBLP ]
+               AS lenDBLP
+              Variable [ Name=$tokensUnrankedDBLP ]
+               AS tokensUnrankedDBLP
+              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
               FunctionCall fuzzyjoin.count@1[
-                Variable [ Name=id ]
+                (
+                  SELECT ELEMENT [
+                  FieldAccessor [
+                    Variable [ Name=#2 ]
+                    Field=id
+                  ]
+                  ]
+                  FROM [                    Variable [ Name=#1 ]
+                    AS
+                    Variable [ Name=#2 ]
+                  ]
+                )
               ]
               ASC
-              Variable [ Name=tokenGrouped ]
+              Variable [ Name=$tokenGrouped ]
               ASC
 
           )
           AS
-          Variable [ Name=tokenRanked ]
+          Variable [ Name=$tokenRanked ]
           AT
-          Variable [ Name=i ]
+          Variable [ Name=$i ]
         ]
         Where
           OperatorExpr [
-            Variable [ Name=tokenUnranked ]
+            Variable [ Name=$tokenUnranked ]
             =
-            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=tokensUnrankedCSX ]
+    Let Variable [ Name=$tokensUnrankedCSX ]
       :=
       FunctionCall fuzzyjoin.counthashed-word-tokens@1[
         FieldAccessor [
-          Variable [ Name=paperCSX ]
+          Variable [ Name=$paperCSX ]
           Field=title
         ]
       ]
-    LetVariable [ Name=lenCSX ]
+    Let Variable [ Name=$lenCSX ]
       :=
       FunctionCall fuzzyjoin.len@1[
-        Variable [ Name=tokensUnrankedCSX ]
+        Variable [ Name=$tokensUnrankedCSX ]
       ]
-    LetVariable [ Name=tokensCSX ]
+    Let Variable [ Name=$tokensCSX ]
       :=
       (
         SELECT ELEMENT [
-        Variable [ Name=i ]
+        Variable [ Name=$i ]
         ]
-        FROM [          Variable [ Name=tokensUnrankedCSX ]
+        FROM [          Variable [ Name=$tokensUnrankedCSX ]
           AS
-          Variable [ Name=tokenUnranked ]
+          Variable [ Name=$tokenUnranked ]
 ,
           (
             SELECT ELEMENT [
-            Variable [ Name=tokenGrouped ]
+            Variable [ Name=$tokenGrouped ]
             ]
             FROM [              FunctionCall Metadata.dataset@1[
                 LiteralExpr [STRING] [DBLP]
               ]
               AS
-              Variable [ Name=paper ]
+              Variable [ Name=$paper ]
 ,
               FunctionCall fuzzyjoin.counthashed-word-tokens@1[
                 FieldAccessor [
-                  Variable [ Name=paper ]
+                  Variable [ Name=$paper ]
                   Field=title
                 ]
               ]
               AS
-              Variable [ Name=token ]
+              Variable [ Name=$token ]
             ]
-            LetVariable [ Name=id ]
+            Let Variable [ Name=$id ]
               :=
               FieldAccessor [
-                Variable [ Name=paper ]
+                Variable [ Name=$paper ]
                 Field=id
               ]
             Groupby
-              Variable [ Name=tokenGrouped ]
+              Variable [ Name=$tokenGrouped ]
               :=
-              Variable [ Name=token ]
-              With
-              Variable [ Name=id ]
-              Variable [ Name=paper ]
-              Variable [ Name=token ]
-              Variable [ Name=tokenUnranked ]
-              Variable [ Name=lenCSX ]
-              Variable [ Name=tokensUnrankedCSX ]
-              Variable [ Name=idCSX ]
-              Variable [ Name=tokensDBLP ]
-              Variable [ Name=lenDBLP ]
-              Variable [ Name=tokensUnrankedDBLP ]
-              Variable [ Name=idDBLP ]
-              Variable [ Name=paperDBLP ]
-              Variable [ Name=prefixTokenDBLP ]
-              Variable [ Name=prefixTokenCSX ]
-              Variable [ Name=paperCSX ]
+              Variable [ Name=$token ]
+              GROUP AS
+              Variable [ Name=#3 ]
+              (
+              Variable [ Name=$id ]
+               AS id
+              Variable [ Name=$token ]
+               AS token
+              Variable [ Name=$paper ]
+               AS paper
+              Variable [ Name=$tokenUnranked ]
+               AS tokenUnranked
+              Variable [ Name=$lenCSX ]
+               AS lenCSX
+              Variable [ Name=$tokensUnrankedCSX ]
+               AS tokensUnrankedCSX
+              Variable [ Name=$idCSX ]
+               AS idCSX
+              Variable [ Name=$tokensDBLP ]
+               AS tokensDBLP
+              Variable [ Name=$lenDBLP ]
+               AS lenDBLP
+              Variable [ Name=$tokensUnrankedDBLP ]
+               AS tokensUnrankedDBLP
+              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
               FunctionCall fuzzyjoin.count@1[
-                Variable [ Name=id ]
+                (
+                  SELECT ELEMENT [
+                  FieldAccessor [
+                    Variable [ Name=#4 ]
+                    Field=id
+                  ]
+                  ]
+                  FROM [                    Variable [ Name=#3 ]
+                    AS
+                    Variable [ Name=#4 ]
+                  ]
+                )
               ]
               ASC
-              Variable [ Name=tokenGrouped ]
+              Variable [ Name=$tokenGrouped ]
               ASC
 
           )
           AS
-          Variable [ Name=tokenRanked ]
+          Variable [ Name=$tokenRanked ]
           AT
-          Variable [ Name=i ]
+          Variable [ Name=$i ]
         ]
         Where
           OperatorExpr [
-            Variable [ Name=tokenUnranked ]
+            Variable [ Name=$tokenUnranked ]
             =
-            Variable [ Name=tokenRanked ]
+            Variable [ Name=$tokenRanked ]
           ]
         Orderby
-          Variable [ Name=i ]
+          Variable [ Name=$i ]
           ASC
 
       )
-    LetVariable [ Name=sim ]
+    Let Variable [ Name=$sim ]
       :=
       FunctionCall fuzzyjoin.similarity-jaccard-prefix@6[
-        Variable [ Name=lenDBLP ]
-        Variable [ Name=tokensDBLP ]
-        Variable [ Name=lenCSX ]
-        Variable [ Name=tokensCSX ]
-        Variable [ Name=prefixTokenDBLP ]
+        Variable [ Name=$lenDBLP ]
+        Variable [ Name=$tokensDBLP ]
+        Variable [ Name=$lenCSX ]
+        Variable [ Name=$tokensCSX ]
+        Variable [ Name=$prefixTokenDBLP ]
         LiteralExpr [FLOAT] [0.5]
       ]
     Where
       OperatorExpr [
         OperatorExpr [
-          Variable [ Name=prefixTokenDBLP ]
+          Variable [ Name=$prefixTokenDBLP ]
           =
-          Variable [ Name=prefixTokenCSX ]
+          Variable [ Name=$prefixTokenCSX ]
         ]
         and
         OperatorExpr [
-          Variable [ Name=sim ]
+          Variable [ Name=$sim ]
           >=
           LiteralExpr [FLOAT] [0.5]
         ]
       ]
     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=sim ]
-      Variable [ Name=tokensCSX ]
-      Variable [ Name=lenCSX ]
-      Variable [ Name=tokensUnrankedCSX ]
-      Variable [ Name=idCSX ]
-      Variable [ Name=tokensDBLP ]
-      Variable [ Name=lenDBLP ]
-      Variable [ Name=tokensUnrankedDBLP ]
-      Variable [ Name=idDBLP ]
-      Variable [ Name=paperDBLP ]
-      Variable [ Name=prefixTokenDBLP ]
-      Variable [ Name=prefixTokenCSX ]
-      Variable [ Name=paperCSX ]
+      Variable [ Name=$idCSX ]
+      GROUP AS
+      Variable [ Name=#5 ]
+      (
+      Variable [ Name=$sim ]
+       AS sim
+      Variable [ Name=$tokensCSX ]
+       AS tokensCSX
+      Variable [ Name=$lenCSX ]
+       AS lenCSX
+      Variable [ Name=$tokensUnrankedCSX ]
+       AS tokensUnrankedCSX
+      Variable [ Name=$idCSX ]
+       AS idCSX
+      Variable [ Name=$tokensDBLP ]
+       AS tokensDBLP
+      Variable [ Name=$lenDBLP ]
+       AS lenDBLP
+      Variable [ Name=$tokensUnrankedDBLP ]
+       AS tokensUnrankedDBLP
+      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
+      )
 
   )
   AS
-  Variable [ Name=ridpair ]
+  Variable [ Name=$ridpair ]
 ,
   FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=paperDBLP ]
+  Variable [ Name=$paperDBLP ]
 ,
   FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [CSX]
   ]
   AS
-  Variable [ Name=paperCSX ]
+  Variable [ Name=$paperCSX ]
 ]
 Where
   OperatorExpr [
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=ridpair ]
+        Variable [ Name=$ridpair ]
         Field=idDBLP
       ]
       =
       FieldAccessor [
-        Variable [ Name=paperDBLP ]
+        Variable [ Name=$paperDBLP ]
         Field=id
       ]
     ]
     and
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=ridpair ]
+        Variable [ Name=$ridpair ]
         Field=idCSX
       ]
       =
       FieldAccessor [
-        Variable [ Name=paperCSX ]
+        Variable [ Name=$paperCSX ]
         Field=id
       ]
     ]
   ]
 Orderby
   FieldAccessor [
-    Variable [ Name=paperDBLP ]
+    Variable [ Name=$paperDBLP ]
     Field=id
   ]
   ASC
   FieldAccessor [
-    Variable [ Name=paperCSX ]
+    Variable [ Name=$paperCSX ]
     Field=id
   ]
   ASC



Mime
View raw message