asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From buyin...@apache.org
Subject [20/51] [partial] incubator-asterixdb git commit: ASTERIXDB-1226: implement SQL++ core group-by semantics and syntatic sugars.
Date Mon, 28 Mar 2016 20:18:47 GMT
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-2_5.3.1/dblp-2_5.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-2_5.3.1/dblp-2_5.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-2_5.3.1/dblp-2_5.3.ast
index 2fa4b09..460fb11 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-2_5.3.1/dblp-2_5.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-2_5.3.1/dblp-2_5.3.ast
@@ -6,17 +6,17 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [id]
     :
-    Variable [ Name=idDBLP ]
+    Variable [ Name=$idDBLP ]
   )
   (
     LiteralExpr [STRING] [len]
     :
-    Variable [ Name=lenDBLP ]
+    Variable [ Name=$lenDBLP ]
   )
   (
     LiteralExpr [STRING] [tokens]
     :
-    Variable [ Name=tokensDBLP ]
+    Variable [ Name=$tokensDBLP ]
   )
 ]
 ]
@@ -24,102 +24,124 @@ FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=paperDBLP ]
+  Variable [ Name=$paperDBLP ]
 ]
-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=$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=$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
 
   )
 Orderby
-  Variable [ Name=idDBLP ]
+  Variable [ Name=$idDBLP ]
   ASC
 

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-2_5.3/dblp-2_5.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-2_5.3/dblp-2_5.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-2_5.3/dblp-2_5.3.ast
index 2fa4b09..460fb11 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-2_5.3/dblp-2_5.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-2_5.3/dblp-2_5.3.ast
@@ -6,17 +6,17 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [id]
     :
-    Variable [ Name=idDBLP ]
+    Variable [ Name=$idDBLP ]
   )
   (
     LiteralExpr [STRING] [len]
     :
-    Variable [ Name=lenDBLP ]
+    Variable [ Name=$lenDBLP ]
   )
   (
     LiteralExpr [STRING] [tokens]
     :
-    Variable [ Name=tokensDBLP ]
+    Variable [ Name=$tokensDBLP ]
   )
 ]
 ]
@@ -24,102 +24,124 @@ FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=paperDBLP ]
+  Variable [ Name=$paperDBLP ]
 ]
-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=$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=$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
 
   )
 Orderby
-  Variable [ Name=idDBLP ]
+  Variable [ Name=$idDBLP ]
   ASC
 

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-2_5/dblp-2_5.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-2_5/dblp-2_5.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-2_5/dblp-2_5.3.ast
index ff63e7d..4a9aac3 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-2_5/dblp-2_5.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-2_5/dblp-2_5.3.ast
@@ -6,17 +6,17 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [id]
     :
-    Variable [ Name=idDBLP ]
+    Variable [ Name=$idDBLP ]
   )
   (
     LiteralExpr [STRING] [len]
     :
-    Variable [ Name=lenDBLP ]
+    Variable [ Name=$lenDBLP ]
   )
   (
     LiteralExpr [STRING] [tokens]
     :
-    Variable [ Name=tokensDBLP ]
+    Variable [ Name=$tokensDBLP ]
   )
 ]
 ]
@@ -24,102 +24,124 @@ FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=paperDBLP ]
+  Variable [ Name=$paperDBLP ]
 ]
-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=$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=$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
 
   )
 Orderby
-  Variable [ Name=idDBLP ]
+  Variable [ Name=$idDBLP ]
   ASC
 

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/acc12a9b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-3_1.1/dblp-3_1.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-3_1.1/dblp-3_1.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-3_1.1/dblp-3_1.3.ast
index b4f1685..7201110 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-3_1.1/dblp-3_1.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-3_1.1/dblp-3_1.3.ast
@@ -6,18 +6,18 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [left]
     :
-    Variable [ Name=paperLeft ]
+    Variable [ Name=$paperLeft ]
   )
   (
     LiteralExpr [STRING] [right]
     :
-    Variable [ Name=paperRight ]
+    Variable [ Name=$paperRight ]
   )
   (
     LiteralExpr [STRING] [sim]
     :
     FieldAccessor [
-      Variable [ Name=ridpair ]
+      Variable [ Name=$ridpair ]
       Field=sim
     ]
   )
