asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From buyin...@apache.org
Subject [17/51] [partial] incubator-asterixdb git commit: SQL++ parser: 1. refactored asterix-aql to become asterix-lang-common and asterix-lang-aql, where the former is the common part for different languages; 2. added asterix-lang-sqlpp on top of asterix-lang-
Date Fri, 30 Oct 2015 23:16:25 GMT
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-fuzzyeq-jaccard_03.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-fuzzyeq-jaccard_03.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-fuzzyeq-jaccard_03.ast
new file mode 100644
index 0000000..880a2c6
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-fuzzyeq-jaccard_03.ast
@@ -0,0 +1,71 @@
+DataverseUse test
+TypeDecl DBLPType [
+  closed RecordType {
+    id : int32,
+    dblpid : string,
+    title : string,
+    authors : string,
+    misc : string
+  }
+]
+DatasetDecl DBLP(DBLPType) partitioned by [[id]]
+WriteOutputTo nc1:rttest/inverted-index-join_word-fuzzyeq-jaccard_03.adm
+Set simfunction=jaccard
+Set simthreshold=0.5f
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [arec]
+    :
+    Variable [ Name=a ]
+  )
+  (
+    LiteralExpr [STRING] [brec]
+    :
+    Variable [ Name=b ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [DBLP]
+  ]
+  AS
+  Variable [ Name=a ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [DBLP]
+  ]
+  AS
+  Variable [ Name=b ]
+]
+Where
+  OperatorExpr [
+    OperatorExpr [
+      FunctionCall test.word-tokens@1[
+        FieldAccessor [
+          Variable [ Name=a ]
+          Field=title
+        ]
+      ]
+      ~=
+      FunctionCall test.word-tokens@1[
+        FieldAccessor [
+          Variable [ Name=b ]
+          Field=title
+        ]
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=a ]
+        Field=id
+      ]
+      <
+      FieldAccessor [
+        Variable [ Name=b ]
+        Field=id
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check-after-btree-access.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check-after-btree-access.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check-after-btree-access.ast
new file mode 100644
index 0000000..5b4c193
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check-after-btree-access.ast
@@ -0,0 +1,114 @@
+DataverseUse test
+TypeDecl TwitterUserType [
+  closed RecordType {
+    screen-name : string,
+    lang : string,
+    friends-count : int32,
+    statuses-count : int32,
+    name : string,
+    followers-count : int32
+  }
+]
+TypeDecl TweetMessageType [
+  closed RecordType {
+    tweetid : int64,
+    user : TwitterUserType,
+    sender-location : point,
+    send-time : datetime,
+    referred-topics : UnorderedList <string>
+,
+    message-text : string,
+    countA : int32,
+    countB : int32
+  }
+]
+DatasetDecl TweetMessages(TweetMessageType) partitioned by [[tweetid]]
+WriteOutputTo nc1:rttest/inverted-index-join_word-jaccard-check-after-btree-access.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [t1]
+    :
+    FieldAccessor [
+      Variable [ Name=t1 ]
+      Field=tweetid
+    ]
+  )
+  (
+    LiteralExpr [STRING] [t2]
+    :
+    FieldAccessor [
+      Variable [ Name=t2 ]
+      Field=tweetid
+    ]
+  )
+  (
+    LiteralExpr [STRING] [sim]
+    :
+    IndexAccessor [
+      Variable [ Name=sim ]
+      Index:       Variable [ Name=sim ]
+    ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [TweetMessages]
+  ]
+  AS
+  Variable [ Name=t1 ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [TweetMessages]
+  ]
+  AS
+  Variable [ Name=t2 ]
+]
+LetVariable [ Name=sim ]
+  :=
+  FunctionCall test.similarity-jaccard-check@3[
+    FunctionCall test.word-tokens@1[
+      FieldAccessor [
+        Variable [ Name=t1 ]
+        Field=message-text
+      ]
+    ]
+    FunctionCall test.word-tokens@1[
+      FieldAccessor [
+        Variable [ Name=t2 ]
+        Field=message-text
+      ]
+    ]
+    LiteralExpr [FLOAT] [0.6]
+  ]
+Where
+  OperatorExpr [
+    IndexAccessor [
+      Variable [ Name=sim ]
+      Index:       Variable [ Name=sim ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=t1 ]
+        Field=tweetid
+      ]
+      <
+      FunctionCall test.int64@1[
+        LiteralExpr [STRING] [20]
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=t2 ]
+        Field=tweetid
+      ]
+      !=
+      FieldAccessor [
+        Variable [ Name=t1 ]
+        Field=tweetid
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_01.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_01.ast
new file mode 100644
index 0000000..6586148
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_01.ast
@@ -0,0 +1,96 @@
+DataverseUse test
+TypeDecl DBLPType [
+  closed RecordType {
+    id : int32,
+    dblpid : string,
+    title : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl CSXType [
+  closed RecordType {
+    id : int32,
+    csxid : string,
+    title : string,
+    authors : string,
+    misc : string
+  }
+]
+DatasetDecl DBLP(DBLPType) partitioned by [[id]]
+DatasetDecl CSX(CSXType) partitioned by [[id]]
+WriteOutputTo nc1:rttest/inverted-index-join_word-jaccard-check_01.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [arec]
+    :
+    Variable [ Name=a ]
+  )
+  (
+    LiteralExpr [STRING] [brec]
+    :
+    Variable [ Name=b ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [DBLP]
+  ]
+  AS
+  Variable [ Name=a ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [CSX]
+  ]
+  AS
+  Variable [ Name=b ]
+]
+Where
+  OperatorExpr [
+    IndexAccessor [
+      FunctionCall test.similarity-jaccard-check@3[
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            Variable [ Name=a ]
+            Field=title
+          ]
+        ]
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            Variable [ Name=b ]
+            Field=title
+          ]
+        ]
+        LiteralExpr [FLOAT] [0.5]
+      ]
+      Index:       FunctionCall test.similarity-jaccard-check@3[
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            Variable [ Name=a ]
+            Field=title
+          ]
+        ]
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            Variable [ Name=b ]
+            Field=title
+          ]
+        ]
+        LiteralExpr [FLOAT] [0.5]
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=a ]
+        Field=id
+      ]
+      <
+      FieldAccessor [
+        Variable [ Name=b ]
+        Field=id
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_02.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_02.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_02.ast
new file mode 100644
index 0000000..0b50ff8
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_02.ast
@@ -0,0 +1,96 @@
+DataverseUse test
+TypeDecl DBLPType [
+  closed RecordType {
+    id : int32,
+    dblpid : string,
+    title : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl CSXType [
+  closed RecordType {
+    id : int32,
+    csxid : string,
+    title : string,
+    authors : string,
+    misc : string
+  }
+]
+DatasetDecl DBLP(DBLPType) partitioned by [[id]]
+DatasetDecl CSX(CSXType) partitioned by [[id]]
+WriteOutputTo nc1:rttest/inverted-index-join_word-jaccard-check_02.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [arec]
+    :
+    Variable [ Name=a ]
+  )
+  (
+    LiteralExpr [STRING] [brec]
+    :
+    Variable [ Name=b ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [DBLP]
+  ]
+  AS
+  Variable [ Name=a ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [CSX]
+  ]
+  AS
+  Variable [ Name=b ]
+]
+Where
+  OperatorExpr [
+    IndexAccessor [
+      FunctionCall test.similarity-jaccard-check@3[
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            Variable [ Name=a ]
+            Field=title
+          ]
+        ]
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            Variable [ Name=b ]
+            Field=title
+          ]
+        ]
+        LiteralExpr [FLOAT] [0.5]
+      ]
+      Index:       FunctionCall test.similarity-jaccard-check@3[
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            Variable [ Name=a ]
+            Field=title
+          ]
+        ]
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            Variable [ Name=b ]
+            Field=title
+          ]
+        ]
+        LiteralExpr [FLOAT] [0.5]
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=a ]
+        Field=id
+      ]
+      <
+      FieldAccessor [
+        Variable [ Name=b ]
+        Field=id
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_03.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_03.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_03.ast
new file mode 100644
index 0000000..3c74848
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_03.ast
@@ -0,0 +1,86 @@
+DataverseUse test
+TypeDecl DBLPType [
+  closed RecordType {
+    id : int32,
+    dblpid : string,
+    title : string,
+    authors : string,
+    misc : string
+  }
+]
+DatasetDecl DBLP(DBLPType) partitioned by [[id]]
+WriteOutputTo nc1:rttest/inverted-index-join_word-jaccard-check_03.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [arec]
+    :
+    Variable [ Name=a ]
+  )
+  (
+    LiteralExpr [STRING] [brec]
+    :
+    Variable [ Name=b ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [DBLP]
+  ]
+  AS
+  Variable [ Name=a ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [DBLP]
+  ]
+  AS
+  Variable [ Name=b ]
+]
+Where
+  OperatorExpr [
+    IndexAccessor [
+      FunctionCall test.similarity-jaccard-check@3[
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            Variable [ Name=a ]
+            Field=title
+          ]
+        ]
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            Variable [ Name=b ]
+            Field=title
+          ]
+        ]
+        LiteralExpr [FLOAT] [0.5]
+      ]
+      Index:       FunctionCall test.similarity-jaccard-check@3[
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            Variable [ Name=a ]
+            Field=title
+          ]
+        ]
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            Variable [ Name=b ]
+            Field=title
+          ]
+        ]
+        LiteralExpr [FLOAT] [0.5]
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=a ]
+        Field=id
+      ]
+      <
+      FieldAccessor [
+        Variable [ Name=b ]
+        Field=id
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_04.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_04.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_04.ast
new file mode 100644
index 0000000..711c89a
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_04.ast
@@ -0,0 +1,83 @@
+DataverseUse test
+TypeDecl DBLPType [
+  closed RecordType {
+    id : int32,
+    dblpid : string,
+    title : string,
+    authors : string,
+    misc : string
+  }
+]
+DatasetDecl DBLP(DBLPType) partitioned by [[id]]
+WriteOutputTo nc1:rttest/inverted-index-join_word-jaccard-check_04.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [arec]
+    :
+    Variable [ Name=a ]
+  )
+  (
+    LiteralExpr [STRING] [brec]
+    :
+    Variable [ Name=b ]
+  )
+  (
+    LiteralExpr [STRING] [jacc]
+    :
+    IndexAccessor [
+      Variable [ Name=jacc ]
+      Index:       Variable [ Name=jacc ]
+    ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [DBLP]
+  ]
+  AS
+  Variable [ Name=a ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [DBLP]
+  ]
+  AS
+  Variable [ Name=b ]
+]
+LetVariable [ Name=jacc ]
+  :=
+  FunctionCall test.similarity-jaccard-check@3[
+    FunctionCall test.word-tokens@1[
+      FieldAccessor [
+        Variable [ Name=a ]
+        Field=title
+      ]
+    ]
+    FunctionCall test.word-tokens@1[
+      FieldAccessor [
+        Variable [ Name=b ]
+        Field=title
+      ]
+    ]
+    LiteralExpr [FLOAT] [0.5]
+  ]
+Where
+  OperatorExpr [
+    IndexAccessor [
+      Variable [ Name=jacc ]
+      Index:       Variable [ Name=jacc ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=a ]
+        Field=id
+      ]
+      <
+      FieldAccessor [
+        Variable [ Name=b ]
+        Field=id
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard_01.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard_01.ast
new file mode 100644
index 0000000..9c3199f
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard_01.ast
@@ -0,0 +1,82 @@
+DataverseUse test
+TypeDecl DBLPType [
+  closed RecordType {
+    id : int32,
+    dblpid : string,
+    title : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl CSXType [
+  closed RecordType {
+    id : int32,
+    csxid : string,
+    title : string,
+    authors : string,
+    misc : string
+  }
+]
+DatasetDecl DBLP(DBLPType) partitioned by [[id]]
+DatasetDecl CSX(CSXType) partitioned by [[id]]
+WriteOutputTo nc1:rttest/inverted-index-join_word-jaccard_01.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [arec]
+    :
+    Variable [ Name=a ]
+  )
+  (
+    LiteralExpr [STRING] [brec]
+    :
+    Variable [ Name=b ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [DBLP]
+  ]
+  AS
+  Variable [ Name=a ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [CSX]
+  ]
+  AS
+  Variable [ Name=b ]
+]
+Where
+  OperatorExpr [
+    OperatorExpr [
+      FunctionCall test.similarity-jaccard@2[
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            Variable [ Name=a ]
+            Field=title
+          ]
+        ]
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            Variable [ Name=b ]
+            Field=title
+          ]
+        ]
+      ]
+      >=
+      LiteralExpr [FLOAT] [0.5]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=a ]
+        Field=id
+      ]
+      <
+      FieldAccessor [
+        Variable [ Name=b ]
+        Field=id
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard_02.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard_02.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard_02.ast
new file mode 100644
index 0000000..e8f2e5b
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard_02.ast
@@ -0,0 +1,82 @@
+DataverseUse test
+TypeDecl DBLPType [
+  closed RecordType {
+    id : int32,
+    dblpid : string,
+    title : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl CSXType [
+  closed RecordType {
+    id : int32,
+    csxid : string,
+    title : string,
+    authors : string,
+    misc : string
+  }
+]
+DatasetDecl DBLP(DBLPType) partitioned by [[id]]
+DatasetDecl CSX(CSXType) partitioned by [[id]]
+WriteOutputTo nc1:rttest/inverted-index-join_word-jaccard_02.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [arec]
+    :
+    Variable [ Name=a ]
+  )
+  (
+    LiteralExpr [STRING] [brec]
+    :
+    Variable [ Name=b ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [DBLP]
+  ]
+  AS
+  Variable [ Name=a ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [CSX]
+  ]
+  AS
+  Variable [ Name=b ]
+]
+Where
+  OperatorExpr [
+    OperatorExpr [
+      FunctionCall test.similarity-jaccard@2[
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            Variable [ Name=a ]
+            Field=title
+          ]
+        ]
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            Variable [ Name=b ]
+            Field=title
+          ]
+        ]
+      ]
+      >=
+      LiteralExpr [FLOAT] [0.5]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=a ]
+        Field=id
+      ]
+      <
+      FieldAccessor [
+        Variable [ Name=b ]
+        Field=id
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard_03.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard_03.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard_03.ast
new file mode 100644
index 0000000..58e6be6
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard_03.ast
@@ -0,0 +1,72 @@
+DataverseUse test
+TypeDecl DBLPType [
+  closed RecordType {
+    id : int32,
+    dblpid : string,
+    title : string,
+    authors : string,
+    misc : string
+  }
+]
+DatasetDecl DBLP(DBLPType) partitioned by [[id]]
+WriteOutputTo nc1:rttest/inverted-index-join_word-jaccard_03.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [arec]
+    :
+    Variable [ Name=a ]
+  )
+  (
+    LiteralExpr [STRING] [brec]
+    :
+    Variable [ Name=b ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [DBLP]
+  ]
+  AS
+  Variable [ Name=a ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [DBLP]
+  ]
+  AS
+  Variable [ Name=b ]
+]
+Where
+  OperatorExpr [
+    OperatorExpr [
+      FunctionCall test.similarity-jaccard@2[
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            Variable [ Name=a ]
+            Field=title
+          ]
+        ]
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            Variable [ Name=b ]
+            Field=title
+          ]
+        ]
+      ]
+      >=
+      LiteralExpr [FLOAT] [0.5]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=a ]
+        Field=id
+      ]
+      <
+      FieldAccessor [
+        Variable [ Name=b ]
+        Field=id
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard_04.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard_04.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard_04.ast
new file mode 100644
index 0000000..f1fc7c8
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard_04.ast
@@ -0,0 +1,80 @@
+DataverseUse test
+TypeDecl DBLPType [
+  closed RecordType {
+    id : int32,
+    dblpid : string,
+    title : string,
+    authors : string,
+    misc : string
+  }
+]
+DatasetDecl DBLP(DBLPType) partitioned by [[id]]
+WriteOutputTo nc1:rttest/inverted-index-join_word-jaccard_04.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [arec]
+    :
+    Variable [ Name=a ]
+  )
+  (
+    LiteralExpr [STRING] [brec]
+    :
+    Variable [ Name=b ]
+  )
+  (
+    LiteralExpr [STRING] [jacc]
+    :
+    Variable [ Name=jacc ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [DBLP]
+  ]
+  AS
+  Variable [ Name=a ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [DBLP]
+  ]
+  AS
+  Variable [ Name=b ]
+]
+LetVariable [ Name=jacc ]
+  :=
+  FunctionCall test.similarity-jaccard@2[
+    FunctionCall test.word-tokens@1[
+      FieldAccessor [
+        Variable [ Name=a ]
+        Field=title
+      ]
+    ]
+    FunctionCall test.word-tokens@1[
+      FieldAccessor [
+        Variable [ Name=b ]
+        Field=title
+      ]
+    ]
+  ]
+Where
+  OperatorExpr [
+    OperatorExpr [
+      Variable [ Name=jacc ]
+      >=
+      LiteralExpr [FLOAT] [0.5]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=a ]
+        Field=id
+      ]
+      <
+      FieldAccessor [
+        Variable [ Name=b ]
+        Field=id
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/join-super-key_01.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/join-super-key_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/join-super-key_01.ast
new file mode 100644
index 0000000..ac3d0bc
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/join-super-key_01.ast
@@ -0,0 +1,128 @@
+DataverseUse join-super-key_1
+TypeDecl SupplierType [
+  closed RecordType {
+    s_suppkey : int32,
+    s_name : string,
+    s_address : string,
+    s_nationkey : int32,
+    s_phone : string,
+    s_acctbal : double,
+    s_comment : string
+  }
+]
+TypeDecl NationType [
+  closed RecordType {
+    n_nationkey : int32,
+    n_name : string,
+    n_regionkey : int32,
+    n_comment : string
+  }
+]
+TypeDecl LineItemType [
+  closed RecordType {
+    l_orderkey : int32,
+    l_partkey : int32,
+    l_suppkey : int32,
+    l_linenumber : int32,
+    l_quantity : double,
+    l_extendedprice : double,
+    l_discount : double,
+    l_tax : double,
+    l_returnflag : string,
+    l_linestatus : string,
+    l_shipdate : string,
+    l_commitdate : string,
+    l_receiptdate : string,
+    l_shipinstruct : string,
+    l_shipmode : string,
+    l_comment : string
+  }
+]
+TypeDecl PartType [
+  closed RecordType {
+    p_partkey : int32,
+    p_name : string,
+    p_mfgr : string,
+    p_brand : string,
+    p_type : string,
+    p_size : int32,
+    p_container : string,
+    p_retailprice : double,
+    p_comment : string
+  }
+]
+TypeDecl PartSuppType [
+  closed RecordType {
+    ps_partkey : int32,
+    ps_suppkey : int32,
+    ps_availqty : int32,
+    ps_supplycost : double,
+    ps_comment : string
+  }
+]
+WriteOutputTo nc1:/tmp/join-super-key_01.adm
+DatasetDecl LineItems(LineItemType) partitioned by [[l_partkey], [l_linenumber]]
+DatasetDecl PartSupp(PartSuppType) partitioned by [[ps_partkey], [ps_suppkey]]
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [l_partkey]
+    :
+    FieldAccessor [
+      Variable [ Name=li ]
+      Field=l_partkey
+    ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [LineItems]
+  ]
+  AS
+  Variable [ Name=li ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [PartSupp]
+  ]
+  AS
+  Variable [ Name=ps ]
+]
+Where
+  OperatorExpr [
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=li ]
+        Field=l_partkey
+      ]
+      =
+      FieldAccessor [
+        Variable [ Name=ps ]
+        Field=ps_partkey
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=li ]
+        Field=l_suppkey
+      ]
+      =
+      FieldAccessor [
+        Variable [ Name=ps ]
+        Field=ps_suppkey
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=li ]
+        Field=l_extendedprice
+      ]
+      =
+      FieldAccessor [
+        Variable [ Name=ps ]
+        Field=ps_supplycost
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/join-super-key_02.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/join-super-key_02.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/join-super-key_02.ast
new file mode 100644
index 0000000..e2ed7f3
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/join-super-key_02.ast
@@ -0,0 +1,128 @@
+DataverseUse join-super-key_01
+TypeDecl SupplierType [
+  closed RecordType {
+    s_suppkey : int32,
+    s_name : string,
+    s_address : string,
+    s_nationkey : int32,
+    s_phone : string,
+    s_acctbal : double,
+    s_comment : string
+  }
+]
+TypeDecl NationType [
+  closed RecordType {
+    n_nationkey : int32,
+    n_name : string,
+    n_regionkey : int32,
+    n_comment : string
+  }
+]
+TypeDecl LineItemType [
+  closed RecordType {
+    l_orderkey : int32,
+    l_partkey : int32,
+    l_suppkey : int32,
+    l_linenumber : int32,
+    l_quantity : double,
+    l_extendedprice : double,
+    l_discount : double,
+    l_tax : double,
+    l_returnflag : string,
+    l_linestatus : string,
+    l_shipdate : string,
+    l_commitdate : string,
+    l_receiptdate : string,
+    l_shipinstruct : string,
+    l_shipmode : string,
+    l_comment : string
+  }
+]
+TypeDecl PartType [
+  closed RecordType {
+    p_partkey : int32,
+    p_name : string,
+    p_mfgr : string,
+    p_brand : string,
+    p_type : string,
+    p_size : int32,
+    p_container : string,
+    p_retailprice : double,
+    p_comment : string
+  }
+]
+TypeDecl PartSuppType [
+  closed RecordType {
+    ps_partkey : int32,
+    ps_suppkey : int32,
+    ps_availqty : int32,
+    ps_supplycost : double,
+    ps_comment : string
+  }
+]
+WriteOutputTo nc1:/tmp/join-super-key_01.adm
+DatasetDecl LineItems(LineItemType) partitioned by [[l_partkey], [l_linenumber]]
+DatasetDecl PartSupp(PartSuppType) partitioned by [[ps_partkey], [ps_suppkey]]
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [l_partkey]
+    :
+    FieldAccessor [
+      Variable [ Name=li ]
+      Field=l_partkey
+    ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [PartSupp]
+  ]
+  AS
+  Variable [ Name=ps ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [LineItems]
+  ]
+  AS
+  Variable [ Name=li ]
+]
+Where
+  OperatorExpr [
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=li ]
+        Field=l_partkey
+      ]
+      =
+      FieldAccessor [
+        Variable [ Name=ps ]
+        Field=ps_partkey
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=li ]
+        Field=l_suppkey
+      ]
+      =
+      FieldAccessor [
+        Variable [ Name=ps ]
+        Field=ps_suppkey
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=li ]
+        Field=l_extendedprice
+      ]
+      =
+      FieldAccessor [
+        Variable [ Name=ps ]
+        Field=ps_supplycost
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/limit-issue353.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/limit-issue353.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/limit-issue353.ast
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/loj-super-key_01.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/loj-super-key_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/loj-super-key_01.ast
new file mode 100644
index 0000000..183c8a7
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/loj-super-key_01.ast
@@ -0,0 +1,137 @@
+DataverseUse loj-super-key_01
+TypeDecl SupplierType [
+  closed RecordType {
+    s_suppkey : int32,
+    s_name : string,
+    s_address : string,
+    s_nationkey : int32,
+    s_phone : string,
+    s_acctbal : double,
+    s_comment : string
+  }
+]
+TypeDecl NationType [
+  closed RecordType {
+    n_nationkey : int32,
+    n_name : string,
+    n_regionkey : int32,
+    n_comment : string
+  }
+]
+TypeDecl LineItemType [
+  closed RecordType {
+    l_orderkey : int32,
+    l_partkey : int32,
+    l_suppkey : int32,
+    l_linenumber : int32,
+    l_quantity : double,
+    l_extendedprice : double,
+    l_discount : double,
+    l_tax : double,
+    l_returnflag : string,
+    l_linestatus : string,
+    l_shipdate : string,
+    l_commitdate : string,
+    l_receiptdate : string,
+    l_shipinstruct : string,
+    l_shipmode : string,
+    l_comment : string
+  }
+]
+TypeDecl PartType [
+  closed RecordType {
+    p_partkey : int32,
+    p_name : string,
+    p_mfgr : string,
+    p_brand : string,
+    p_type : string,
+    p_size : int32,
+    p_container : string,
+    p_retailprice : double,
+    p_comment : string
+  }
+]
+TypeDecl PartSuppType [
+  closed RecordType {
+    ps_partkey : int32,
+    ps_suppkey : int32,
+    ps_availqty : int32,
+    ps_supplycost : double,
+    ps_comment : string
+  }
+]
+WriteOutputTo nc1:/tmp/loj-super-key_01.adm
+DatasetDecl LineItems(LineItemType) partitioned by [[l_partkey], [l_linenumber]]
+DatasetDecl PartSupp(PartSuppType) partitioned by [[ps_partkey], [ps_suppkey]]
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [li]
+    :
+    Variable [ Name=li ]
+  )
+  (
+    LiteralExpr [STRING] [partsupp]
+    :
+    Variable [ Name=partsupp ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [LineItems]
+  ]
+  AS
+  Variable [ Name=li ]
+]
+LetVariable [ Name=partsupp ]
+  :=
+  (
+    SELECT ELEMENT [
+    Variable [ Name=ps ]
+    ]
+    FROM [      FunctionCall Metadata.dataset@1[
+        LiteralExpr [STRING] [PartSupp]
+      ]
+      AS
+      Variable [ Name=ps ]
+    ]
+    Where
+      OperatorExpr [
+        OperatorExpr [
+          FieldAccessor [
+            Variable [ Name=li ]
+            Field=l_partkey
+          ]
+          =
+          FieldAccessor [
+            Variable [ Name=ps ]
+            Field=ps_partkey
+          ]
+        ]
+        and
+        OperatorExpr [
+          FieldAccessor [
+            Variable [ Name=li ]
+            Field=l_suppkey
+          ]
+          =
+          FieldAccessor [
+            Variable [ Name=ps ]
+            Field=ps_suppkey
+          ]
+        ]
+        and
+        OperatorExpr [
+          FieldAccessor [
+            Variable [ Name=li ]
+            Field=l_extendedprice
+          ]
+          =
+          FieldAccessor [
+            Variable [ Name=ps ]
+            Field=ps_supplycost
+          ]
+        ]
+      ]
+  )

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/loj-super-key_02.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/loj-super-key_02.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/loj-super-key_02.ast
new file mode 100644
index 0000000..f78a47f
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/loj-super-key_02.ast
@@ -0,0 +1,137 @@
+DataverseUse loj-super-key_02
+TypeDecl SupplierType [
+  closed RecordType {
+    s_suppkey : int32,
+    s_name : string,
+    s_address : string,
+    s_nationkey : int32,
+    s_phone : string,
+    s_acctbal : double,
+    s_comment : string
+  }
+]
+TypeDecl NationType [
+  closed RecordType {
+    n_nationkey : int32,
+    n_name : string,
+    n_regionkey : int32,
+    n_comment : string
+  }
+]
+TypeDecl LineItemType [
+  closed RecordType {
+    l_orderkey : int32,
+    l_partkey : int32,
+    l_suppkey : int32,
+    l_linenumber : int32,
+    l_quantity : double,
+    l_extendedprice : double,
+    l_discount : double,
+    l_tax : double,
+    l_returnflag : string,
+    l_linestatus : string,
+    l_shipdate : string,
+    l_commitdate : string,
+    l_receiptdate : string,
+    l_shipinstruct : string,
+    l_shipmode : string,
+    l_comment : string
+  }
+]
+TypeDecl PartType [
+  closed RecordType {
+    p_partkey : int32,
+    p_name : string,
+    p_mfgr : string,
+    p_brand : string,
+    p_type : string,
+    p_size : int32,
+    p_container : string,
+    p_retailprice : double,
+    p_comment : string
+  }
+]
+TypeDecl PartSuppType [
+  closed RecordType {
+    ps_partkey : int32,
+    ps_suppkey : int32,
+    ps_availqty : int32,
+    ps_supplycost : double,
+    ps_comment : string
+  }
+]
+WriteOutputTo nc1:/tmp/loj-super-key_01.adm
+DatasetDecl LineItems(LineItemType) partitioned by [[l_partkey], [l_linenumber]]
+DatasetDecl PartSupp(PartSuppType) partitioned by [[ps_partkey], [ps_suppkey]]
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [partsupp]
+    :
+    Variable [ Name=ps ]
+  )
+  (
+    LiteralExpr [STRING] [li]
+    :
+    Variable [ Name=items ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [PartSupp]
+  ]
+  AS
+  Variable [ Name=ps ]
+]
+LetVariable [ Name=items ]
+  :=
+  (
+    SELECT ELEMENT [
+    Variable [ Name=li ]
+    ]
+    FROM [      FunctionCall Metadata.dataset@1[
+        LiteralExpr [STRING] [LineItems]
+      ]
+      AS
+      Variable [ Name=li ]
+    ]
+    Where
+      OperatorExpr [
+        OperatorExpr [
+          FieldAccessor [
+            Variable [ Name=li ]
+            Field=l_partkey
+          ]
+          =
+          FieldAccessor [
+            Variable [ Name=ps ]
+            Field=ps_partkey
+          ]
+        ]
+        and
+        OperatorExpr [
+          FieldAccessor [
+            Variable [ Name=li ]
+            Field=l_suppkey
+          ]
+          =
+          FieldAccessor [
+            Variable [ Name=ps ]
+            Field=ps_suppkey
+          ]
+        ]
+        and
+        OperatorExpr [
+          FieldAccessor [
+            Variable [ Name=li ]
+            Field=l_extendedprice
+          ]
+          =
+          FieldAccessor [
+            Variable [ Name=ps ]
+            Field=ps_supplycost
+          ]
+        ]
+      ]
+  )

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nest_aggregate.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nest_aggregate.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nest_aggregate.ast
new file mode 100644
index 0000000..1556199
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nest_aggregate.ast
@@ -0,0 +1,220 @@
+DataverseUse tpch
+TypeDecl OrderType [
+  closed RecordType {
+    o_orderkey : int32,
+    o_custkey : int32,
+    o_orderstatus : string,
+    o_totalprice : double,
+    o_orderdate : string,
+    o_orderpriority : string,
+    o_clerk : string,
+    o_shippriority : int32,
+    o_comment : string
+  }
+]
+TypeDecl CustomerType [
+  closed RecordType {
+    c_custkey : int32,
+    c_name : string,
+    c_address : string,
+    c_nationkey : int32,
+    c_phone : string,
+    c_acctbal : double,
+    c_mktsegment : string,
+    c_comment : string
+  }
+]
+TypeDecl SupplierType [
+  closed RecordType {
+    s_suppkey : int32,
+    s_name : string,
+    s_address : string,
+    s_nationkey : int32,
+    s_phone : string,
+    s_acctbal : double,
+    s_comment : string
+  }
+]
+TypeDecl NationType [
+  closed RecordType {
+    n_nationkey : int32,
+    n_name : string,
+    n_regionkey : int32,
+    n_comment : string
+  }
+]
+TypeDecl RegionType [
+  closed RecordType {
+    r_regionkey : int32,
+    r_name : string,
+    r_comment : string
+  }
+]
+TypeDecl PartType [
+  closed RecordType {
+    p_partkey : int32,
+    p_name : string,
+    p_mfgr : string,
+    p_brand : string,
+    p_type : string,
+    p_size : int32,
+    p_container : string,
+    p_retailprice : double,
+    p_comment : string
+  }
+]
+TypeDecl PartSuppType [
+  closed RecordType {
+    ps_partkey : int32,
+    ps_suppkey : int32,
+    ps_availqty : int32,
+    ps_supplycost : double,
+    ps_comment : string
+  }
+]
+DatasetDecl Orders(OrderType) partitioned by [[o_orderkey]]
+DatasetDecl Supplier(SupplierType) partitioned by [[s_suppkey]]
+DatasetDecl Region(RegionType) partitioned by [[r_regionkey]]
+DatasetDecl Nation(NationType) partitioned by [[n_nationkey]]
+DatasetDecl Part(PartType) partitioned by [[p_partkey]]
+DatasetDecl Partsupp(PartSuppType) partitioned by [[ps_partkey], [ps_suppkey]]
+DatasetDecl Customer(CustomerType) partitioned by [[c_custkey]]
+DatasetDecl SelectedNation(NationType) partitioned by [[n_nationkey]]
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [nation_key]
+    :
+    FieldAccessor [
+      Variable [ Name=nation ]
+      Field=n_nationkey
+    ]
+  )
+  (
+    LiteralExpr [STRING] [name]
+    :
+    FieldAccessor [
+      Variable [ Name=nation ]
+      Field=n_name
+    ]
+  )
+  (
+    LiteralExpr [STRING] [aggregates]
+    :
+    (
+      SELECT ELEMENT [
+      RecordConstructor [
+        (
+          LiteralExpr [STRING] [order_date]
+          :
+          Variable [ Name=orderdate ]
+        )
+        (
+          LiteralExpr [STRING] [sum_price]
+          :
+          Variable [ Name=sum ]
+        )
+      ]
+      ]
+      FROM [        FunctionCall Metadata.dataset@1[
+          LiteralExpr [STRING] [Orders]
+        ]
+        AS
+        Variable [ Name=orders ]
+,
+        FunctionCall Metadata.dataset@1[
+          LiteralExpr [STRING] [Customer]
+        ]
+        AS
+        Variable [ Name=customer ]
+      ]
+      Where
+        OperatorExpr [
+          OperatorExpr [
+            FieldAccessor [
+              Variable [ Name=orders ]
+              Field=o_custkey
+            ]
+            =
+            FieldAccessor [
+              Variable [ Name=customer ]
+              Field=c_custkey
+            ]
+          ]
+          and
+          OperatorExpr [
+            FieldAccessor [
+              Variable [ Name=customer ]
+              Field=c_nationkey
+            ]
+            =
+            FieldAccessor [
+              Variable [ Name=nation ]
+              Field=n_nationkey
+            ]
+          ]
+        ]
+      Groupby
+        Variable [ Name=orderdate ]
+        :=
+        FieldAccessor [
+          Variable [ Name=orders ]
+          Field=o_orderdate
+        ]
+        With
+        Variable [ Name=orders ]
+        Variable [ Name=customer ]
+        Variable [ Name=nation ]
+        Variable [ Name=sn ]
+
+      LetVariable [ Name=sum ]
+        :=
+        FunctionCall tpch.sum@1[
+          (
+            SELECT ELEMENT [
+            FieldAccessor [
+              Variable [ Name=o ]
+              Field=o_totalprice
+            ]
+            ]
+            FROM [              Variable [ Name=orders ]
+              AS
+              Variable [ Name=o ]
+            ]
+          )
+        ]
+      Orderby
+        Variable [ Name=sum ]
+        ASC
+
+      Limit
+        LiteralExpr [LONG] [3]
+    )
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Nation]
+  ]
+  AS
+  Variable [ Name=nation ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [SelectedNation]
+  ]
+  AS
+  Variable [ Name=sn ]
+]
+Where
+  OperatorExpr [
+    FieldAccessor [
+      Variable [ Name=nation ]
+      Field=n_nationkey
+    ]
+    =
+    FieldAccessor [
+      Variable [ Name=sn ]
+      Field=n_nationkey
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/disjunction-to-join.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/disjunction-to-join.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/disjunction-to-join.ast
new file mode 100644
index 0000000..ed8e12c
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/disjunction-to-join.ast
@@ -0,0 +1,50 @@
+DataverseUse test
+TypeDecl NestedTestType [
+  open RecordType {
+    idx : string
+  }
+]
+TypeDecl TestType [
+  open RecordType {
+    id : string,
+    no-idx : string,
+    nested : NestedTestType
+  }
+]
+DatasetDecl TestSet(TestType) partitioned by [[id]]
+Query:
+SELECT ELEMENT [
+Variable [ Name=x ]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [TestSet]
+  ]
+  AS
+  Variable [ Name=x ]
+]
+Where
+  OperatorExpr [
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=x ]
+          Field=nested
+        ]
+        Field=idx
+      ]
+      =
+      LiteralExpr [STRING] [one]
+    ]
+    or
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=x ]
+          Field=nested
+        ]
+        Field=idx
+      ]
+      =
+      LiteralExpr [STRING] [two]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01.ast
new file mode 100644
index 0000000..a80969f
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01.ast
@@ -0,0 +1,154 @@
+DataverseUse test
+TypeDecl TwitterUserType [
+  closed RecordType {
+    screen-name : string,
+    lang : string,
+    friends-count : int32,
+    statuses-count : int32,
+    name : string,
+    followers-count : int32
+  }
+]
+TypeDecl TweetMessageNestedType [
+  closed RecordType {
+    tweetid : int64,
+    user : TwitterUserType,
+    sender-location : point,
+    send-time : datetime,
+    referred-topics : UnorderedList <string>
+,
+    message-text : string,
+    countA : int32,
+    countB : int32
+  }
+]
+TypeDecl TweetMessageType [
+  closed RecordType {
+    nested : TweetMessageNestedType
+  }
+]
+DatasetDecl TweetMessages(TweetMessageType) partitioned by [[nested, tweetid]]
+WriteOutputTo nc1:rttest/btree-index-join_leftouterjoin-probe-pidx-with-join-btree-sidx_01.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [tweetid1]
+    :
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=t1 ]
+        Field=nested
+      ]
+      Field=tweetid
+    ]
+  )
+  (
+    LiteralExpr [STRING] [count1]
+    :
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=t1 ]
+        Field=nested
+      ]
+      Field=countA
+    ]
+  )
+  (
+    LiteralExpr [STRING] [t2info]
+    :
+    (
+      SELECT ELEMENT [
+      RecordConstructor [
+        (
+          LiteralExpr [STRING] [tweetid2]
+          :
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=t2 ]
+              Field=nested
+            ]
+            Field=tweetid
+          ]
+        )
+        (
+          LiteralExpr [STRING] [count2]
+          :
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=t2 ]
+              Field=nested
+            ]
+            Field=countB
+          ]
+        )
+      ]
+      ]
+      FROM [        FunctionCall Metadata.dataset@1[
+          LiteralExpr [STRING] [TweetMessages]
+        ]
+        AS
+        Variable [ Name=t2 ]
+      ]
+      Where
+        OperatorExpr [
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=t1 ]
+              Field=nested
+            ]
+            Field=countA
+          ]
+          =
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=t2 ]
+              Field=nested
+            ]
+            Field=countB
+          ]
+        ]
+      Orderby
+        FieldAccessor [
+          FieldAccessor [
+            Variable [ Name=t2 ]
+            Field=nested
+          ]
+          Field=tweetid
+        ]
+        ASC
+
+    )
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [TweetMessages]
+  ]
+  AS
+  Variable [ Name=t1 ]
+]
+Where
+  OperatorExpr [
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=t1 ]
+        Field=nested
+      ]
+      Field=tweetid
+    ]
+    <
+    FunctionCall test.int64@1[
+      LiteralExpr [STRING] [10]
+    ]
+  ]
+Orderby
+  FieldAccessor [
+    FieldAccessor [
+      Variable [ Name=t1 ]
+      Field=nested
+    ]
+    Field=tweetid
+  ]
+  ASC
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02.ast
new file mode 100644
index 0000000..9cd8ca9
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02.ast
@@ -0,0 +1,174 @@
+DataverseUse test
+TypeDecl TwitterUserType [
+  closed RecordType {
+    screen-name : string,
+    lang : string,
+    friends-count : int32,
+    statuses-count : int32,
+    name : string,
+    followers-count : int32
+  }
+]
+TypeDecl TweetMessageNestedType [
+  closed RecordType {
+    tweetid : int64,
+    user : TwitterUserType,
+    sender-location : point,
+    send-time : datetime,
+    referred-topics : UnorderedList <string>
+,
+    message-text : string,
+    countA : int32,
+    countB : int32
+  }
+]
+TypeDecl TweetMessageType [
+  closed RecordType {
+    nested : TweetMessageNestedType
+  }
+]
+DatasetDecl TweetMessages(TweetMessageType) partitioned by [[nested, tweetid]]
+WriteOutputTo nc1:rttest/btree-index-join_leftouterjoin-probe-pidx-with-join-btree-sidx_02.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [tweetid1]
+    :
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=t1 ]
+        Field=nested
+      ]
+      Field=tweetid
+    ]
+  )
+  (
+    LiteralExpr [STRING] [count1]
+    :
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=t1 ]
+        Field=nested
+      ]
+      Field=countA
+    ]
+  )
+  (
+    LiteralExpr [STRING] [t2info]
+    :
+    (
+      SELECT ELEMENT [
+      RecordConstructor [
+        (
+          LiteralExpr [STRING] [tweetid2]
+          :
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=t2 ]
+              Field=nested
+            ]
+            Field=tweetid
+          ]
+        )
+        (
+          LiteralExpr [STRING] [count2]
+          :
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=t2 ]
+              Field=nested
+            ]
+            Field=countB
+          ]
+        )
+      ]
+      ]
+      FROM [        FunctionCall Metadata.dataset@1[
+          LiteralExpr [STRING] [TweetMessages]
+        ]
+        AS
+        Variable [ Name=t2 ]
+      ]
+      Where
+        OperatorExpr [
+          OperatorExpr [
+            FieldAccessor [
+              FieldAccessor [
+                Variable [ Name=t1 ]
+                Field=nested
+              ]
+              Field=countA
+            ]
+            =
+            FieldAccessor [
+              FieldAccessor [
+                Variable [ Name=t2 ]
+                Field=nested
+              ]
+              Field=countB
+            ]
+          ]
+          and
+          OperatorExpr [
+            FieldAccessor [
+              FieldAccessor [
+                Variable [ Name=t1 ]
+                Field=nested
+              ]
+              Field=tweetid
+            ]
+            !=
+            FieldAccessor [
+              FieldAccessor [
+                Variable [ Name=t2 ]
+                Field=nested
+              ]
+              Field=tweetid
+            ]
+          ]
+        ]
+      Orderby
+        FieldAccessor [
+          FieldAccessor [
+            Variable [ Name=t2 ]
+            Field=nested
+          ]
+          Field=tweetid
+        ]
+        ASC
+
+    )
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [TweetMessages]
+  ]
+  AS
+  Variable [ Name=t1 ]
+]
+Where
+  OperatorExpr [
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=t1 ]
+        Field=nested
+      ]
+      Field=tweetid
+    ]
+    <
+    FunctionCall test.int64@1[
+      LiteralExpr [STRING] [10]
+    ]
+  ]
+Orderby
+  FieldAccessor [
+    FieldAccessor [
+      Variable [ Name=t1 ]
+      Field=nested
+    ]
+    Field=tweetid
+  ]
+  ASC
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-join_01.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-join_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-join_01.ast
new file mode 100644
index 0000000..2ef7739
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-join_01.ast
@@ -0,0 +1,79 @@
+DataverseUse test
+TypeDecl Nametmp [
+  open RecordType {
+    fname : string,
+    lname : string
+  }
+]
+TypeDecl Name [
+  open RecordType {
+    nested : Nametmp
+  }
+]
+DatasetDecl Names(Name) partitioned by [[nested, fname], [nested, lname]]
+WriteOutputTo nc1:rttest/btree-index-join_primary-composite-key-prefix-join_01.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [emp1]
+    :
+    Variable [ Name=emp1 ]
+  )
+  (
+    LiteralExpr [STRING] [emp2]
+    :
+    Variable [ Name=emp2 ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Names]
+  ]
+  AS
+  Variable [ Name=emp1 ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Names]
+  ]
+  AS
+  Variable [ Name=emp2 ]
+]
+Where
+  OperatorExpr [
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp1 ]
+          Field=nested
+        ]
+        Field=fname
+      ]
+      >
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp2 ]
+          Field=nested
+        ]
+        Field=fname
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp1 ]
+          Field=nested
+        ]
+        Field=lname
+      ]
+      >
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp2 ]
+          Field=nested
+        ]
+        Field=lname
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-join_02.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-join_02.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-join_02.ast
new file mode 100644
index 0000000..ca30680
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-join_02.ast
@@ -0,0 +1,79 @@
+DataverseUse test
+TypeDecl Nametmp [
+  open RecordType {
+    fname : string,
+    lname : string
+  }
+]
+TypeDecl Name [
+  open RecordType {
+    nested : Nametmp
+  }
+]
+DatasetDecl Names(Name) partitioned by [[nested, fname], [nested, lname]]
+WriteOutputTo nc1:rttest/btree-index-join_primary-composite-key-prefix-join_02.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [emp1]
+    :
+    Variable [ Name=emp1 ]
+  )
+  (
+    LiteralExpr [STRING] [emp2]
+    :
+    Variable [ Name=emp2 ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Names]
+  ]
+  AS
+  Variable [ Name=emp1 ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Names]
+  ]
+  AS
+  Variable [ Name=emp2 ]
+]
+Where
+  OperatorExpr [
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp1 ]
+          Field=nested
+        ]
+        Field=fname
+      ]
+      <
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp2 ]
+          Field=nested
+        ]
+        Field=fname
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp1 ]
+          Field=nested
+        ]
+        Field=lname
+      ]
+      <
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp2 ]
+          Field=nested
+        ]
+        Field=lname
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-join_03.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-join_03.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-join_03.ast
new file mode 100644
index 0000000..2532b97
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-join_03.ast
@@ -0,0 +1,79 @@
+DataverseUse test
+TypeDecl Nametmp [
+  open RecordType {
+    fname : string,
+    lname : string
+  }
+]
+TypeDecl Name [
+  open RecordType {
+    nested : Nametmp
+  }
+]
+DatasetDecl Names(Name) partitioned by [[nested, fname], [nested, lname]]
+WriteOutputTo nc1:rttest/btree-index-join_primary-composite-key-prefix-join_03.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [emp1]
+    :
+    Variable [ Name=emp1 ]
+  )
+  (
+    LiteralExpr [STRING] [emp2]
+    :
+    Variable [ Name=emp2 ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Names]
+  ]
+  AS
+  Variable [ Name=emp1 ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Names]
+  ]
+  AS
+  Variable [ Name=emp2 ]
+]
+Where
+  OperatorExpr [
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp1 ]
+          Field=nested
+        ]
+        Field=fname
+      ]
+      =
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp2 ]
+          Field=nested
+        ]
+        Field=fname
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp1 ]
+          Field=nested
+        ]
+        Field=lname
+      ]
+      =
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp2 ]
+          Field=nested
+        ]
+        Field=lname
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-prefix-join_01.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-prefix-join_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-prefix-join_01.ast
new file mode 100644
index 0000000..69c2080
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-prefix-join_01.ast
@@ -0,0 +1,79 @@
+DataverseUse test
+TypeDecl Nametmp [
+  open RecordType {
+    fname : string,
+    lname : string
+  }
+]
+TypeDecl Name [
+  open RecordType {
+    nested : Nametmp
+  }
+]
+DatasetDecl Names(Name) partitioned by [[nested, fname], [nested, lname]]
+WriteOutputTo nc1:rttest/btree-index-join_primary-composite-key-prefix-prefix-join_01.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [emp1]
+    :
+    Variable [ Name=emp1 ]
+  )
+  (
+    LiteralExpr [STRING] [emp2]
+    :
+    Variable [ Name=emp2 ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Names]
+  ]
+  AS
+  Variable [ Name=emp1 ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Names]
+  ]
+  AS
+  Variable [ Name=emp2 ]
+]
+Where
+  OperatorExpr [
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp1 ]
+          Field=nested
+        ]
+        Field=fname
+      ]
+      <
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp2 ]
+          Field=nested
+        ]
+        Field=fname
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp1 ]
+          Field=nested
+        ]
+        Field=lname
+      ]
+      >
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp2 ]
+          Field=nested
+        ]
+        Field=lname
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-prefix-join_02.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-prefix-join_02.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-prefix-join_02.ast
new file mode 100644
index 0000000..ad60381
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-prefix-join_02.ast
@@ -0,0 +1,79 @@
+DataverseUse test
+TypeDecl Nametmp [
+  open RecordType {
+    fname : string,
+    lname : string
+  }
+]
+TypeDecl Name [
+  open RecordType {
+    nested : Nametmp
+  }
+]
+DatasetDecl Names(Name) partitioned by [[nested, fname], [nested, lname]]
+WriteOutputTo nc1:rttest/btree-index-join_primary-composite-key-prefix-prefix-join_02.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [emp1]
+    :
+    Variable [ Name=emp1 ]
+  )
+  (
+    LiteralExpr [STRING] [emp2]
+    :
+    Variable [ Name=emp2 ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Names]
+  ]
+  AS
+  Variable [ Name=emp1 ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Names]
+  ]
+  AS
+  Variable [ Name=emp2 ]
+]
+Where
+  OperatorExpr [
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp1 ]
+          Field=nested
+        ]
+        Field=fname
+      ]
+      >
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp2 ]
+          Field=nested
+        ]
+        Field=fname
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp1 ]
+          Field=nested
+        ]
+        Field=lname
+      ]
+      <
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp2 ]
+          Field=nested
+        ]
+        Field=lname
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-prefix-join_03.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-prefix-join_03.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-prefix-join_03.ast
new file mode 100644
index 0000000..eb2a8ea
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-prefix-join_03.ast
@@ -0,0 +1,79 @@
+DataverseUse test
+TypeDecl Nametmp [
+  open RecordType {
+    fname : string,
+    lname : string
+  }
+]
+TypeDecl Name [
+  open RecordType {
+    nested : Nametmp
+  }
+]
+DatasetDecl Names(Name) partitioned by [[nested, fname], [nested, lname]]
+WriteOutputTo nc1:rttest/btree-index-join_primary-composite-key-prefix-prefix-join_03.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [emp1]
+    :
+    Variable [ Name=emp1 ]
+  )
+  (
+    LiteralExpr [STRING] [emp2]
+    :
+    Variable [ Name=emp2 ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Names]
+  ]
+  AS
+  Variable [ Name=emp1 ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Names]
+  ]
+  AS
+  Variable [ Name=emp2 ]
+]
+Where
+  OperatorExpr [
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp1 ]
+          Field=nested
+        ]
+        Field=fname
+      ]
+      >
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp2 ]
+          Field=nested
+        ]
+        Field=fname
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp1 ]
+          Field=nested
+        ]
+        Field=lname
+      ]
+      =
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp2 ]
+          Field=nested
+        ]
+        Field=lname
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-prefix-join_04.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-prefix-join_04.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-prefix-join_04.ast
new file mode 100644
index 0000000..5954689
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-prefix-join_04.ast
@@ -0,0 +1,79 @@
+DataverseUse test
+TypeDecl Nametmp [
+  open RecordType {
+    fname : string,
+    lname : string
+  }
+]
+TypeDecl Name [
+  open RecordType {
+    nested : Nametmp
+  }
+]
+DatasetDecl Names(Name) partitioned by [[nested, fname], [nested, lname]]
+WriteOutputTo nc1:rttest/btree-index-join_primary-composite-key-prefix-prefix-join_04.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [emp1]
+    :
+    Variable [ Name=emp1 ]
+  )
+  (
+    LiteralExpr [STRING] [emp2]
+    :
+    Variable [ Name=emp2 ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Names]
+  ]
+  AS
+  Variable [ Name=emp1 ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Names]
+  ]
+  AS
+  Variable [ Name=emp2 ]
+]
+Where
+  OperatorExpr [
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp1 ]
+          Field=nested
+        ]
+        Field=fname
+      ]
+      <
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp2 ]
+          Field=nested
+        ]
+        Field=fname
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp1 ]
+          Field=nested
+        ]
+        Field=lname
+      ]
+      =
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp2 ]
+          Field=nested
+        ]
+        Field=lname
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-prefix-join_05.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-prefix-join_05.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-prefix-join_05.ast
new file mode 100644
index 0000000..60d0d3f
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-prefix-join_05.ast
@@ -0,0 +1,79 @@
+DataverseUse test
+TypeDecl Nametmp [
+  open RecordType {
+    fname : string,
+    lname : string
+  }
+]
+TypeDecl Name [
+  open RecordType {
+    nested : Nametmp
+  }
+]
+DatasetDecl Names(Name) partitioned by [[nested, fname], [nested, lname]]
+WriteOutputTo nc1:rttest/btree-index-join_primary-composite-key-prefix-prefix-join_05.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [emp1]
+    :
+    Variable [ Name=emp1 ]
+  )
+  (
+    LiteralExpr [STRING] [emp2]
+    :
+    Variable [ Name=emp2 ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Names]
+  ]
+  AS
+  Variable [ Name=emp1 ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Names]
+  ]
+  AS
+  Variable [ Name=emp2 ]
+]
+Where
+  OperatorExpr [
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp1 ]
+          Field=nested
+        ]
+        Field=fname
+      ]
+      =
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp2 ]
+          Field=nested
+        ]
+        Field=fname
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp1 ]
+          Field=nested
+        ]
+        Field=lname
+      ]
+      >
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp2 ]
+          Field=nested
+        ]
+        Field=lname
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-prefix-join_06.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-prefix-join_06.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-prefix-join_06.ast
new file mode 100644
index 0000000..7bb68ee
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-composite-key-prefix-join_06.ast
@@ -0,0 +1,79 @@
+DataverseUse test
+TypeDecl Nametmp [
+  open RecordType {
+    fname : string,
+    lname : string
+  }
+]
+TypeDecl Name [
+  open RecordType {
+    nested : Nametmp
+  }
+]
+DatasetDecl Names(Name) partitioned by [[nested, fname], [nested, lname]]
+WriteOutputTo nc1:rttest/btree-index-join_primary-composite-key-prefix-prefix-join_06.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [emp1]
+    :
+    Variable [ Name=emp1 ]
+  )
+  (
+    LiteralExpr [STRING] [emp2]
+    :
+    Variable [ Name=emp2 ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Names]
+  ]
+  AS
+  Variable [ Name=emp1 ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Names]
+  ]
+  AS
+  Variable [ Name=emp2 ]
+]
+Where
+  OperatorExpr [
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp1 ]
+          Field=nested
+        ]
+        Field=fname
+      ]
+      =
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp2 ]
+          Field=nested
+        ]
+        Field=fname
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp1 ]
+          Field=nested
+        ]
+        Field=lname
+      ]
+      <
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=emp2 ]
+          Field=nested
+        ]
+        Field=lname
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-equi-join-multipred.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-equi-join-multipred.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-equi-join-multipred.ast
new file mode 100644
index 0000000..c18bfa1
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-equi-join-multipred.ast
@@ -0,0 +1,133 @@
+DataverseUse test
+TypeDecl AddressType [
+  closed RecordType {
+    number : int32,
+    street : string,
+    city : string
+  }
+]
+TypeDecl CustomerTypetmp [
+  closed RecordType {
+    cid : int32,
+    name : string,
+    age : int32?,
+    address : AddressType?,
+    lastorder :       open RecordType {
+        oid : int32,
+        total : float
+      }
+
+  }
+]
+TypeDecl OrderTypetmp [
+  closed RecordType {
+    oid : int32,
+    cid : int32,
+    orderstatus : string,
+    orderpriority : string,
+    clerk : string,
+    total : float
+  }
+]
+TypeDecl CustomerType [
+  closed RecordType {
+    nested : CustomerTypetmp
+  }
+]
+TypeDecl OrderType [
+  closed RecordType {
+    nested : OrderTypetmp
+  }
+]
+DatasetDecl Customers(CustomerType) partitioned by [[nested, cid]]
+DatasetDecl Orders(OrderType) partitioned by [[nested, oid]]
+WriteOutputTo nc1:rttest/btree-index-join_primary-equi-join-multipred.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [customer]
+    :
+    FieldAccessor [
+      Variable [ Name=c ]
+      Field=nested
+    ]
+  )
+  (
+    LiteralExpr [STRING] [order]
+    :
+    FieldAccessor [
+      Variable [ Name=o ]
+      Field=nested
+    ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Customers]
+  ]
+  AS
+  Variable [ Name=c ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Orders]
+  ]
+  AS
+  Variable [ Name=o ]
+]
+Where
+  OperatorExpr [
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=c ]
+          Field=nested
+        ]
+        Field=cid
+      ]
+      =
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=o ]
+          Field=nested
+        ]
+        Field=cid
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=c ]
+          Field=nested
+        ]
+        Field=name
+      ]
+      <
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=o ]
+          Field=nested
+        ]
+        Field=orderstatus
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=c ]
+          Field=nested
+        ]
+        Field=age
+      ]
+      <
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=o ]
+          Field=nested
+        ]
+        Field=cid
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-equi-join-neg_01.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-equi-join-neg_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-equi-join-neg_01.ast
new file mode 100644
index 0000000..18e2cca
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-equi-join-neg_01.ast
@@ -0,0 +1,50 @@
+TypeDecl TestTypetmp [
+  open RecordType {
+    key1 : int32,
+    key2 : int32,
+    fname : string,
+    lname : string
+  }
+]
+TypeDecl TestType [
+  open RecordType {
+    nested : TestTypetmp
+  }
+]
+DatasetDecl DsOne(TestType) partitioned by [[nested, key1]]
+DatasetDecl DsTwo(TestType) partitioned by [[nested, key1]]
+WriteOutputTo nc1:rttest/btree-index-join_primary-equi-join-neg_01.adm
+Query:
+SELECT ELEMENT [
+Variable [ Name=x ]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [test1.DsOne]
+  ]
+  AS
+  Variable [ Name=x ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [test1.DsTwo]
+  ]
+  AS
+  Variable [ Name=y ]
+]
+Where
+  OperatorExpr [
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=x ]
+        Field=nested
+      ]
+      Field=key1
+    ]
+    =
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=y ]
+        Field=nested
+      ]
+      Field=key2
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-equi-join_01.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-equi-join_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-equi-join_01.ast
new file mode 100644
index 0000000..0b0dee7
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-equi-join_01.ast
@@ -0,0 +1,50 @@
+TypeDecl TestTypetmp [
+  open RecordType {
+    key1 : int32,
+    key2 : int32,
+    fname : string,
+    lname : string
+  }
+]
+TypeDecl TestType [
+  open RecordType {
+    nested : TestTypetmp
+  }
+]
+DatasetDecl DsOne(TestType) partitioned by [[nested, key1]]
+DatasetDecl DsTwo(TestType) partitioned by [[nested, key1]]
+WriteOutputTo nc1:rttest/btree-index-join_primary-equi-join_01.adm
+Query:
+SELECT ELEMENT [
+Variable [ Name=x ]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [test1.DsOne]
+  ]
+  AS
+  Variable [ Name=x ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [test1.DsTwo]
+  ]
+  AS
+  Variable [ Name=y ]
+]
+Where
+  OperatorExpr [
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=x ]
+        Field=nested
+      ]
+      Field=key1
+    ]
+    =
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=y ]
+        Field=nested
+      ]
+      Field=key2
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-equi-join_02.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-equi-join_02.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-equi-join_02.ast
new file mode 100644
index 0000000..dda0c74
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-equi-join_02.ast
@@ -0,0 +1,50 @@
+TypeDecl TestTypetmp [
+  open RecordType {
+    key1 : int32,
+    key2 : int32,
+    fname : string,
+    lname : string
+  }
+]
+TypeDecl TestType [
+  open RecordType {
+    nested : TestTypetmp
+  }
+]
+DatasetDecl DsOne(TestType) partitioned by [[nested, key1]]
+DatasetDecl DsTwo(TestType) partitioned by [[nested, key1]]
+WriteOutputTo nc1:rttest/btree-index-join_primary-equi-join_02.adm
+Query:
+SELECT ELEMENT [
+Variable [ Name=x ]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [test1.DsOne]
+  ]
+  AS
+  Variable [ Name=x ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [test1.DsTwo]
+  ]
+  AS
+  Variable [ Name=y ]
+]
+Where
+  OperatorExpr [
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=x ]
+        Field=nested
+      ]
+      Field=key2
+    ]
+    =
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=y ]
+        Field=nested
+      ]
+      Field=key1
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-equi-join_03.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-equi-join_03.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-equi-join_03.ast
new file mode 100644
index 0000000..f7fe80e
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-equi-join_03.ast
@@ -0,0 +1,95 @@
+DataverseUse test
+TypeDecl AddressType [
+  closed RecordType {
+    number : int32,
+    street : string,
+    city : string
+  }
+]
+TypeDecl CustomerTypetmp [
+  closed RecordType {
+    cid : int32,
+    name : string,
+    age : int32?,
+    address : AddressType?,
+    lastorder :       open RecordType {
+        oid : int32,
+        total : float
+      }
+
+  }
+]
+TypeDecl OrderTypetmp [
+  closed RecordType {
+    oid : int32,
+    cid : int32,
+    orderstatus : string,
+    orderpriority : string,
+    clerk : string,
+    total : float
+  }
+]
+TypeDecl CustomerType [
+  closed RecordType {
+    nested : CustomerTypetmp
+  }
+]
+TypeDecl OrderType [
+  closed RecordType {
+    nested : OrderTypetmp
+  }
+]
+DatasetDecl Customers(CustomerType) partitioned by [[nested, cid]]
+DatasetDecl Orders(OrderType) partitioned by [[nested, oid]]
+WriteOutputTo nc1:rttest/btree-index-join_primary-equi-join_04.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [customer]
+    :
+    FieldAccessor [
+      Variable [ Name=c ]
+      Field=nested
+    ]
+  )
+  (
+    LiteralExpr [STRING] [order]
+    :
+    FieldAccessor [
+      Variable [ Name=o ]
+      Field=nested
+    ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Customers]
+  ]
+  AS
+  Variable [ Name=c ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Orders]
+  ]
+  AS
+  Variable [ Name=o ]
+]
+Where
+  OperatorExpr [
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=c ]
+        Field=nested
+      ]
+      Field=cid
+    ]
+    =
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=o ]
+        Field=nested
+      ]
+      Field=cid
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-equi-join_04.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-equi-join_04.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-equi-join_04.ast
new file mode 100644
index 0000000..73cd664
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-equi-join_04.ast
@@ -0,0 +1,95 @@
+DataverseUse test
+TypeDecl AddressType [
+  closed RecordType {
+    number : int32,
+    street : string,
+    city : string
+  }
+]
+TypeDecl CustomerTypetmp [
+  closed RecordType {
+    cid : int32,
+    name : string,
+    age : int32?,
+    address : AddressType?,
+    lastorder :       open RecordType {
+        oid : int32,
+        total : float
+      }
+
+  }
+]
+TypeDecl OrderTypetmp [
+  closed RecordType {
+    oid : int32,
+    cid : int32,
+    orderstatus : string,
+    orderpriority : string,
+    clerk : string,
+    total : float
+  }
+]
+TypeDecl CustomerType [
+  closed RecordType {
+    nested : CustomerTypetmp
+  }
+]
+TypeDecl OrderType [
+  closed RecordType {
+    nested : OrderTypetmp
+  }
+]
+DatasetDecl Customers(CustomerType) partitioned by [[nested, cid]]
+DatasetDecl Orders(OrderType) partitioned by [[nested, oid]]
+WriteOutputTo nc1:rttest/btree-index-join_primary-equi-join_05.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [customer]
+    :
+    FieldAccessor [
+      Variable [ Name=c ]
+      Field=nested
+    ]
+  )
+  (
+    LiteralExpr [STRING] [order]
+    :
+    FieldAccessor [
+      Variable [ Name=o ]
+      Field=nested
+    ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Orders]
+  ]
+  AS
+  Variable [ Name=o ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Customers]
+  ]
+  AS
+  Variable [ Name=c ]
+]
+Where
+  OperatorExpr [
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=o ]
+        Field=nested
+      ]
+      Field=cid
+    ]
+    =
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=c ]
+        Field=nested
+      ]
+      Field=cid
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-equi-join_05.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-equi-join_05.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-equi-join_05.ast
new file mode 100644
index 0000000..6938c8c
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/btree-index-join/primary-equi-join_05.ast
@@ -0,0 +1,79 @@
+DataverseUse test
+TypeDecl AddressType [
+  closed RecordType {
+    number : int32,
+    street : string,
+    city : string
+  }
+]
+TypeDecl CustomerTypetmp [
+  closed RecordType {
+    cid : int32,
+    name : string,
+    age : int32?,
+    address : AddressType?,
+    lastorder :       open RecordType {
+        oid : int32,
+        total : float
+      }
+
+  }
+]
+TypeDecl CustomerType [
+  closed RecordType {
+    nested : CustomerTypetmp
+  }
+]
+DatasetDecl Customers(CustomerType) partitioned by [[nested, cid]]
+WriteOutputTo nc1:rttest/btree-index-join_primary-equi-join_06.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [customer1]
+    :
+    FieldAccessor [
+      Variable [ Name=c1 ]
+      Field=nested
+    ]
+  )
+  (
+    LiteralExpr [STRING] [customer2]
+    :
+    FieldAccessor [
+      Variable [ Name=c2 ]
+      Field=nested
+    ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Customers]
+  ]
+  AS
+  Variable [ Name=c1 ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Customers]
+  ]
+  AS
+  Variable [ Name=c2 ]
+]
+Where
+  OperatorExpr [
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=c1 ]
+        Field=nested
+      ]
+      Field=cid
+    ]
+    =
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=c2 ]
+        Field=nested
+      ]
+      Field=cid
+    ]
+  ]



Mime
View raw message