You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by bu...@apache.org on 2015/10/31 00:16:18 UTC

[10/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-

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_03.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_03.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_03.ast
new file mode 100644
index 0000000..5c27747
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_03.ast
@@ -0,0 +1,117 @@
+DataverseUse test
+Set import-private-functions=true
+TypeDecl DBLPTypetmp [
+  open RecordType {
+    id : int32,
+    dblpid : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl DBLPType [
+  closed RecordType {
+    nested : DBLPTypetmp
+  }
+]
+DatasetDecl DBLP(DBLPType) partitioned by [[nested, id]]
+WriteOutputTo nc1:rttest/inverted-index-join_ngram-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] [DBLP]
+  ]
+  AS
+  Variable [ Name=b ]
+]
+Where
+  OperatorExpr [
+    IndexAccessor [
+      FunctionCall test.similarity-jaccard-check@3[
+        FunctionCall test.gram-tokens@3[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=a ]
+              Field=nested
+            ]
+            Field=title
+          ]
+          LiteralExpr [LONG] [3]
+          LiteralExpr [FALSE]
+        ]
+        FunctionCall test.gram-tokens@3[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=b ]
+              Field=nested
+            ]
+            Field=title
+          ]
+          LiteralExpr [LONG] [3]
+          LiteralExpr [FALSE]
+        ]
+        LiteralExpr [FLOAT] [0.5]
+      ]
+      Index:       FunctionCall test.similarity-jaccard-check@3[
+        FunctionCall test.gram-tokens@3[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=a ]
+              Field=nested
+            ]
+            Field=title
+          ]
+          LiteralExpr [LONG] [3]
+          LiteralExpr [FALSE]
+        ]
+        FunctionCall test.gram-tokens@3[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=b ]
+              Field=nested
+            ]
+            Field=title
+          ]
+          LiteralExpr [LONG] [3]
+          LiteralExpr [FALSE]
+        ]
+        LiteralExpr [FLOAT] [0.5]
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=a ]
+          Field=nested
+        ]
+        Field=id
+      ]
+      <
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=b ]
+          Field=nested
+        ]
+        Field=id
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_04.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_04.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_04.ast
new file mode 100644
index 0000000..0aaba9d
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_04.ast
@@ -0,0 +1,131 @@
+DataverseUse test
+Set import-private-functions=true
+TypeDecl DBLPTypetmp [
+  open RecordType {
+    id : int32,
+    dblpid : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl CSXTypetmp [
+  open RecordType {
+    id : int32,
+    csxid : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl DBLPType [
+  closed RecordType {
+    nested : DBLPTypetmp
+  }
+]
+TypeDecl CSXType [
+  closed RecordType {
+    nested : CSXTypetmp
+  }
+]
+DatasetDecl DBLP(DBLPType) partitioned by [[nested, id]]
+DatasetDecl CSX(CSXType) partitioned by [[nested, id]]
+WriteOutputTo nc1:rttest/inverted-index-join_ngram-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.gram-tokens@3[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=a ]
+              Field=nested
+            ]
+            Field=title
+          ]
+          LiteralExpr [LONG] [3]
+          LiteralExpr [FALSE]
+        ]
+        FunctionCall test.gram-tokens@3[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=b ]
+              Field=nested
+            ]
+            Field=title
+          ]
+          LiteralExpr [LONG] [3]
+          LiteralExpr [FALSE]
+        ]
+        LiteralExpr [FLOAT] [0.5]
+      ]
+      Index:       FunctionCall test.similarity-jaccard-check@3[
+        FunctionCall test.gram-tokens@3[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=a ]
+              Field=nested
+            ]
+            Field=title
+          ]
+          LiteralExpr [LONG] [3]
+          LiteralExpr [FALSE]
+        ]
+        FunctionCall test.gram-tokens@3[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=b ]
+              Field=nested
+            ]
+            Field=title
+          ]
+          LiteralExpr [LONG] [3]
+          LiteralExpr [FALSE]
+        ]
+        LiteralExpr [FLOAT] [0.5]
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=a ]
+          Field=nested
+        ]
+        Field=id
+      ]
+      <
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=b ]
+          Field=nested
+        ]
+        Field=id
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-inline.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-inline.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-inline.ast
new file mode 100644
index 0000000..af6a5c8
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-inline.ast
@@ -0,0 +1,113 @@
+DataverseUse test
+Set import-private-functions=true
+TypeDecl DBLPTypetmp [
+  open RecordType {
+    id : int32,
+    dblpid : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl DBLPType [
+  closed RecordType {
+    nested : DBLPTypetmp
+  }
+]
+DatasetDecl DBLP(DBLPType) partitioned by [[nested, id]]
+WriteOutputTo nc1:rttest/inverted-index-join-noeqjoin_ngram-jaccard-inline.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [atitle]
+    :
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=a ]
+        Field=nested
+      ]
+      Field=title
+    ]
+  )
+  (
+    LiteralExpr [STRING] [btitle]
+    :
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=b ]
+        Field=nested
+      ]
+      Field=title
+    ]
+  )
+  (
+    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.gram-tokens@3[
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=a ]
+          Field=nested
+        ]
+        Field=title
+      ]
+      LiteralExpr [LONG] [3]
+      LiteralExpr [FALSE]
+    ]
+    FunctionCall test.gram-tokens@3[
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=b ]
+          Field=nested
+        ]
+        Field=title
+      ]
+      LiteralExpr [LONG] [3]
+      LiteralExpr [FALSE]
+    ]
+  ]
+Where
+  OperatorExpr [
+    OperatorExpr [
+      Variable [ Name=jacc ]
+      >=
+      LiteralExpr [FLOAT] [0.5]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=a ]
+          Field=nested
+        ]
+        Field=id
+      ]
+      <
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=b ]
+          Field=nested
+        ]
+        Field=id
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_01.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_01.ast
new file mode 100644
index 0000000..591fe75
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_01.ast
@@ -0,0 +1,108 @@
+DataverseUse test
+Set import-private-functions=true
+TypeDecl DBLPTypetmp [
+  open RecordType {
+    id : int32,
+    dblpid : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl CSXTypetmp [
+  closed RecordType {
+    id : int32,
+    csxid : string,
+    title : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl DBLPType [
+  closed RecordType {
+    nested : DBLPTypetmp
+  }
+]
+TypeDecl CSXType [
+  closed RecordType {
+    nested : CSXTypetmp
+  }
+]
+DatasetDecl DBLP(DBLPType) partitioned by [[nested, id]]
+DatasetDecl CSX(CSXType) partitioned by [[nested, id]]
+WriteOutputTo nc1:rttest/inverted-index-join_ngram-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.gram-tokens@3[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=a ]
+              Field=nested
+            ]
+            Field=title
+          ]
+          LiteralExpr [LONG] [3]
+          LiteralExpr [FALSE]
+        ]
+        FunctionCall test.gram-tokens@3[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=b ]
+              Field=nested
+            ]
+            Field=title
+          ]
+          LiteralExpr [LONG] [3]
+          LiteralExpr [FALSE]
+        ]
+      ]
+      >=
+      LiteralExpr [FLOAT] [0.5]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=a ]
+          Field=nested
+        ]
+        Field=id
+      ]
+      <
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=b ]
+          Field=nested
+        ]
+        Field=id
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_02.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_02.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_02.ast
new file mode 100644
index 0000000..3ed252f
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_02.ast
@@ -0,0 +1,108 @@
+DataverseUse test
+Set import-private-functions=true
+TypeDecl DBLPTypetmp [
+  closed RecordType {
+    id : int32,
+    dblpid : string,
+    title : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl CSXTypetmp [
+  open RecordType {
+    id : int32,
+    csxid : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl DBLPType [
+  closed RecordType {
+    nested : DBLPTypetmp
+  }
+]
+TypeDecl CSXType [
+  closed RecordType {
+    nested : CSXTypetmp
+  }
+]
+DatasetDecl DBLP(DBLPType) partitioned by [[nested, id]]
+DatasetDecl CSX(CSXType) partitioned by [[nested, id]]
+WriteOutputTo nc1:rttest/inverted-index-join_ngram-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] [CSX]
+  ]
+  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.gram-tokens@3[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=a ]
+              Field=nested
+            ]
+            Field=title
+          ]
+          LiteralExpr [LONG] [3]
+          LiteralExpr [FALSE]
+        ]
+        FunctionCall test.gram-tokens@3[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=b ]
+              Field=nested
+            ]
+            Field=title
+          ]
+          LiteralExpr [LONG] [3]
+          LiteralExpr [FALSE]
+        ]
+      ]
+      >=
+      LiteralExpr [FLOAT] [0.5]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=a ]
+          Field=nested
+        ]
+        Field=id
+      ]
+      <
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=b ]
+          Field=nested
+        ]
+        Field=id
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_03.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_03.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_03.ast
new file mode 100644
index 0000000..78220a7
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_03.ast
@@ -0,0 +1,93 @@
+DataverseUse test
+Set import-private-functions=true
+TypeDecl DBLPTypetmp [
+  open RecordType {
+    id : int32,
+    dblpid : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl DBLPType [
+  closed RecordType {
+    nested : DBLPTypetmp
+  }
+]
+DatasetDecl DBLP(DBLPType) partitioned by [[nested, id]]
+WriteOutputTo nc1:rttest/inverted-index-join_ngram-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] [DBLP]
+  ]
+  AS
+  Variable [ Name=b ]
+]
+Where
+  OperatorExpr [
+    OperatorExpr [
+      FunctionCall test.similarity-jaccard@2[
+        FunctionCall test.gram-tokens@3[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=a ]
+              Field=nested
+            ]
+            Field=title
+          ]
+          LiteralExpr [LONG] [3]
+          LiteralExpr [FALSE]
+        ]
+        FunctionCall test.gram-tokens@3[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=b ]
+              Field=nested
+            ]
+            Field=title
+          ]
+          LiteralExpr [LONG] [3]
+          LiteralExpr [FALSE]
+        ]
+      ]
+      >=
+      LiteralExpr [FLOAT] [0.5]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=a ]
+          Field=nested
+        ]
+        Field=id
+      ]
+      <
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=b ]
+          Field=nested
+        ]
+        Field=id
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_04.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_04.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_04.ast
new file mode 100644
index 0000000..7362c07
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_04.ast
@@ -0,0 +1,107 @@
+DataverseUse test
+Set import-private-functions=true
+TypeDecl DBLPTypetmp [
+  open RecordType {
+    id : int32,
+    dblpid : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl CSXTypetmp [
+  open RecordType {
+    id : int32,
+    csxid : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl DBLPType [
+  closed RecordType {
+    nested : DBLPTypetmp
+  }
+]
+TypeDecl CSXType [
+  closed RecordType {
+    nested : CSXTypetmp
+  }
+]
+DatasetDecl DBLP(DBLPType) partitioned by [[nested, id]]
+DatasetDecl CSX(CSXType) partitioned by [[nested, id]]
+WriteOutputTo nc1:rttest/inverted-index-join_ngram-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.gram-tokens@3[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=a ]
+              Field=nested
+            ]
+            Field=title
+          ]
+          LiteralExpr [LONG] [3]
+          LiteralExpr [FALSE]
+        ]
+        FunctionCall test.gram-tokens@3[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=b ]
+              Field=nested
+            ]
+            Field=title
+          ]
+          LiteralExpr [LONG] [3]
+          LiteralExpr [FALSE]
+        ]
+      ]
+      >=
+      LiteralExpr [FLOAT] [0.5]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=a ]
+          Field=nested
+        ]
+        Field=id
+      ]
+      <
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=b ]
+          Field=nested
+        ]
+        Field=id
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_01.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_01.ast
new file mode 100644
index 0000000..52b61c3
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_01.ast
@@ -0,0 +1,102 @@
+DataverseUse test
+TypeDecl DBLPTypetmp [
+  open RecordType {
+    id : int32,
+    dblpid : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl CSXTypetmp [
+  closed RecordType {
+    id : int32,
+    csxid : string,
+    title : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl DBLPType [
+  closed RecordType {
+    nested : DBLPTypetmp
+  }
+]
+TypeDecl CSXType [
+  closed RecordType {
+    nested : CSXTypetmp
+  }
+]
+DatasetDecl DBLP(DBLPType) partitioned by [[nested, id]]
+DatasetDecl CSX(CSXType) partitioned by [[nested, id]]
+WriteOutputTo nc1:rttest/inverted-index-join_word-fuzzyeq-jaccard_01.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] [CSX]
+  ]
+  AS
+  Variable [ Name=b ]
+]
+Where
+  OperatorExpr [
+    OperatorExpr [
+      FunctionCall test.word-tokens@1[
+        FieldAccessor [
+          FieldAccessor [
+            Variable [ Name=a ]
+            Field=nested
+          ]
+          Field=title
+        ]
+      ]
+      ~=
+      FunctionCall test.word-tokens@1[
+        FieldAccessor [
+          FieldAccessor [
+            Variable [ Name=b ]
+            Field=nested
+          ]
+          Field=title
+        ]
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=a ]
+          Field=nested
+        ]
+        Field=id
+      ]
+      <
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=b ]
+          Field=nested
+        ]
+        Field=id
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_02.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_02.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_02.ast
new file mode 100644
index 0000000..3d5b7f1
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_02.ast
@@ -0,0 +1,102 @@
+DataverseUse test
+TypeDecl DBLPTypetmp [
+  closed RecordType {
+    id : int32,
+    dblpid : string,
+    title : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl CSXTypetmp [
+  open RecordType {
+    id : int32,
+    csxid : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl DBLPType [
+  closed RecordType {
+    nested : DBLPTypetmp
+  }
+]
+TypeDecl CSXType [
+  closed RecordType {
+    nested : CSXTypetmp
+  }
+]
+DatasetDecl DBLP(DBLPType) partitioned by [[nested, id]]
+DatasetDecl CSX(CSXType) partitioned by [[nested, id]]
+WriteOutputTo nc1:rttest/inverted-index-join_word-fuzzyeq-jaccard_01.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] [CSX]
+  ]
+  AS
+  Variable [ Name=a ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [DBLP]
+  ]
+  AS
+  Variable [ Name=b ]
+]
+Where
+  OperatorExpr [
+    OperatorExpr [
+      FunctionCall test.word-tokens@1[
+        FieldAccessor [
+          FieldAccessor [
+            Variable [ Name=a ]
+            Field=nested
+          ]
+          Field=title
+        ]
+      ]
+      ~=
+      FunctionCall test.word-tokens@1[
+        FieldAccessor [
+          FieldAccessor [
+            Variable [ Name=b ]
+            Field=nested
+          ]
+          Field=title
+        ]
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=a ]
+          Field=nested
+        ]
+        Field=id
+      ]
+      <
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=b ]
+          Field=nested
+        ]
+        Field=id
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_03.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_03.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_03.ast
new file mode 100644
index 0000000..687c075
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_03.ast
@@ -0,0 +1,87 @@
+DataverseUse test
+TypeDecl DBLPTypetmp [
+  open RecordType {
+    id : int32,
+    dblpid : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl DBLPType [
+  closed RecordType {
+    nested : DBLPTypetmp
+  }
+]
+DatasetDecl DBLP(DBLPType) partitioned by [[nested, id]]
+WriteOutputTo nc1:rttest/inverted-index-join_word-fuzzyeq-jaccard_01.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 [
+          FieldAccessor [
+            Variable [ Name=a ]
+            Field=nested
+          ]
+          Field=title
+        ]
+      ]
+      ~=
+      FunctionCall test.word-tokens@1[
+        FieldAccessor [
+          FieldAccessor [
+            Variable [ Name=b ]
+            Field=nested
+          ]
+          Field=title
+        ]
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=a ]
+          Field=nested
+        ]
+        Field=id
+      ]
+      <
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=b ]
+          Field=nested
+        ]
+        Field=id
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_04.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_04.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_04.ast
new file mode 100644
index 0000000..9a289ee
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_04.ast
@@ -0,0 +1,101 @@
+DataverseUse test
+TypeDecl DBLPTypetmp [
+  open RecordType {
+    id : int32,
+    dblpid : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl CSXTypetmp [
+  open RecordType {
+    id : int32,
+    csxid : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl DBLPType [
+  closed RecordType {
+    nested : DBLPTypetmp
+  }
+]
+TypeDecl CSXType [
+  closed RecordType {
+    nested : CSXTypetmp
+  }
+]
+DatasetDecl DBLP(DBLPType) partitioned by [[nested, id]]
+DatasetDecl CSX(CSXType) partitioned by [[nested, id]]
+WriteOutputTo nc1:rttest/inverted-index-join_word-fuzzyeq-jaccard_01.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] [CSX]
+  ]
+  AS
+  Variable [ Name=b ]
+]
+Where
+  OperatorExpr [
+    OperatorExpr [
+      FunctionCall test.word-tokens@1[
+        FieldAccessor [
+          FieldAccessor [
+            Variable [ Name=a ]
+            Field=nested
+          ]
+          Field=title
+        ]
+      ]
+      ~=
+      FunctionCall test.word-tokens@1[
+        FieldAccessor [
+          FieldAccessor [
+            Variable [ Name=b ]
+            Field=nested
+          ]
+          Field=title
+        ]
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=a ]
+          Field=nested
+        ]
+        Field=id
+      ]
+      <
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=b ]
+          Field=nested
+        ]
+        Field=id
+      ]
+    ]
+  ]

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

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_01.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_01.ast
new file mode 100644
index 0000000..b87f210
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_01.ast
@@ -0,0 +1,123 @@
+DataverseUse test
+TypeDecl DBLPTypetmp [
+  open RecordType {
+    id : int32,
+    dblpid : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl CSXTypetmp [
+  closed RecordType {
+    id : int32,
+    csxid : string,
+    title : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl DBLPType [
+  closed RecordType {
+    nested : DBLPTypetmp
+  }
+]
+TypeDecl CSXType [
+  closed RecordType {
+    nested : CSXTypetmp
+  }
+]
+DatasetDecl DBLP(DBLPType) partitioned by [[nested, id]]
+DatasetDecl CSX(CSXType) partitioned by [[nested, 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 [
+            FieldAccessor [
+              Variable [ Name=a ]
+              Field=nested
+            ]
+            Field=title
+          ]
+        ]
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=b ]
+              Field=nested
+            ]
+            Field=title
+          ]
+        ]
+        LiteralExpr [FLOAT] [0.5]
+      ]
+      Index:       FunctionCall test.similarity-jaccard-check@3[
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=a ]
+              Field=nested
+            ]
+            Field=title
+          ]
+        ]
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=b ]
+              Field=nested
+            ]
+            Field=title
+          ]
+        ]
+        LiteralExpr [FLOAT] [0.5]
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=a ]
+          Field=nested
+        ]
+        Field=id
+      ]
+      <
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=b ]
+          Field=nested
+        ]
+        Field=id
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_02.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_02.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_02.ast
new file mode 100644
index 0000000..0941add
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_02.ast
@@ -0,0 +1,123 @@
+DataverseUse test
+TypeDecl DBLPTypetmp [
+  closed RecordType {
+    id : int32,
+    dblpid : string,
+    title : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl CSXTypetmp [
+  open RecordType {
+    id : int32,
+    csxid : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl DBLPType [
+  closed RecordType {
+    nested : DBLPTypetmp
+  }
+]
+TypeDecl CSXType [
+  closed RecordType {
+    nested : CSXTypetmp
+  }
+]
+DatasetDecl DBLP(DBLPType) partitioned by [[nested, id]]
+DatasetDecl CSX(CSXType) partitioned by [[nested, 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] [CSX]
+  ]
+  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 [
+            FieldAccessor [
+              Variable [ Name=a ]
+              Field=nested
+            ]
+            Field=title
+          ]
+        ]
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=b ]
+              Field=nested
+            ]
+            Field=title
+          ]
+        ]
+        LiteralExpr [FLOAT] [0.5]
+      ]
+      Index:       FunctionCall test.similarity-jaccard-check@3[
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=a ]
+              Field=nested
+            ]
+            Field=title
+          ]
+        ]
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=b ]
+              Field=nested
+            ]
+            Field=title
+          ]
+        ]
+        LiteralExpr [FLOAT] [0.5]
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=a ]
+          Field=nested
+        ]
+        Field=id
+      ]
+      <
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=b ]
+          Field=nested
+        ]
+        Field=id
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_03.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_03.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_03.ast
new file mode 100644
index 0000000..eee4066
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_03.ast
@@ -0,0 +1,108 @@
+DataverseUse test
+TypeDecl DBLPTypetmp [
+  open RecordType {
+    id : int32,
+    dblpid : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl DBLPType [
+  closed RecordType {
+    nested : DBLPTypetmp
+  }
+]
+DatasetDecl DBLP(DBLPType) partitioned by [[nested, 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] [DBLP]
+  ]
+  AS
+  Variable [ Name=b ]
+]
+Where
+  OperatorExpr [
+    IndexAccessor [
+      FunctionCall test.similarity-jaccard-check@3[
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=a ]
+              Field=nested
+            ]
+            Field=title
+          ]
+        ]
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=b ]
+              Field=nested
+            ]
+            Field=title
+          ]
+        ]
+        LiteralExpr [FLOAT] [0.5]
+      ]
+      Index:       FunctionCall test.similarity-jaccard-check@3[
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=a ]
+              Field=nested
+            ]
+            Field=title
+          ]
+        ]
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=b ]
+              Field=nested
+            ]
+            Field=title
+          ]
+        ]
+        LiteralExpr [FLOAT] [0.5]
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=a ]
+          Field=nested
+        ]
+        Field=id
+      ]
+      <
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=b ]
+          Field=nested
+        ]
+        Field=id
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_04.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_04.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_04.ast
new file mode 100644
index 0000000..10e9f85
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_04.ast
@@ -0,0 +1,122 @@
+DataverseUse test
+TypeDecl DBLPTypetmp [
+  open RecordType {
+    id : int32,
+    dblpid : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl CSXTypetmp [
+  open RecordType {
+    id : int32,
+    dblpid : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl DBLPType [
+  closed RecordType {
+    nested : DBLPTypetmp
+  }
+]
+TypeDecl CSXType [
+  closed RecordType {
+    nested : CSXTypetmp
+  }
+]
+DatasetDecl DBLP(DBLPType) partitioned by [[nested, id]]
+DatasetDecl CSX(CSXType) partitioned by [[nested, 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 [
+            FieldAccessor [
+              Variable [ Name=a ]
+              Field=nested
+            ]
+            Field=title
+          ]
+        ]
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=b ]
+              Field=nested
+            ]
+            Field=title
+          ]
+        ]
+        LiteralExpr [FLOAT] [0.5]
+      ]
+      Index:       FunctionCall test.similarity-jaccard-check@3[
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=a ]
+              Field=nested
+            ]
+            Field=title
+          ]
+        ]
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=b ]
+              Field=nested
+            ]
+            Field=title
+          ]
+        ]
+        LiteralExpr [FLOAT] [0.5]
+      ]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=a ]
+          Field=nested
+        ]
+        Field=id
+      ]
+      <
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=b ]
+          Field=nested
+        ]
+        Field=id
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-inline.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-inline.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-inline.ast
new file mode 100644
index 0000000..67cbef2
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-inline.ast
@@ -0,0 +1,108 @@
+DataverseUse test
+TypeDecl DBLPTypetmp [
+  open RecordType {
+    id : int32,
+    dblpid : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl DBLPType [
+  closed RecordType {
+    nested : DBLPTypetmp
+  }
+]
+DatasetDecl DBLP(DBLPType) partitioned by [[nested, id]]
+WriteOutputTo nc1:rttest/inverted-index-join-noeqjoin_word-jaccard-inline.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [atitle]
+    :
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=a ]
+        Field=nested
+      ]
+      Field=title
+    ]
+  )
+  (
+    LiteralExpr [STRING] [btitle]
+    :
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=b ]
+        Field=nested
+      ]
+      Field=title
+    ]
+  )
+  (
+    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 [
+        FieldAccessor [
+          Variable [ Name=a ]
+          Field=nested
+        ]
+        Field=title
+      ]
+    ]
+    FunctionCall test.word-tokens@1[
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=b ]
+          Field=nested
+        ]
+        Field=title
+      ]
+    ]
+  ]
+Where
+  OperatorExpr [
+    OperatorExpr [
+      Variable [ Name=jacc ]
+      >=
+      LiteralExpr [FLOAT] [0.5]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=a ]
+          Field=nested
+        ]
+        Field=id
+      ]
+      <
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=b ]
+          Field=nested
+        ]
+        Field=id
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard_01.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard_01.ast
new file mode 100644
index 0000000..e4bcddd
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard_01.ast
@@ -0,0 +1,103 @@
+DataverseUse test
+TypeDecl DBLPTypetmp [
+  open RecordType {
+    id : int32,
+    dblpid : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl CSXTypetmp [
+  closed RecordType {
+    id : int32,
+    csxid : string,
+    title : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl DBLPType [
+  closed RecordType {
+    nested : DBLPTypetmp
+  }
+]
+TypeDecl CSXType [
+  closed RecordType {
+    nested : CSXTypetmp
+  }
+]
+DatasetDecl DBLP(DBLPType) partitioned by [[nested, id]]
+DatasetDecl CSX(CSXType) partitioned by [[nested, 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 [
+            FieldAccessor [
+              Variable [ Name=a ]
+              Field=nested
+            ]
+            Field=title
+          ]
+        ]
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=b ]
+              Field=nested
+            ]
+            Field=title
+          ]
+        ]
+      ]
+      >=
+      LiteralExpr [FLOAT] [0.5]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=a ]
+          Field=nested
+        ]
+        Field=id
+      ]
+      <
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=b ]
+          Field=nested
+        ]
+        Field=id
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard_02.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard_02.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard_02.ast
new file mode 100644
index 0000000..e3fd23c
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard_02.ast
@@ -0,0 +1,103 @@
+DataverseUse test
+TypeDecl DBLPTypetmp [
+  closed RecordType {
+    id : int32,
+    dblpid : string,
+    title : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl CSXTypetmp [
+  open RecordType {
+    id : int32,
+    csxid : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl DBLPType [
+  closed RecordType {
+    nested : DBLPTypetmp
+  }
+]
+TypeDecl CSXType [
+  closed RecordType {
+    nested : CSXTypetmp
+  }
+]
+DatasetDecl DBLP(DBLPType) partitioned by [[nested, id]]
+DatasetDecl CSX(CSXType) partitioned by [[nested, 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] [CSX]
+  ]
+  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 [
+            FieldAccessor [
+              Variable [ Name=a ]
+              Field=nested
+            ]
+            Field=title
+          ]
+        ]
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=b ]
+              Field=nested
+            ]
+            Field=title
+          ]
+        ]
+      ]
+      >=
+      LiteralExpr [FLOAT] [0.5]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=a ]
+          Field=nested
+        ]
+        Field=id
+      ]
+      <
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=b ]
+          Field=nested
+        ]
+        Field=id
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard_03.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard_03.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard_03.ast
new file mode 100644
index 0000000..1093868
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard_03.ast
@@ -0,0 +1,88 @@
+DataverseUse test
+TypeDecl DBLPTypetmp [
+  open RecordType {
+    id : int32,
+    dblpid : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl DBLPType [
+  closed RecordType {
+    nested : DBLPTypetmp
+  }
+]
+DatasetDecl DBLP(DBLPType) partitioned by [[nested, 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] [DBLP]
+  ]
+  AS
+  Variable [ Name=b ]
+]
+Where
+  OperatorExpr [
+    OperatorExpr [
+      FunctionCall test.similarity-jaccard@2[
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=a ]
+              Field=nested
+            ]
+            Field=title
+          ]
+        ]
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=b ]
+              Field=nested
+            ]
+            Field=title
+          ]
+        ]
+      ]
+      >=
+      LiteralExpr [FLOAT] [0.5]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=a ]
+          Field=nested
+        ]
+        Field=id
+      ]
+      <
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=b ]
+          Field=nested
+        ]
+        Field=id
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard_04.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard_04.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard_04.ast
new file mode 100644
index 0000000..c5ffde4
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard_04.ast
@@ -0,0 +1,102 @@
+DataverseUse test
+TypeDecl DBLPTypetmp [
+  open RecordType {
+    id : int32,
+    dblpid : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl CSXTypetmp [
+  open RecordType {
+    id : int32,
+    csxid : string,
+    authors : string,
+    misc : string
+  }
+]
+TypeDecl DBLPType [
+  closed RecordType {
+    nested : DBLPTypetmp
+  }
+]
+TypeDecl CSXType [
+  closed RecordType {
+    nested : CSXTypetmp
+  }
+]
+DatasetDecl DBLP(DBLPType) partitioned by [[nested, id]]
+DatasetDecl CSX(CSXType) partitioned by [[nested, 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 [
+            FieldAccessor [
+              Variable [ Name=a ]
+              Field=nested
+            ]
+            Field=title
+          ]
+        ]
+        FunctionCall test.word-tokens@1[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=b ]
+              Field=nested
+            ]
+            Field=title
+          ]
+        ]
+      ]
+      >=
+      LiteralExpr [FLOAT] [0.5]
+    ]
+    and
+    OperatorExpr [
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=a ]
+          Field=nested
+        ]
+        Field=id
+      ]
+      <
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=b ]
+          Field=nested
+        ]
+        Field=id
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_01.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_01.ast
new file mode 100644
index 0000000..dfb4308
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_01.ast
@@ -0,0 +1,155 @@
+DataverseUse test
+TypeDecl TwitterUserType [
+  closed RecordType {
+    screen-name : string,
+    lang : string,
+    friends-count : int32,
+    statuses-count : int32,
+    name : string,
+    followers-count : int32
+  }
+]
+TypeDecl TweetMessageNestedType [
+  open RecordType {
+    tweetid : int64,
+    user : TwitterUserType,
+    send-time : datetime,
+    referred-topics : UnorderedList <string>
+,
+    message-text : string,
+    countA : int32,
+    countB : int32
+  }
+]
+TypeDecl TweetMessageType [
+  open RecordType {
+    nested : TweetMessageNestedType
+  }
+]
+DatasetDecl TweetMessages(TweetMessageType) partitioned by [[nested, tweetid]]
+WriteOutputTo nc1:rttest/rtree-index-join_leftouterjoin-probe-pidx-with-join-rtree-sidx_01.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [tweetid1]
+    :
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=t1 ]
+        Field=nested
+      ]
+      Field=tweetid
+    ]
+  )
+  (
+    LiteralExpr [STRING] [loc1]
+    :
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=t1 ]
+        Field=nested
+      ]
+      Field=sender-location
+    ]
+  )
+  (
+    LiteralExpr [STRING] [nearby-message]
+    :
+    (
+      SELECT ELEMENT [
+      RecordConstructor [
+        (
+          LiteralExpr [STRING] [tweetid2]
+          :
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=t2 ]
+              Field=nested
+            ]
+            Field=tweetid
+          ]
+        )
+        (
+          LiteralExpr [STRING] [loc2]
+          :
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=t2 ]
+              Field=nested
+            ]
+            Field=sender-location
+          ]
+        )
+      ]
+      ]
+      FROM [        FunctionCall Metadata.dataset@1[
+          LiteralExpr [STRING] [TweetMessages]
+        ]
+        AS
+        Variable [ Name=t2 ]
+      ]
+      Where
+        FunctionCall test.spatial-intersect@2[
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=t2 ]
+              Field=nested
+            ]
+            Field=sender-location
+          ]
+          Variable [ Name=n ]
+        ]
+      Orderby
+        FieldAccessor [
+          Variable [ Name=t2 ]
+          Field=tweetid
+        ]
+        ASC
+
+    )
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [TweetMessages]
+  ]
+  AS
+  Variable [ Name=t1 ]
+]
+LetVariable [ Name=n ]
+  :=
+  FunctionCall test.create-circle@2[
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=t1 ]
+        Field=nested
+      ]
+      Field=sender-location
+    ]
+    LiteralExpr [DOUBLE] [0.5]
+  ]
+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-open-index/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_02.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_02.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_02.ast
new file mode 100644
index 0000000..0b80a04
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_02.ast
@@ -0,0 +1,178 @@
+DataverseUse test
+TypeDecl TwitterUserType [
+  closed RecordType {
+    screen-name : string,
+    lang : string,
+    friends-count : int32,
+    statuses-count : int32,
+    name : string,
+    followers-count : int32
+  }
+]
+TypeDecl TweetMessageNestedType [
+  open RecordType {
+    tweetid : int64,
+    user : TwitterUserType,
+    send-time : datetime,
+    referred-topics : UnorderedList <string>
+,
+    message-text : string,
+    countA : int32,
+    countB : int32
+  }
+]
+TypeDecl TweetMessageType [
+  open RecordType {
+    nested : TweetMessageNestedType
+  }
+]
+DatasetDecl TweetMessages(TweetMessageType) partitioned by [[nested, tweetid]]
+WriteOutputTo nc1:rttest/rtree-index-join_leftouterjoin-probe-pidx-with-join-rtree-sidx_02.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [tweetid1]
+    :
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=t1 ]
+        Field=nested
+      ]
+      Field=tweetid
+    ]
+  )
+  (
+    LiteralExpr [STRING] [loc1]
+    :
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=t1 ]
+        Field=nested
+      ]
+      Field=sender-location
+    ]
+  )
+  (
+    LiteralExpr [STRING] [nearby-message]
+    :
+    (
+      SELECT ELEMENT [
+      RecordConstructor [
+        (
+          LiteralExpr [STRING] [tweetid2]
+          :
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=t2 ]
+              Field=nested
+            ]
+            Field=tweetid
+          ]
+        )
+        (
+          LiteralExpr [STRING] [loc2]
+          :
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=t2 ]
+              Field=nested
+            ]
+            Field=sender-location
+          ]
+        )
+      ]
+      ]
+      FROM [        FunctionCall Metadata.dataset@1[
+          LiteralExpr [STRING] [TweetMessages]
+        ]
+        AS
+        Variable [ Name=t2 ]
+      ]
+      Where
+        OperatorExpr [
+          FunctionCall test.spatial-intersect@2[
+            FieldAccessor [
+              FieldAccessor [
+                Variable [ Name=t2 ]
+                Field=nested
+              ]
+              Field=sender-location
+            ]
+            Variable [ Name=n ]
+          ]
+          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 ]
+]
+LetVariable [ Name=n ]
+  :=
+  FunctionCall test.create-circle@2[
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=t1 ]
+        Field=nested
+      ]
+      Field=sender-location
+    ]
+    LiteralExpr [DOUBLE] [0.5]
+  ]
+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-open-index/rtree-index-join/spatial-intersect-point_01.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_01.ast
new file mode 100644
index 0000000..3698698
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_01.ast
@@ -0,0 +1,62 @@
+DataverseUse test
+TypeDecl MyRecord [
+  closed RecordType {
+    id : int32,
+    point : point,
+    kwds : string,
+    line1 : line,
+    line2 : line,
+    poly1 : polygon,
+    poly2 : polygon,
+    rec : rectangle
+  }
+]
+TypeDecl MyRecordNested [
+  closed RecordType {
+    nested : MyRecord
+  }
+]
+DatasetDecl MyData1(MyRecordNested) partitioned by [[nested, id]]
+DatasetDecl MyData2(MyRecord) partitioned by [[id]]
+WriteOutputTo nc1:rttest/index-join_rtree-spatial-intersect-point.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [a]
+    :
+    Variable [ Name=a ]
+  )
+  (
+    LiteralExpr [STRING] [b]
+    :
+    Variable [ Name=b ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [MyData1]
+  ]
+  AS
+  Variable [ Name=a ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [MyData2]
+  ]
+  AS
+  Variable [ Name=b ]
+]
+Where
+  FunctionCall test.spatial-intersect@2[
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=a ]
+        Field=nested
+      ]
+      Field=point
+    ]
+    FieldAccessor [
+      Variable [ Name=b ]
+      Field=point
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_02.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_02.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_02.ast
new file mode 100644
index 0000000..e270746
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_02.ast
@@ -0,0 +1,62 @@
+DataverseUse test
+TypeDecl MyRecord [
+  closed RecordType {
+    id : int32,
+    point : point,
+    kwds : string,
+    line1 : line,
+    line2 : line,
+    poly1 : polygon,
+    poly2 : polygon,
+    rec : rectangle
+  }
+]
+TypeDecl MyRecordNested [
+  closed RecordType {
+    nested : MyRecord
+  }
+]
+DatasetDecl MyData1(MyRecordNested) partitioned by [[nested, id]]
+DatasetDecl MyData2(MyRecord) partitioned by [[id]]
+WriteOutputTo nc1:rttest/rtree-index-join_spatial-intersect-point_02.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [a]
+    :
+    Variable [ Name=a ]
+  )
+  (
+    LiteralExpr [STRING] [b]
+    :
+    Variable [ Name=b ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [MyData1]
+  ]
+  AS
+  Variable [ Name=a ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [MyData2]
+  ]
+  AS
+  Variable [ Name=b ]
+]
+Where
+  FunctionCall test.spatial-intersect@2[
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=a ]
+        Field=nested
+      ]
+      Field=point
+    ]
+    FieldAccessor [
+      Variable [ Name=b ]
+      Field=point
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_03.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_03.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_03.ast
new file mode 100644
index 0000000..2b58875
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_03.ast
@@ -0,0 +1,64 @@
+DataverseUse test
+TypeDecl MyRecord [
+  closed RecordType {
+    id : int32,
+    point : point,
+    kwds : string,
+    line1 : line,
+    line2 : line,
+    poly1 : polygon,
+    poly2 : polygon,
+    rec : rectangle
+  }
+]
+TypeDecl MyRecordNested [
+  closed RecordType {
+    nested : MyRecord
+  }
+]
+DatasetDecl MyData(MyRecordNested) partitioned by [[nested, id]]
+WriteOutputTo nc1:rttest/rtree-index-join_spatial-intersect-point_03.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [a]
+    :
+    Variable [ Name=a ]
+  )
+  (
+    LiteralExpr [STRING] [b]
+    :
+    Variable [ Name=b ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [MyData]
+  ]
+  AS
+  Variable [ Name=a ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [MyData]
+  ]
+  AS
+  Variable [ Name=b ]
+]
+Where
+  FunctionCall test.spatial-intersect@2[
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=a ]
+        Field=nested
+      ]
+      Field=point
+    ]
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=b ]
+        Field=nested
+      ]
+      Field=point
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_04.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_04.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_04.ast
new file mode 100644
index 0000000..f91769c
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_04.ast
@@ -0,0 +1,64 @@
+DataverseUse test
+TypeDecl MyRecordNestedOpen [
+  open RecordType {
+    id : int32,
+    kwds : string,
+    line1 : line,
+    line2 : line,
+    poly1 : polygon,
+    poly2 : polygon,
+    rec : rectangle
+  }
+]
+TypeDecl MyRecordOpen [
+  closed RecordType {
+    nested : MyRecordNestedOpen
+  }
+]
+DatasetDecl MyData1(MyRecordOpen) partitioned by [[nested, id]]
+DatasetDecl MyData2(MyRecordOpen) partitioned by [[nested, id]]
+WriteOutputTo nc1:rttest/rtree-index-join_spatial-intersect-point_02.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [a]
+    :
+    Variable [ Name=a ]
+  )
+  (
+    LiteralExpr [STRING] [b]
+    :
+    Variable [ Name=b ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [MyData1]
+  ]
+  AS
+  Variable [ Name=a ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [MyData2]
+  ]
+  AS
+  Variable [ Name=b ]
+]
+Where
+  FunctionCall test.spatial-intersect@2[
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=a ]
+        Field=nested
+      ]
+      Field=point
+    ]
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=b ]
+        Field=nested
+      ]
+      Field=point
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_05.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_05.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_05.ast
new file mode 100644
index 0000000..f91769c
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_05.ast
@@ -0,0 +1,64 @@
+DataverseUse test
+TypeDecl MyRecordNestedOpen [
+  open RecordType {
+    id : int32,
+    kwds : string,
+    line1 : line,
+    line2 : line,
+    poly1 : polygon,
+    poly2 : polygon,
+    rec : rectangle
+  }
+]
+TypeDecl MyRecordOpen [
+  closed RecordType {
+    nested : MyRecordNestedOpen
+  }
+]
+DatasetDecl MyData1(MyRecordOpen) partitioned by [[nested, id]]
+DatasetDecl MyData2(MyRecordOpen) partitioned by [[nested, id]]
+WriteOutputTo nc1:rttest/rtree-index-join_spatial-intersect-point_02.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [a]
+    :
+    Variable [ Name=a ]
+  )
+  (
+    LiteralExpr [STRING] [b]
+    :
+    Variable [ Name=b ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [MyData1]
+  ]
+  AS
+  Variable [ Name=a ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [MyData2]
+  ]
+  AS
+  Variable [ Name=b ]
+]
+Where
+  FunctionCall test.spatial-intersect@2[
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=a ]
+        Field=nested
+      ]
+      Field=point
+    ]
+    FieldAccessor [
+      FieldAccessor [
+        Variable [ Name=b ]
+        Field=nested
+      ]
+      Field=point
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested_loj2.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested_loj2.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested_loj2.ast
new file mode 100644
index 0000000..7c06c85
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested_loj2.ast
@@ -0,0 +1,132 @@
+DataverseUse tpch
+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 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
+  }
+]
+DatasetDecl LineItems(LineItemType) partitioned by [[l_orderkey], [l_linenumber]]
+DatasetDecl Orders(OrderType) partitioned by [[o_orderkey]]
+DatasetDecl Customers(CustomerType) partitioned by [[c_custkey]]
+WriteOutputTo nc1:/tmp/nested_loj.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [cust]
+    :
+    Variable [ Name=c ]
+  )
+  (
+    LiteralExpr [STRING] [orders]
+    :
+    Variable [ Name=orders ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Customers]
+  ]
+  AS
+  Variable [ Name=c ]
+]
+LetVariable [ Name=orders ]
+  :=
+  (
+    SELECT ELEMENT [
+    RecordConstructor [
+      (
+        LiteralExpr [STRING] [order]
+        :
+        Variable [ Name=o ]
+      )
+      (
+        LiteralExpr [STRING] [items]
+        :
+        Variable [ Name=items ]
+      )
+    ]
+    ]
+    FROM [      FunctionCall Metadata.dataset@1[
+        LiteralExpr [STRING] [Orders]
+      ]
+      AS
+      Variable [ Name=o ]
+    ]
+    LetVariable [ Name=items ]
+      :=
+      (
+        SELECT ELEMENT [
+        Variable [ Name=l ]
+        ]
+        FROM [          FunctionCall Metadata.dataset@1[
+            LiteralExpr [STRING] [LineItems]
+          ]
+          AS
+          Variable [ Name=l ]
+        ]
+        Where
+          OperatorExpr [
+            FieldAccessor [
+              Variable [ Name=l ]
+              Field=l_orderkey
+            ]
+            =
+            FieldAccessor [
+              Variable [ Name=o ]
+              Field=o_orderkey
+            ]
+          ]
+      )
+    Where
+      OperatorExpr [
+        FieldAccessor [
+          Variable [ Name=o ]
+          Field=o_custkey
+        ]
+        =
+        FieldAccessor [
+          Variable [ Name=c ]
+          Field=c_custkey
+        ]
+      ]
+  )

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested_loj3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested_loj3.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested_loj3.ast
new file mode 100644
index 0000000..926e14d
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested_loj3.ast
@@ -0,0 +1,192 @@
+DataverseUse tpch
+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 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 PartSuppType [
+  closed RecordType {
+    ps_partkey : int32,
+    ps_suppkey : int32,
+    ps_availqty : int32,
+    ps_supplycost : double,
+    ps_comment : string
+  }
+]
+DatasetDecl LineItems(LineItemType) partitioned by [[l_orderkey], [l_linenumber]]
+DatasetDecl Orders(OrderType) partitioned by [[o_orderkey]]
+DatasetDecl Customers(CustomerType) partitioned by [[c_custkey]]
+DatasetDecl PartSupp(PartSuppType) partitioned by [[ps_partkey], [ps_suppkey]]
+WriteOutputTo nc1:/tmp/nested_loj.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [cust]
+    :
+    Variable [ Name=c ]
+  )
+  (
+    LiteralExpr [STRING] [orders]
+    :
+    Variable [ Name=orders ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Customers]
+  ]
+  AS
+  Variable [ Name=c ]
+]
+LetVariable [ Name=orders ]
+  :=
+  (
+    SELECT ELEMENT [
+    RecordConstructor [
+      (
+        LiteralExpr [STRING] [order]
+        :
+        Variable [ Name=o ]
+      )
+      (
+        LiteralExpr [STRING] [items]
+        :
+        Variable [ Name=items ]
+      )
+    ]
+    ]
+    FROM [      FunctionCall Metadata.dataset@1[
+        LiteralExpr [STRING] [Orders]
+      ]
+      AS
+      Variable [ Name=o ]
+    ]
+    LetVariable [ Name=items ]
+      :=
+      (
+        SELECT ELEMENT [
+        RecordConstructor [
+          (
+            LiteralExpr [STRING] [item]
+            :
+            Variable [ Name=l ]
+          )
+          (
+            LiteralExpr [STRING] [part_supplier]
+            :
+            Variable [ Name=partsupp ]
+          )
+        ]
+        ]
+        FROM [          FunctionCall Metadata.dataset@1[
+            LiteralExpr [STRING] [LineItems]
+          ]
+          AS
+          Variable [ Name=l ]
+        ]
+        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=ps ]
+                    Field=ps_partkey
+                  ]
+                  =
+                  FieldAccessor [
+                    Variable [ Name=l ]
+                    Field=l_partkey
+                  ]
+                ]
+                and
+                OperatorExpr [
+                  FieldAccessor [
+                    Variable [ Name=ps ]
+                    Field=ps_suppkey
+                  ]
+                  =
+                  FieldAccessor [
+                    Variable [ Name=l ]
+                    Field=l_suppkey
+                  ]
+                ]
+              ]
+          )
+        Where
+          OperatorExpr [
+            FieldAccessor [
+              Variable [ Name=l ]
+              Field=l_orderkey
+            ]
+            =
+            FieldAccessor [
+              Variable [ Name=o ]
+              Field=o_orderkey
+            ]
+          ]
+      )
+    Where
+      OperatorExpr [
+        FieldAccessor [
+          Variable [ Name=o ]
+          Field=o_custkey
+        ]
+        =
+        FieldAccessor [
+          Variable [ Name=c ]
+          Field=c_custkey
+        ]
+      ]
+  )

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/btree-index-join/disjunction-to-join.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/btree-index-join/disjunction-to-join.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/btree-index-join/disjunction-to-join.ast
new file mode 100644
index 0000000..4578539
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/btree-index-join/disjunction-to-join.ast
@@ -0,0 +1,38 @@
+DataverseUse test
+TypeDecl TestType [
+  open RecordType {
+    id : string,
+    no-idx : string
+  }
+]
+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 [
+        Variable [ Name=x ]
+        Field=idx
+      ]
+      =
+      LiteralExpr [STRING] [one]
+    ]
+    or
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=x ]
+        Field=idx
+      ]
+      =
+      LiteralExpr [STRING] [two]
+    ]
+  ]