@@ -29,18 +29,18 @@ FROM [  (
       (
         LiteralExpr [STRING] [idLeft]
         :
-        Variable [ Name=idLeft ]
+        Variable [ Name=$idLeft ]
       )
       (
         LiteralExpr [STRING] [idRight]
         :
-        Variable [ Name=idRight ]
+        Variable [ Name=$idRight ]
       )
       (
         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=paperLeft ]
+      Variable [ Name=$paperLeft ]
 ,
       FunctionCall fuzzyjoin.subset-collection@3[
         FunctionCall Metadata.dataset@1[
@@ -65,13 +65,13 @@ FROM [  (
         ]
       ]
       AS
-      Variable [ Name=prefixTokenLeft ]
+      Variable [ Name=$prefixTokenLeft ]
 ,
       FunctionCall Metadata.dataset@1[
         LiteralExpr [STRING] [DBLP]
       ]
       AS
-      Variable [ Name=paperRight ]
+      Variable [ Name=$paperRight ]
 ,
       FunctionCall fuzzyjoin.subset-collection@3[
         FunctionCall Metadata.dataset@1[
@@ -86,288 +86,346 @@ FROM [  (
         ]
       ]
       AS
-      Variable [ Name=prefixTokenRight ]
+      Variable [ Name=$prefixTokenRight ]
     ]
-    LetVariable [ Name=lenLeft ]
+    Let Variable [ Name=$lenLeft ]
       :=
       FunctionCall fuzzyjoin.len@1[
         FunctionCall fuzzyjoin.counthashed-word-tokens@1[
           FieldAccessor [
-            Variable [ Name=paperLeft ]
+            Variable [ Name=$paperLeft ]
             Field=title
           ]
         ]
       ]
-    LetVariable [ Name=tokensLeft ]
+    Let Variable [ Name=$tokensLeft ]
       :=
       (
         SELECT ELEMENT [
-        Variable [ Name=i ]
+        Variable [ Name=$i ]
         ]
         FROM [          FunctionCall fuzzyjoin.counthashed-word-tokens@1[
             FieldAccessor [
-              Variable [ Name=paperLeft ]
+              Variable [ Name=$paperLeft ]
               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=lenLeft ]
-              Variable [ Name=paperLeft ]
-              Variable [ Name=paperRight ]
-              Variable [ Name=prefixTokenRight ]
-              Variable [ Name=prefixTokenLeft ]
+              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=$lenLeft ]
+               AS lenLeft
+              Variable [ Name=$prefixTokenRight ]
+               AS prefixTokenRight
+              Variable [ Name=$paperRight ]
+               AS paperRight
+              Variable [ Name=$prefixTokenLeft ]
+               AS prefixTokenLeft
+              Variable [ Name=$paperLeft ]
+               AS paperLeft
+              )
 
             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=lenRight ]
+    Let Variable [ Name=$lenRight ]
       :=
       FunctionCall fuzzyjoin.len@1[
         FunctionCall fuzzyjoin.counthashed-word-tokens@1[
           FieldAccessor [
-            Variable [ Name=paperRight ]
+            Variable [ Name=$paperRight ]
             Field=title
           ]
         ]
       ]
-    LetVariable [ Name=tokensRight ]
+    Let Variable [ Name=$tokensRight ]
       :=
       (
         SELECT ELEMENT [
-        Variable [ Name=i ]
+        Variable [ Name=$i ]
         ]
         FROM [          FunctionCall fuzzyjoin.counthashed-word-tokens@1[
             FieldAccessor [
-              Variable [ Name=paperRight ]
+              Variable [ Name=$paperRight ]
               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=lenRight ]
-              Variable [ Name=tokensLeft ]
-              Variable [ Name=lenLeft ]
-              Variable [ Name=paperLeft ]
-              Variable [ Name=paperRight ]
-              Variable [ Name=prefixTokenRight ]
-              Variable [ Name=prefixTokenLeft ]
+              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=$lenRight ]
+               AS lenRight
+              Variable [ Name=$tokensLeft ]
+               AS tokensLeft
+              Variable [ Name=$lenLeft ]
+               AS lenLeft
+              Variable [ Name=$prefixTokenRight ]
+               AS prefixTokenRight
+              Variable [ Name=$paperRight ]
+               AS paperRight
+              Variable [ Name=$prefixTokenLeft ]
+               AS prefixTokenLeft
+              Variable [ Name=$paperLeft ]
+               AS paperLeft
+              )
 
             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[
-        Variable [ Name=lenLeft ]
-        Variable [ Name=tokensLeft ]
-        Variable [ Name=lenRight ]
-        Variable [ Name=tokensRight ]
-        Variable [ Name=prefixTokenLeft ]
+        Variable [ Name=$lenLeft ]
+        Variable [ Name=$tokensLeft ]
+        Variable [ Name=$lenRight ]
+        Variable [ Name=$tokensRight ]
+        Variable [ Name=$prefixTokenLeft ]
         LiteralExpr [FLOAT] [0.5]
       ]
     Where
       OperatorExpr [
         OperatorExpr [
-          Variable [ Name=prefixTokenLeft ]
+          Variable [ Name=$prefixTokenLeft ]
           =
-          Variable [ Name=prefixTokenRight ]
+          Variable [ Name=$prefixTokenRight ]
         ]
         and
         OperatorExpr [
           OperatorExpr [
-            Variable [ Name=sim ]
+            Variable [ Name=$sim ]
             >=
             LiteralExpr [FLOAT] [0.5]
           ]
           and
           OperatorExpr [
             FieldAccessor [
-              Variable [ Name=paperLeft ]
+              Variable [ Name=$paperLeft ]
               Field=id
             ]
             <
             FieldAccessor [
-              Variable [ Name=paperRight ]
+              Variable [ Name=$paperRight ]
               Field=id
             ]
           ]
         ]
       ]
     Groupby
-      Variable [ Name=idLeft ]
+      Variable [ Name=$idLeft ]
       :=
       FieldAccessor [
-        Variable [ Name=paperLeft ]
+        Variable [ Name=$paperLeft ]
         Field=id
       ]
-      Variable [ Name=idRight ]
+      Variable [ Name=$idRight ]
       :=
       FieldAccessor [
-        Variable [ Name=paperRight ]
+        Variable [ Name=$paperRight ]
         Field=id
       ]
-      With
-      Variable [ Name=sim ]
-      Variable [ Name=tokensRight ]
-      Variable [ Name=lenRight ]
-      Variable [ Name=tokensLeft ]
-      Variable [ Name=lenLeft ]
-      Variable [ Name=paperLeft ]
-      Variable [ Name=paperRight ]
-      Variable [ Name=prefixTokenRight ]
-      Variable [ Name=prefixTokenLeft ]
+      GROUP AS
+      Variable [ Name=#5 ]
+      (
+      Variable [ Name=$sim ]
+       AS sim
+      Variable [ Name=$tokensRight ]
+       AS tokensRight
+      Variable [ Name=$lenRight ]
+       AS lenRight
+      Variable [ Name=$tokensLeft ]
+       AS tokensLeft
+      Variable [ Name=$lenLeft ]
+       AS lenLeft
+      Variable [ Name=$prefixTokenRight ]
+       AS prefixTokenRight
+      Variable [ Name=$paperRight ]
+       AS paperRight
+      Variable [ Name=$prefixTokenLeft ]
+       AS prefixTokenLeft
+      Variable [ Name=$paperLeft ]
+       AS paperLeft
+      )
 
   )
   AS
-  Variable [ Name=ridpair ]
+  Variable [ Name=$ridpair ]
 ,
   FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=paperLeft ]
+  Variable [ Name=$paperLeft ]
 ,
   FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=paperRight ]
+  Variable [ Name=$paperRight ]
 ]
 Where
   OperatorExpr [
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=ridpair ]
+        Variable [ Name=$ridpair ]
         Field=idLeft
       ]
       =
       FieldAccessor [
-        Variable [ Name=paperLeft ]
+        Variable [ Name=$paperLeft ]
         Field=id
       ]
     ]
     and
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=ridpair ]
+        Variable [ Name=$ridpair ]
         Field=idRight
       ]
       =
       FieldAccessor [
-        Variable [ Name=paperRight ]
+        Variable [ Name=$paperRight ]
         Field=id
       ]
     ]
   ]
 Orderby
   FieldAccessor [
-    Variable [ Name=paperLeft ]
+    Variable [ Name=$paperLeft ]
     Field=id
   ]
   ASC
   FieldAccessor [
-    Variable [ Name=paperRight ]
+    Variable [ Name=$paperRight ]
     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-3_1.2/dblp-3_1.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-3_1.2/dblp-3_1.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-3_1.2/dblp-3_1.3.ast
index b4f1685..7201110 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-3_1.2/dblp-3_1.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-3_1.2/dblp-3_1.3.ast
@@ -6,18 +6,18 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [left]
     :
-    Variable [ Name=paperLeft ]
+    Variable [ Name=$paperLeft ]
   )
   (
     LiteralExpr [STRING] [right]
     :
-    Variable [ Name=paperRight ]
+    Variable [ Name=$paperRight ]
   )
   (
     LiteralExpr [STRING] [sim]
     :
     FieldAccessor [
-      Variable [ Name=ridpair ]
+      Variable [ Name=$ridpair ]
       Field=sim
     ]
   )
@@ -29,18 +29,18 @@ FROM [  (
       (
         LiteralExpr [STRING] [idLeft]
         :
-        Variable [ Name=idLeft ]
+        Variable [ Name=$idLeft ]
       )
       (
         LiteralExpr [STRING] [idRight]
         :
-        Variable [ Name=idRight ]
+        Variable [ Name=$idRight ]
       )
       (
         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=paperLeft ]
+      Variable [ Name=$paperLeft ]
 ,
       FunctionCall fuzzyjoin.subset-collection@3[
         FunctionCall Metadata.dataset@1[
@@ -65,13 +65,13 @@ FROM [  (
         ]
       ]
       AS
-      Variable [ Name=prefixTokenLeft ]
+      Variable [ Name=$prefixTokenLeft ]
 ,
       FunctionCall Metadata.dataset@1[
         LiteralExpr [STRING] [DBLP]
       ]
       AS
-      Variable [ Name=paperRight ]
+      Variable [ Name=$paperRight ]
 ,
       FunctionCall fuzzyjoin.subset-collection@3[
         FunctionCall Metadata.dataset@1[
@@ -86,288 +86,346 @@ FROM [  (
         ]
       ]
       AS
-      Variable [ Name=prefixTokenRight ]
+      Variable [ Name=$prefixTokenRight ]
     ]
-    LetVariable [ Name=lenLeft ]
+    Let Variable [ Name=$lenLeft ]
       :=
       FunctionCall fuzzyjoin.len@1[
         FunctionCall fuzzyjoin.counthashed-word-tokens@1[
           FieldAccessor [
-            Variable [ Name=paperLeft ]
+            Variable [ Name=$paperLeft ]
             Field=title
           ]
         ]
       ]
-    LetVariable [ Name=tokensLeft ]
+    Let Variable [ Name=$tokensLeft ]
       :=
       (
         SELECT ELEMENT [
-        Variable [ Name=i ]
+        Variable [ Name=$i ]
         ]
         FROM [          FunctionCall fuzzyjoin.counthashed-word-tokens@1[
             FieldAccessor [
-              Variable [ Name=paperLeft ]
+              Variable [ Name=$paperLeft ]
               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=lenLeft ]
-              Variable [ Name=paperLeft ]
-              Variable [ Name=paperRight ]
-              Variable [ Name=prefixTokenRight ]
-              Variable [ Name=prefixTokenLeft ]
+              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=$lenLeft ]
+               AS lenLeft
+              Variable [ Name=$prefixTokenRight ]
+               AS prefixTokenRight
+              Variable [ Name=$paperRight ]
+               AS paperRight
+              Variable [ Name=$prefixTokenLeft ]
+               AS prefixTokenLeft
+              Variable [ Name=$paperLeft ]
+               AS paperLeft
+              )
 
             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=lenRight ]
+    Let Variable [ Name=$lenRight ]
       :=
       FunctionCall fuzzyjoin.len@1[
         FunctionCall fuzzyjoin.counthashed-word-tokens@1[
           FieldAccessor [
-            Variable [ Name=paperRight ]
+            Variable [ Name=$paperRight ]
             Field=title
           ]
         ]
       ]
-    LetVariable [ Name=tokensRight ]
+    Let Variable [ Name=$tokensRight ]
       :=
       (
         SELECT ELEMENT [
-        Variable [ Name=i ]
+        Variable [ Name=$i ]
         ]
         FROM [          FunctionCall fuzzyjoin.counthashed-word-tokens@1[
             FieldAccessor [
-              Variable [ Name=paperRight ]
+              Variable [ Name=$paperRight ]
               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=lenRight ]
-              Variable [ Name=tokensLeft ]
-              Variable [ Name=lenLeft ]
-              Variable [ Name=paperLeft ]
-              Variable [ Name=paperRight ]
-              Variable [ Name=prefixTokenRight ]
-              Variable [ Name=prefixTokenLeft ]
+              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=$lenRight ]
+               AS lenRight
+              Variable [ Name=$tokensLeft ]
+               AS tokensLeft
+              Variable [ Name=$lenLeft ]
+               AS lenLeft
+              Variable [ Name=$prefixTokenRight ]
+               AS prefixTokenRight
+              Variable [ Name=$paperRight ]
+               AS paperRight
+              Variable [ Name=$prefixTokenLeft ]
+               AS prefixTokenLeft
+              Variable [ Name=$paperLeft ]
+               AS paperLeft
+              )
 
             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[
-        Variable [ Name=lenLeft ]
-        Variable [ Name=tokensLeft ]
-        Variable [ Name=lenRight ]
-        Variable [ Name=tokensRight ]
-        Variable [ Name=prefixTokenLeft ]
+        Variable [ Name=$lenLeft ]
+        Variable [ Name=$tokensLeft ]
+        Variable [ Name=$lenRight ]
+        Variable [ Name=$tokensRight ]
+        Variable [ Name=$prefixTokenLeft ]
         LiteralExpr [FLOAT] [0.5]
       ]
     Where
       OperatorExpr [
         OperatorExpr [
-          Variable [ Name=prefixTokenLeft ]
+          Variable [ Name=$prefixTokenLeft ]
           =
-          Variable [ Name=prefixTokenRight ]
+          Variable [ Name=$prefixTokenRight ]
         ]
         and
         OperatorExpr [
           OperatorExpr [
-            Variable [ Name=sim ]
+            Variable [ Name=$sim ]
             >=
             LiteralExpr [FLOAT] [0.5]
           ]
           and
           OperatorExpr [
             FieldAccessor [
-              Variable [ Name=paperLeft ]
+              Variable [ Name=$paperLeft ]
               Field=id
             ]
             <
             FieldAccessor [
-              Variable [ Name=paperRight ]
+              Variable [ Name=$paperRight ]
               Field=id
             ]
           ]
         ]
       ]
     Groupby
-      Variable [ Name=idLeft ]
+      Variable [ Name=$idLeft ]
       :=
       FieldAccessor [
-        Variable [ Name=paperLeft ]
+        Variable [ Name=$paperLeft ]
         Field=id
       ]
-      Variable [ Name=idRight ]
+      Variable [ Name=$idRight ]
       :=
       FieldAccessor [
-        Variable [ Name=paperRight ]
+        Variable [ Name=$paperRight ]
         Field=id
       ]
-      With
-      Variable [ Name=sim ]
-      Variable [ Name=tokensRight ]
-      Variable [ Name=lenRight ]
-      Variable [ Name=tokensLeft ]
-      Variable [ Name=lenLeft ]
-      Variable [ Name=paperLeft ]
-      Variable [ Name=paperRight ]
-      Variable [ Name=prefixTokenRight ]
-      Variable [ Name=prefixTokenLeft ]
+      GROUP AS
+      Variable [ Name=#5 ]
+      (
+      Variable [ Name=$sim ]
+       AS sim
+      Variable [ Name=$tokensRight ]
+       AS tokensRight
+      Variable [ Name=$lenRight ]
+       AS lenRight
+      Variable [ Name=$tokensLeft ]
+       AS tokensLeft
+      Variable [ Name=$lenLeft ]
+       AS lenLeft
+      Variable [ Name=$prefixTokenRight ]
+       AS prefixTokenRight
+      Variable [ Name=$paperRight ]
+       AS paperRight
+      Variable [ Name=$prefixTokenLeft ]
+       AS prefixTokenLeft
+      Variable [ Name=$paperLeft ]
+       AS paperLeft
+      )
 
   )
   AS
-  Variable [ Name=ridpair ]
+  Variable [ Name=$ridpair ]
 ,
   FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=paperLeft ]
+  Variable [ Name=$paperLeft ]
 ,
   FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=paperRight ]
+  Variable [ Name=$paperRight ]
 ]
 Where
   OperatorExpr [
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=ridpair ]
+        Variable [ Name=$ridpair ]
         Field=idLeft
       ]
       =
       FieldAccessor [
-        Variable [ Name=paperLeft ]
+        Variable [ Name=$paperLeft ]
         Field=id
       ]
     ]
     and
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=ridpair ]
+        Variable [ Name=$ridpair ]
         Field=idRight
       ]
       =
       FieldAccessor [
-        Variable [ Name=paperRight ]
+        Variable [ Name=$paperRight ]
         Field=id
       ]
     ]
   ]
 Orderby
   FieldAccessor [
-    Variable [ Name=paperLeft ]
+    Variable [ Name=$paperLeft ]
     Field=id
   ]
   ASC
   FieldAccessor [
-    Variable [ Name=paperRight ]
+    Variable [ Name=$paperRight ]
     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-3_1/dblp-3_1.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-3_1/dblp-3_1.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-3_1/dblp-3_1.3.ast
index 2fb2585..77b36ad 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-3_1/dblp-3_1.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-3_1/dblp-3_1.3.ast
@@ -6,18 +6,18 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [left]
     :
-    Variable [ Name=paperLeft ]
+    Variable [ Name=$paperLeft ]
   )
   (
     LiteralExpr [STRING] [right]
     :
-    Variable [ Name=paperRight ]
+    Variable [ Name=$paperRight ]
   )
   (
     LiteralExpr [STRING] [sim]
     :
     FieldAccessor [
-      Variable [ Name=ridpair ]
+      Variable [ Name=$ridpair ]
       Field=sim
     ]
   )
@@ -27,13 +27,13 @@ FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=paperLeft ]
+  Variable [ Name=$paperLeft ]
 ,
   FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=paperRight ]
+  Variable [ Name=$paperRight ]
 ,
   (
     SELECT ELEMENT [
@@ -41,18 +41,18 @@ FROM [  FunctionCall Metadata.dataset@1[
       (
         LiteralExpr [STRING] [idLeft]
         :
-        Variable [ Name=idLeft ]
+        Variable [ Name=$idLeft ]
       )
       (
         LiteralExpr [STRING] [idRight]
         :
-        Variable [ Name=idRight ]
+        Variable [ Name=$idRight ]
       )
       (
         LiteralExpr [STRING] [sim]
         :
         IndexAccessor [
-          Variable [ Name=sim ]
+          Variable [ Name=$sim ]
           Index:           LiteralExpr [LONG] [0]
         ]
       )
@@ -62,7 +62,7 @@ FROM [  FunctionCall Metadata.dataset@1[
         LiteralExpr [STRING] [DBLP]
       ]
       AS
-      Variable [ Name=paperLeft ]
+      Variable [ Name=$paperLeft ]
 ,
       FunctionCall fuzzyjoin.subset-collection@3[
         FunctionCall Metadata.dataset@1[
@@ -77,13 +77,13 @@ FROM [  FunctionCall Metadata.dataset@1[
         ]
       ]
       AS
-      Variable [ Name=prefixTokenLeft ]
+      Variable [ Name=$prefixTokenLeft ]
 ,
       FunctionCall Metadata.dataset@1[
         LiteralExpr [STRING] [DBLP]
       ]
       AS
-      Variable [ Name=paperRight ]
+      Variable [ Name=$paperRight ]
 ,
       FunctionCall fuzzyjoin.subset-collection@3[
         FunctionCall Metadata.dataset@1[
@@ -98,276 +98,334 @@ FROM [  FunctionCall Metadata.dataset@1[
         ]
       ]
       AS
-      Variable [ Name=prefixTokenRight ]
+      Variable [ Name=$prefixTokenRight ]
     ]
-    LetVariable [ Name=lenLeft ]
+    Let Variable [ Name=$lenLeft ]
       :=
       FunctionCall fuzzyjoin.len@1[
         FunctionCall fuzzyjoin.counthashed-word-tokens@1[
           FieldAccessor [
-            Variable [ Name=paperLeft ]
+            Variable [ Name=$paperLeft ]
             Field=title
           ]
         ]
       ]
-    LetVariable [ Name=tokensLeft ]
+    Let Variable [ Name=$tokensLeft ]
       :=
       (
         SELECT ELEMENT [
-        Variable [ Name=i ]
+        Variable [ Name=$i ]
         ]
         FROM [          FunctionCall fuzzyjoin.counthashed-word-tokens@1[
             FieldAccessor [
-              Variable [ Name=paperLeft ]
+              Variable [ Name=$paperLeft ]
               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=lenLeft ]
-              Variable [ Name=paperLeft ]
-              Variable [ Name=paperRight ]
-              Variable [ Name=prefixTokenRight ]
-              Variable [ Name=prefixTokenLeft ]
+              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=$lenLeft ]
+               AS lenLeft
+              Variable [ Name=$prefixTokenRight ]
+               AS prefixTokenRight
+              Variable [ Name=$paperRight ]
+               AS paperRight
+              Variable [ Name=$prefixTokenLeft ]
+               AS prefixTokenLeft
+              Variable [ Name=$paperLeft ]
+               AS paperLeft
+              )
 
             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=lenRight ]
+    Let Variable [ Name=$lenRight ]
       :=
       FunctionCall fuzzyjoin.len@1[
         FunctionCall fuzzyjoin.counthashed-word-tokens@1[
           FieldAccessor [
-            Variable [ Name=paperRight ]
+            Variable [ Name=$paperRight ]
             Field=title
           ]
         ]
       ]
-    LetVariable [ Name=tokensRight ]
+    Let Variable [ Name=$tokensRight ]
       :=
       (
         SELECT ELEMENT [
-        Variable [ Name=i ]
+        Variable [ Name=$i ]
         ]
         FROM [          FunctionCall fuzzyjoin.counthashed-word-tokens@1[
             FieldAccessor [
-              Variable [ Name=paperRight ]
+              Variable [ Name=$paperRight ]
               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=lenRight ]
-              Variable [ Name=tokensLeft ]
-              Variable [ Name=lenLeft ]
-              Variable [ Name=paperLeft ]
-              Variable [ Name=paperRight ]
-              Variable [ Name=prefixTokenRight ]
-              Variable [ Name=prefixTokenLeft ]
+              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=$lenRight ]
+               AS lenRight
+              Variable [ Name=$tokensLeft ]
+               AS tokensLeft
+              Variable [ Name=$lenLeft ]
+               AS lenLeft
+              Variable [ Name=$prefixTokenRight ]
+               AS prefixTokenRight
+              Variable [ Name=$paperRight ]
+               AS paperRight
+              Variable [ Name=$prefixTokenLeft ]
+               AS prefixTokenLeft
+              Variable [ Name=$paperLeft ]
+               AS paperLeft
+              )
 
             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[
-        Variable [ Name=lenLeft ]
-        Variable [ Name=tokensLeft ]
-        Variable [ Name=lenRight ]
-        Variable [ Name=tokensRight ]
-        Variable [ Name=prefixTokenLeft ]
+        Variable [ Name=$lenLeft ]
+        Variable [ Name=$tokensLeft ]
+        Variable [ Name=$lenRight ]
+        Variable [ Name=$tokensRight ]
+        Variable [ Name=$prefixTokenLeft ]
         LiteralExpr [FLOAT] [0.5]
       ]
     Where
       OperatorExpr [
         OperatorExpr [
-          Variable [ Name=prefixTokenLeft ]
+          Variable [ Name=$prefixTokenLeft ]
           =
-          Variable [ Name=prefixTokenRight ]
+          Variable [ Name=$prefixTokenRight ]
         ]
         and
         OperatorExpr [
           OperatorExpr [
-            Variable [ Name=sim ]
+            Variable [ Name=$sim ]
             >=
             LiteralExpr [FLOAT] [0.5]
           ]
           and
           OperatorExpr [
             FieldAccessor [
-              Variable [ Name=paperLeft ]
+              Variable [ Name=$paperLeft ]
               Field=id
             ]
             <
             FieldAccessor [
-              Variable [ Name=paperRight ]
+              Variable [ Name=$paperRight ]
               Field=id
             ]
           ]
         ]
       ]
     Groupby
-      Variable [ Name=idLeft ]
+      Variable [ Name=$idLeft ]
       :=
       FieldAccessor [
-        Variable [ Name=paperLeft ]
+        Variable [ Name=$paperLeft ]
         Field=id
       ]
-      Variable [ Name=idRight ]
+      Variable [ Name=$idRight ]
       :=
       FieldAccessor [
-        Variable [ Name=paperRight ]
+        Variable [ Name=$paperRight ]
         Field=id
       ]
-      With
-      Variable [ Name=sim ]
-      Variable [ Name=tokensRight ]
-      Variable [ Name=lenRight ]
-      Variable [ Name=tokensLeft ]
-      Variable [ Name=lenLeft ]
-      Variable [ Name=paperLeft ]
-      Variable [ Name=paperRight ]
-      Variable [ Name=prefixTokenRight ]
-      Variable [ Name=prefixTokenLeft ]
+      GROUP AS
+      Variable [ Name=#5 ]
+      (
+      Variable [ Name=$sim ]
+       AS sim
+      Variable [ Name=$tokensRight ]
+       AS tokensRight
+      Variable [ Name=$lenRight ]
+       AS lenRight
+      Variable [ Name=$tokensLeft ]
+       AS tokensLeft
+      Variable [ Name=$lenLeft ]
+       AS lenLeft
+      Variable [ Name=$prefixTokenRight ]
+       AS prefixTokenRight
+      Variable [ Name=$paperRight ]
+       AS paperRight
+      Variable [ Name=$prefixTokenLeft ]
+       AS prefixTokenLeft
+      Variable [ Name=$paperLeft ]
+       AS paperLeft
+      )
 
   )
   AS
-  Variable [ Name=ridpair ]
+  Variable [ Name=$ridpair ]
 ]
 Where
   OperatorExpr [
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=ridpair ]
+        Variable [ Name=$ridpair ]
         Field=idLeft
       ]
       =
       FieldAccessor [
-        Variable [ Name=paperLeft ]
+        Variable [ Name=$paperLeft ]
         Field=id
       ]
     ]
     and
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=ridpair ]
+        Variable [ Name=$ridpair ]
         Field=idRight
       ]
       =
       FieldAccessor [
-        Variable [ Name=paperRight ]
+        Variable [ Name=$paperRight ]
         Field=id
       ]
     ]
   ]
 Orderby
   FieldAccessor [
-    Variable [ Name=paperLeft ]
+    Variable [ Name=$paperLeft ]
     Field=id
   ]
   ASC
   FieldAccessor [
-    Variable [ Name=paperRight ]
+    Variable [ Name=$paperRight ]
     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-aqlplus_1/dblp-aqlplus_1.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-aqlplus_1/dblp-aqlplus_1.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-aqlplus_1/dblp-aqlplus_1.3.ast
index e37e938..22d651f 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-aqlplus_1/dblp-aqlplus_1.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-aqlplus_1/dblp-aqlplus_1.3.ast
@@ -6,12 +6,12 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [dblp]
     :
-    Variable [ Name=dblp ]
+    Variable [ Name=$dblp ]
   )
   (
     LiteralExpr [STRING] [dblp2]
     :
-    Variable [ Name=dblp2 ]
+    Variable [ Name=$dblp2 ]
   )
 ]
 ]
@@ -19,27 +19,27 @@ FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=dblp ]
+  Variable [ Name=$dblp ]
 ,
   FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=dblp2 ]
+  Variable [ Name=$dblp2 ]
 ]
 Where
   OperatorExpr [
     OperatorExpr [
       FunctionCall fuzzyjoin.word-tokens@1[
         FieldAccessor [
-          Variable [ Name=dblp ]
+          Variable [ Name=$dblp ]
           Field=title
         ]
       ]
       ~=
       FunctionCall fuzzyjoin.word-tokens@1[
         FieldAccessor [
-          Variable [ Name=dblp2 ]
+          Variable [ Name=$dblp2 ]
           Field=title
         ]
       ]
@@ -47,24 +47,24 @@ Where
     and
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=dblp ]
+        Variable [ Name=$dblp ]
         Field=id
       ]
       <
       FieldAccessor [
-        Variable [ Name=dblp2 ]
+        Variable [ Name=$dblp2 ]
         Field=id
       ]
     ]
   ]
 Orderby
   FieldAccessor [
-    Variable [ Name=dblp ]
+    Variable [ Name=$dblp ]
     Field=id
   ]
   ASC
   FieldAccessor [
-    Variable [ Name=dblp2 ]
+    Variable [ Name=$dblp2 ]
     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-aqlplus_2/dblp-aqlplus_2.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-aqlplus_2/dblp-aqlplus_2.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-aqlplus_2/dblp-aqlplus_2.3.ast
index 21dc41f..cc6eb88 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-aqlplus_2/dblp-aqlplus_2.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-aqlplus_2/dblp-aqlplus_2.3.ast
@@ -6,12 +6,12 @@ RecordConstructor [
   (
     LiteralExpr [STRING] [dblp]
     :
-    Variable [ Name=dblp ]
+    Variable [ Name=$dblp ]
   )
   (
     LiteralExpr [STRING] [dblp2]
     :
-    Variable [ Name=dblp2 ]
+    Variable [ Name=$dblp2 ]
   )
 ]
 ]
@@ -19,48 +19,48 @@ FROM [  FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=dblp ]
+  Variable [ Name=$dblp ]
 ,
   FunctionCall Metadata.dataset@1[
     LiteralExpr [STRING] [DBLP]
   ]
   AS
-  Variable [ Name=dblp2 ]
+  Variable [ Name=$dblp2 ]
 ]
 Where
   OperatorExpr [
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=dblp ]
+        Variable [ Name=$dblp ]
         Field=title
       ]
       ~=
       FieldAccessor [
-        Variable [ Name=dblp2 ]
+        Variable [ Name=$dblp2 ]
         Field=title
       ]
     ]
     and
     OperatorExpr [
       FieldAccessor [
-        Variable [ Name=dblp ]
+        Variable [ Name=$dblp ]
         Field=id
       ]
       <
       FieldAccessor [
-        Variable [ Name=dblp2 ]
+        Variable [ Name=$dblp2 ]
         Field=id
       ]
     ]
   ]
 Orderby
   FieldAccessor [
-    Variable [ Name=dblp ]
+    Variable [ Name=$dblp ]
     Field=id
   ]
   ASC
   FieldAccessor [
-    Variable [ Name=dblp2 ]
+    Variable [ Name=$dblp2 ]
     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-2_1/dblp-csx-2_1.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-2_1/dblp-csx-2_1.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-2_1/dblp-csx-2_1.3.ast
index 8f15de3..4936e10 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-2_1/dblp-csx-2_1.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-2_1/dblp-csx-2_1.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,219 +67,272 @@ FROM [  FunctionCall Metadata.dataset@1[
     ]
   ]
   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
+  )
 
 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-2_2/dblp-csx-2_2.3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-2_2/dblp-csx-2_2.3.ast b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-2_2/dblp-csx-2_2.3.ast
index e6786e2..4093d2a 100644
--- a/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-2_2/dblp-csx-2_2.3.ast
+++ b/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/fuzzyjoin/dblp-csx-2_2/dblp-csx-2_2.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,233 +67,288 @@ FROM [  FunctionCall Metadata.dataset@1[
     ]
   ]
   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
+  )
 
 Orderby
-  Variable [ Name=idDBLP ]
+  Variable [ Name=$idDBLP ]
   ASC
-  Variable [ Name=idCSX ]
+  Variable [ Name=$idCSX ]
   ASC
 


Mime
View raw message