http://git-wip-us.apache.org/repos/asf/asterixdb/blob/d906bd89/asterixdb/asterix-app/src/test/resources/optimizerts/results/nested-open-index/inverted-index-join/ngram-jaccard-check_02.plan
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/optimizerts/results/nested-open-index/inverted-index-join/ngram-jaccard-check_02.plan
 
b/asterixdb/asterix-app/src/test/resources/optimizerts/results/nested-open-index/inverted-index-join/ngram-jaccard-check_02.plan
index c38b57d..10e37b8 100644
--- 
a/asterixdb/asterix-app/src/test/resources/optimizerts/results/nested-open-index/inverted-index-join/ngram-jaccard-check_02.plan
+++ 
b/asterixdb/asterix-app/src/test/resources/optimizerts/results/nested-open-index/inverted-index-join/ngram-jaccard-check_02.plan
@@ -3,30 +3,154 @@
     -- STREAM_PROJECT  |PARTITIONED|
       -- ASSIGN  |PARTITIONED|
         -- STREAM_PROJECT  |PARTITIONED|
-          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-            -- HYBRID_HASH_JOIN [$$31][$$21]  |PARTITIONED|
+          -- STREAM_SELECT  |PARTITIONED|
+            -- STREAM_PROJECT  |PARTITIONED|
               -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                -- DATASOURCE_SCAN  |PARTITIONED|
+                -- HYBRID_HASH_JOIN [$$21][$$idLeft_0]  |PARTITIONED|
                   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                    -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
-              -- HASH_PARTITION_EXCHANGE [$$21]  |PARTITIONED|
-                -- STREAM_PROJECT  |PARTITIONED|
-                  -- STREAM_SELECT  |PARTITIONED|
                     -- ASSIGN  |PARTITIONED|
-                      -- ASSIGN  |PARTITIONED|
-                        -- STREAM_PROJECT  |PARTITIONED|
+                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                        -- DATASOURCE_SCAN  |PARTITIONED|
                           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                            -- BTREE_SEARCH  |PARTITIONED|
+                            -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                  -- HASH_PARTITION_EXCHANGE [$$idLeft_0]  |PARTITIONED|
+                    -- STREAM_PROJECT  |PARTITIONED|
+                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                        -- HYBRID_HASH_JOIN [$$22][$$idRight_0]  |PARTITIONED|
+                          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                            -- ASSIGN  |PARTITIONED|
                               -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                -- STABLE_SORT [$$36(ASC)]  |PARTITIONED|
+                                -- DATASOURCE_SCAN  |PARTITIONED|
                                   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                    -- 
LENGTH_PARTITIONED_INVERTED_INDEX_SEARCH  |PARTITIONED|
-                                      -- BROADCAST_EXCHANGE  |PARTITIONED|
-                                        -- STREAM_PROJECT  |PARTITIONED|
-                                          -- ASSIGN  |PARTITIONED|
+                                    -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                          -- HASH_PARTITION_EXCHANGE [$$idRight_0]  
|PARTITIONED|
+                            -- EXTERNAL_GROUP_BY[$$109, $$107]  |PARTITIONED|
+                                    {
+                                      -- AGGREGATE  |LOCAL|
+                                        -- NESTED_TUPLE_SOURCE  |LOCAL|
+                                    }
+                              -- HASH_PARTITION_EXCHANGE [$$109, $$107]  
|PARTITIONED|
+                                -- STREAM_PROJECT  |PARTITIONED|
+                                  -- STREAM_SELECT  |PARTITIONED|
+                                    -- STREAM_PROJECT  |PARTITIONED|
+                                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                        -- HYBRID_HASH_JOIN 
[$$prefixTokenRight][$$prefixTokenLeft]  |PARTITIONED|
+                                          -- HASH_PARTITION_EXCHANGE 
[$$prefixTokenRight]  |PARTITIONED|
+                                            -- UNNEST  |PARTITIONED|
+                                              -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
+                                                -- 
PRE_CLUSTERED_GROUP_BY[$$40]  |PARTITIONED|
+                                                        {
+                                                          -- AGGREGATE  |LOCAL|
+                                                            -- STREAM_SELECT  
|LOCAL|
+                                                              -- 
NESTED_TUPLE_SOURCE  |LOCAL|
+                                                        }
+                                                  -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
+                                                    -- STABLE_SORT [$$40(ASC), 
$$i(ASC)]  |PARTITIONED|
+                                                      -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
+                                                        -- STREAM_PROJECT  
|PARTITIONED|
+                                                          -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                            -- 
HYBRID_HASH_JOIN [$$token][$$tokenGroupped]  |PARTITIONED|
+                                                              -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                -- UNNEST  
|PARTITIONED|
+                                                                  -- 
STREAM_PROJECT  |PARTITIONED|
+                                                                    -- ASSIGN  
|PARTITIONED|
+                                                                      -- 
STREAM_PROJECT  |PARTITIONED|
+                                                                        -- 
ASSIGN  |PARTITIONED|
+                                                                          -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                            -- 
DATASOURCE_SCAN  |PARTITIONED|
+                                                                              
-- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
 -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                                                              -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                -- 
STREAM_PROJECT  |PARTITIONED|
+                                                                  -- ASSIGN  
|PARTITIONED|
+                                                                    -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                      -- 
REPLICATE  |PARTITIONED|
+                                                                        -- 
BROADCAST_EXCHANGE  |PARTITIONED|
+                                                                          -- 
ASSIGN  |PARTITIONED|
+                                                                            -- 
RUNNING_AGGREGATE  |PARTITIONED|
+                                                                              
-- STREAM_PROJECT  |PARTITIONED|
+                                                                               
 -- SORT_MERGE_EXCHANGE [$$114(ASC), $$tokenGroupped(ASC) ]  |PARTITIONED|
+                                                                               
   -- STABLE_SORT [$$114(ASC), $$tokenGroupped(ASC)]  |PARTITIONED|
+                                                                               
     -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
       -- EXTERNAL_GROUP_BY[$$121]  |PARTITIONED|
+                                                                               
               {
+                                                                               
                 -- AGGREGATE  |LOCAL|
+                                                                               
                   -- NESTED_TUPLE_SOURCE  |LOCAL|
+                                                                               
               }
+                                                                               
         -- HASH_PARTITION_EXCHANGE [$$121]  |PARTITIONED|
+                                                                               
           -- EXTERNAL_GROUP_BY[$$token]  |PARTITIONED|
+                                                                               
                   {
+                                                                               
                     -- AGGREGATE  |LOCAL|
+                                                                               
                       -- NESTED_TUPLE_SOURCE  |LOCAL|
+                                                                               
                   }
+                                                                               
             -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
               -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
                 -- UNNEST  |PARTITIONED|
+                                                                               
                   -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
                     -- ASSIGN  |PARTITIONED|
+                                                                               
                       -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
                         -- ASSIGN  |PARTITIONED|
+                                                                               
                           -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
                             -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
                               -- DATASOURCE_SCAN  |PARTITIONED|
+                                                                               
                                 -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
                                   -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                                          -- HASH_PARTITION_EXCHANGE 
[$$prefixTokenLeft]  |PARTITIONED|
                                             -- STREAM_PROJECT  |PARTITIONED|
-                                              -- ASSIGN  |PARTITIONED|
-                                                -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
-                                                  -- DATASOURCE_SCAN  
|PARTITIONED|
-                                                    -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
-                                                      -- EMPTY_TUPLE_SOURCE  
|PARTITIONED|
\ No newline at end of file
+                                              -- UNNEST  |PARTITIONED|
+                                                -- ASSIGN  |PARTITIONED|
+                                                  -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
+                                                    -- 
PRE_CLUSTERED_GROUP_BY[$$34]  |PARTITIONED|
+                                                            {
+                                                              -- AGGREGATE  
|LOCAL|
+                                                                -- 
STREAM_SELECT  |LOCAL|
+                                                                  -- 
NESTED_TUPLE_SOURCE  |LOCAL|
+                                                            }
+                                                      -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
+                                                        -- STABLE_SORT 
[$$34(ASC), $$i(ASC)]  |PARTITIONED|
+                                                          -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                            -- STREAM_PROJECT  
|PARTITIONED|
+                                                              -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                -- 
HYBRID_HASH_JOIN [$$token][$$tokenGroupped]  |PARTITIONED|
+                                                                  -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                    -- UNNEST  
|PARTITIONED|
+                                                                      -- 
STREAM_PROJECT  |PARTITIONED|
+                                                                        -- 
ASSIGN  |PARTITIONED|
+                                                                          -- 
STREAM_PROJECT  |PARTITIONED|
+                                                                            -- 
ASSIGN  |PARTITIONED|
+                                                                              
-- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
 -- DATASOURCE_SCAN  |PARTITIONED|
+                                                                               
   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
     -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                                                                  -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                    -- 
REPLICATE  |PARTITIONED|
+                                                                      -- 
BROADCAST_EXCHANGE  |PARTITIONED|
+                                                                        -- 
ASSIGN  |PARTITIONED|
+                                                                          -- 
RUNNING_AGGREGATE  |PARTITIONED|
+                                                                            -- 
STREAM_PROJECT  |PARTITIONED|
+                                                                              
-- SORT_MERGE_EXCHANGE [$$114(ASC), $$tokenGroupped(ASC) ]  |PARTITIONED|
+                                                                               
 -- STABLE_SORT [$$114(ASC), $$tokenGroupped(ASC)]  |PARTITIONED|
+                                                                               
   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
     -- EXTERNAL_GROUP_BY[$$121]  |PARTITIONED|
+                                                                               
             {
+                                                                               
               -- AGGREGATE  |LOCAL|
+                                                                               
                 -- NESTED_TUPLE_SOURCE  |LOCAL|
+                                                                               
             }
+                                                                               
       -- HASH_PARTITION_EXCHANGE [$$121]  |PARTITIONED|
+                                                                               
         -- EXTERNAL_GROUP_BY[$$token]  |PARTITIONED|
+                                                                               
                 {
+                                                                               
                   -- AGGREGATE  |LOCAL|
+                                                                               
                     -- NESTED_TUPLE_SOURCE  |LOCAL|
+                                                                               
                 }
+                                                                               
           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
             -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
               -- UNNEST  |PARTITIONED|
+                                                                               
                 -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
                   -- ASSIGN  |PARTITIONED|
+                                                                               
                     -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
                       -- ASSIGN  |PARTITIONED|
+                                                                               
                         -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
                           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
                             -- DATASOURCE_SCAN  |PARTITIONED|
+                                                                               
                               -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
                                 -- EMPTY_TUPLE_SOURCE  |PARTITIONED|

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/d906bd89/asterixdb/asterix-app/src/test/resources/optimizerts/results/nested-open-index/inverted-index-join/ngram-jaccard-check_03.plan
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/optimizerts/results/nested-open-index/inverted-index-join/ngram-jaccard-check_03.plan
 
b/asterixdb/asterix-app/src/test/resources/optimizerts/results/nested-open-index/inverted-index-join/ngram-jaccard-check_03.plan
index c38b57d..1c59ba7 100644
--- 
a/asterixdb/asterix-app/src/test/resources/optimizerts/results/nested-open-index/inverted-index-join/ngram-jaccard-check_03.plan
+++ 
b/asterixdb/asterix-app/src/test/resources/optimizerts/results/nested-open-index/inverted-index-join/ngram-jaccard-check_03.plan
@@ -3,30 +3,153 @@
     -- STREAM_PROJECT  |PARTITIONED|
       -- ASSIGN  |PARTITIONED|
         -- STREAM_PROJECT  |PARTITIONED|
-          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-            -- HYBRID_HASH_JOIN [$$31][$$21]  |PARTITIONED|
+          -- STREAM_SELECT  |PARTITIONED|
+            -- STREAM_PROJECT  |PARTITIONED|
               -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                -- DATASOURCE_SCAN  |PARTITIONED|
+                -- HYBRID_HASH_JOIN [$$21][$$idLeft_0]  |PARTITIONED|
                   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                    -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
-              -- HASH_PARTITION_EXCHANGE [$$21]  |PARTITIONED|
-                -- STREAM_PROJECT  |PARTITIONED|
-                  -- STREAM_SELECT  |PARTITIONED|
                     -- ASSIGN  |PARTITIONED|
-                      -- ASSIGN  |PARTITIONED|
-                        -- STREAM_PROJECT  |PARTITIONED|
+                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                        -- DATASOURCE_SCAN  |PARTITIONED|
                           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                            -- BTREE_SEARCH  |PARTITIONED|
+                            -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                  -- HASH_PARTITION_EXCHANGE [$$idLeft_0]  |PARTITIONED|
+                    -- STREAM_PROJECT  |PARTITIONED|
+                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                        -- HYBRID_HASH_JOIN [$$22][$$idRight_0]  |PARTITIONED|
+                          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                            -- ASSIGN  |PARTITIONED|
                               -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                -- STABLE_SORT [$$36(ASC)]  |PARTITIONED|
+                                -- DATASOURCE_SCAN  |PARTITIONED|
                                   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                    -- 
LENGTH_PARTITIONED_INVERTED_INDEX_SEARCH  |PARTITIONED|
-                                      -- BROADCAST_EXCHANGE  |PARTITIONED|
-                                        -- STREAM_PROJECT  |PARTITIONED|
-                                          -- ASSIGN  |PARTITIONED|
+                                    -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                          -- HASH_PARTITION_EXCHANGE [$$idRight_0]  
|PARTITIONED|
+                            -- EXTERNAL_GROUP_BY[$$109, $$107]  |PARTITIONED|
+                                    {
+                                      -- AGGREGATE  |LOCAL|
+                                        -- NESTED_TUPLE_SOURCE  |LOCAL|
+                                    }
+                              -- HASH_PARTITION_EXCHANGE [$$109, $$107]  
|PARTITIONED|
+                                -- STREAM_PROJECT  |PARTITIONED|
+                                  -- STREAM_SELECT  |PARTITIONED|
+                                    -- STREAM_PROJECT  |PARTITIONED|
+                                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                        -- HYBRID_HASH_JOIN 
[$$prefixTokenRight][$$prefixTokenLeft]  |PARTITIONED|
+                                          -- HASH_PARTITION_EXCHANGE 
[$$prefixTokenRight]  |PARTITIONED|
+                                            -- UNNEST  |PARTITIONED|
+                                              -- STREAM_PROJECT  |PARTITIONED|
+                                                -- ASSIGN  |PARTITIONED|
+                                                  -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
+                                                    -- REPLICATE  |PARTITIONED|
+                                                      -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
+                                                        -- 
PRE_CLUSTERED_GROUP_BY[$$34]  |PARTITIONED|
+                                                                {
+                                                                  -- AGGREGATE 
 |LOCAL|
+                                                                    -- 
STREAM_SELECT  |LOCAL|
+                                                                      -- 
NESTED_TUPLE_SOURCE  |LOCAL|
+                                                                }
+                                                          -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                            -- STABLE_SORT 
[$$34(ASC), $$i(ASC)]  |PARTITIONED|
+                                                              -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                -- 
STREAM_PROJECT  |PARTITIONED|
+                                                                  -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                    -- 
HYBRID_HASH_JOIN [$$token][$$tokenGroupped]  |PARTITIONED|
+                                                                      -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                        -- 
UNNEST  |PARTITIONED|
+                                                                          -- 
STREAM_PROJECT  |PARTITIONED|
+                                                                            -- 
ASSIGN  |PARTITIONED|
+                                                                              
-- STREAM_PROJECT  |PARTITIONED|
+                                                                               
 -- ASSIGN  |PARTITIONED|
+                                                                               
   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
     -- DATASOURCE_SCAN  |PARTITIONED|
+                                                                               
       -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
         -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                                                                      -- 
BROADCAST_EXCHANGE  |PARTITIONED|
+                                                                        -- 
ASSIGN  |PARTITIONED|
+                                                                          -- 
RUNNING_AGGREGATE  |PARTITIONED|
+                                                                            -- 
STREAM_PROJECT  |PARTITIONED|
+                                                                              
-- SORT_MERGE_EXCHANGE [$$114(ASC), $$tokenGroupped(ASC) ]  |PARTITIONED|
+                                                                               
 -- STABLE_SORT [$$114(ASC), $$tokenGroupped(ASC)]  |PARTITIONED|
+                                                                               
   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
     -- EXTERNAL_GROUP_BY[$$121]  |PARTITIONED|
+                                                                               
             {
+                                                                               
               -- AGGREGATE  |LOCAL|
+                                                                               
                 -- NESTED_TUPLE_SOURCE  |LOCAL|
+                                                                               
             }
+                                                                               
       -- HASH_PARTITION_EXCHANGE [$$121]  |PARTITIONED|
+                                                                               
         -- EXTERNAL_GROUP_BY[$$token]  |PARTITIONED|
+                                                                               
                 {
+                                                                               
                   -- AGGREGATE  |LOCAL|
+                                                                               
                     -- NESTED_TUPLE_SOURCE  |LOCAL|
+                                                                               
                 }
+                                                                               
           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
             -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
               -- UNNEST  |PARTITIONED|
+                                                                               
                 -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
                   -- ASSIGN  |PARTITIONED|
+                                                                               
                     -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
                       -- ASSIGN  |PARTITIONED|
+                                                                               
                         -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
                           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
                             -- DATASOURCE_SCAN  |PARTITIONED|
+                                                                               
                               -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
                                 -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                                          -- HASH_PARTITION_EXCHANGE 
[$$prefixTokenLeft]  |PARTITIONED|
                                             -- STREAM_PROJECT  |PARTITIONED|
-                                              -- ASSIGN  |PARTITIONED|
-                                                -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
-                                                  -- DATASOURCE_SCAN  
|PARTITIONED|
-                                                    -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
-                                                      -- EMPTY_TUPLE_SOURCE  
|PARTITIONED|
\ No newline at end of file
+                                              -- UNNEST  |PARTITIONED|
+                                                -- ASSIGN  |PARTITIONED|
+                                                  -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
+                                                    -- REPLICATE  |PARTITIONED|
+                                                      -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
+                                                        -- 
PRE_CLUSTERED_GROUP_BY[$$34]  |PARTITIONED|
+                                                                {
+                                                                  -- AGGREGATE 
 |LOCAL|
+                                                                    -- 
STREAM_SELECT  |LOCAL|
+                                                                      -- 
NESTED_TUPLE_SOURCE  |LOCAL|
+                                                                }
+                                                          -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                            -- STABLE_SORT 
[$$34(ASC), $$i(ASC)]  |PARTITIONED|
+                                                              -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                -- 
STREAM_PROJECT  |PARTITIONED|
+                                                                  -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                    -- 
HYBRID_HASH_JOIN [$$token][$$tokenGroupped]  |PARTITIONED|
+                                                                      -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                        -- 
UNNEST  |PARTITIONED|
+                                                                          -- 
STREAM_PROJECT  |PARTITIONED|
+                                                                            -- 
ASSIGN  |PARTITIONED|
+                                                                              
-- STREAM_PROJECT  |PARTITIONED|
+                                                                               
 -- ASSIGN  |PARTITIONED|
+                                                                               
   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
     -- DATASOURCE_SCAN  |PARTITIONED|
+                                                                               
       -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
         -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                                                                      -- 
BROADCAST_EXCHANGE  |PARTITIONED|
+                                                                        -- 
ASSIGN  |PARTITIONED|
+                                                                          -- 
RUNNING_AGGREGATE  |PARTITIONED|
+                                                                            -- 
STREAM_PROJECT  |PARTITIONED|
+                                                                              
-- SORT_MERGE_EXCHANGE [$$114(ASC), $$tokenGroupped(ASC) ]  |PARTITIONED|
+                                                                               
 -- STABLE_SORT [$$114(ASC), $$tokenGroupped(ASC)]  |PARTITIONED|
+                                                                               
   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
     -- EXTERNAL_GROUP_BY[$$121]  |PARTITIONED|
+                                                                               
             {
+                                                                               
               -- AGGREGATE  |LOCAL|
+                                                                               
                 -- NESTED_TUPLE_SOURCE  |LOCAL|
+                                                                               
             }
+                                                                               
       -- HASH_PARTITION_EXCHANGE [$$121]  |PARTITIONED|
+                                                                               
         -- EXTERNAL_GROUP_BY[$$token]  |PARTITIONED|
+                                                                               
                 {
+                                                                               
                   -- AGGREGATE  |LOCAL|
+                                                                               
                     -- NESTED_TUPLE_SOURCE  |LOCAL|
+                                                                               
                 }
+                                                                               
           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
             -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
               -- UNNEST  |PARTITIONED|
+                                                                               
                 -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
                   -- ASSIGN  |PARTITIONED|
+                                                                               
                     -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
                       -- ASSIGN  |PARTITIONED|
+                                                                               
                         -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
                           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
                             -- DATASOURCE_SCAN  |PARTITIONED|
+                                                                               
                               -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
                                 -- EMPTY_TUPLE_SOURCE  |PARTITIONED|

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/d906bd89/asterixdb/asterix-app/src/test/resources/optimizerts/results/nested-open-index/inverted-index-join/ngram-jaccard-check_04.plan
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/optimizerts/results/nested-open-index/inverted-index-join/ngram-jaccard-check_04.plan
 
b/asterixdb/asterix-app/src/test/resources/optimizerts/results/nested-open-index/inverted-index-join/ngram-jaccard-check_04.plan
index c38b57d..10e37b8 100644
--- 
a/asterixdb/asterix-app/src/test/resources/optimizerts/results/nested-open-index/inverted-index-join/ngram-jaccard-check_04.plan
+++ 
b/asterixdb/asterix-app/src/test/resources/optimizerts/results/nested-open-index/inverted-index-join/ngram-jaccard-check_04.plan
@@ -3,30 +3,154 @@
     -- STREAM_PROJECT  |PARTITIONED|
       -- ASSIGN  |PARTITIONED|
         -- STREAM_PROJECT  |PARTITIONED|
-          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-            -- HYBRID_HASH_JOIN [$$31][$$21]  |PARTITIONED|
+          -- STREAM_SELECT  |PARTITIONED|
+            -- STREAM_PROJECT  |PARTITIONED|
               -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                -- DATASOURCE_SCAN  |PARTITIONED|
+                -- HYBRID_HASH_JOIN [$$21][$$idLeft_0]  |PARTITIONED|
                   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                    -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
-              -- HASH_PARTITION_EXCHANGE [$$21]  |PARTITIONED|
-                -- STREAM_PROJECT  |PARTITIONED|
-                  -- STREAM_SELECT  |PARTITIONED|
                     -- ASSIGN  |PARTITIONED|
-                      -- ASSIGN  |PARTITIONED|
-                        -- STREAM_PROJECT  |PARTITIONED|
+                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                        -- DATASOURCE_SCAN  |PARTITIONED|
                           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                            -- BTREE_SEARCH  |PARTITIONED|
+                            -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                  -- HASH_PARTITION_EXCHANGE [$$idLeft_0]  |PARTITIONED|
+                    -- STREAM_PROJECT  |PARTITIONED|
+                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                        -- HYBRID_HASH_JOIN [$$22][$$idRight_0]  |PARTITIONED|
+                          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                            -- ASSIGN  |PARTITIONED|
                               -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                -- STABLE_SORT [$$36(ASC)]  |PARTITIONED|
+                                -- DATASOURCE_SCAN  |PARTITIONED|
                                   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                    -- 
LENGTH_PARTITIONED_INVERTED_INDEX_SEARCH  |PARTITIONED|
-                                      -- BROADCAST_EXCHANGE  |PARTITIONED|
-                                        -- STREAM_PROJECT  |PARTITIONED|
-                                          -- ASSIGN  |PARTITIONED|
+                                    -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                          -- HASH_PARTITION_EXCHANGE [$$idRight_0]  
|PARTITIONED|
+                            -- EXTERNAL_GROUP_BY[$$109, $$107]  |PARTITIONED|
+                                    {
+                                      -- AGGREGATE  |LOCAL|
+                                        -- NESTED_TUPLE_SOURCE  |LOCAL|
+                                    }
+                              -- HASH_PARTITION_EXCHANGE [$$109, $$107]  
|PARTITIONED|
+                                -- STREAM_PROJECT  |PARTITIONED|
+                                  -- STREAM_SELECT  |PARTITIONED|
+                                    -- STREAM_PROJECT  |PARTITIONED|
+                                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                        -- HYBRID_HASH_JOIN 
[$$prefixTokenRight][$$prefixTokenLeft]  |PARTITIONED|
+                                          -- HASH_PARTITION_EXCHANGE 
[$$prefixTokenRight]  |PARTITIONED|
+                                            -- UNNEST  |PARTITIONED|
+                                              -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
+                                                -- 
PRE_CLUSTERED_GROUP_BY[$$40]  |PARTITIONED|
+                                                        {
+                                                          -- AGGREGATE  |LOCAL|
+                                                            -- STREAM_SELECT  
|LOCAL|
+                                                              -- 
NESTED_TUPLE_SOURCE  |LOCAL|
+                                                        }
+                                                  -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
+                                                    -- STABLE_SORT [$$40(ASC), 
$$i(ASC)]  |PARTITIONED|
+                                                      -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
+                                                        -- STREAM_PROJECT  
|PARTITIONED|
+                                                          -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                            -- 
HYBRID_HASH_JOIN [$$token][$$tokenGroupped]  |PARTITIONED|
+                                                              -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                -- UNNEST  
|PARTITIONED|
+                                                                  -- 
STREAM_PROJECT  |PARTITIONED|
+                                                                    -- ASSIGN  
|PARTITIONED|
+                                                                      -- 
STREAM_PROJECT  |PARTITIONED|
+                                                                        -- 
ASSIGN  |PARTITIONED|
+                                                                          -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                            -- 
DATASOURCE_SCAN  |PARTITIONED|
+                                                                              
-- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
 -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                                                              -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                -- 
STREAM_PROJECT  |PARTITIONED|
+                                                                  -- ASSIGN  
|PARTITIONED|
+                                                                    -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                      -- 
REPLICATE  |PARTITIONED|
+                                                                        -- 
BROADCAST_EXCHANGE  |PARTITIONED|
+                                                                          -- 
ASSIGN  |PARTITIONED|
+                                                                            -- 
RUNNING_AGGREGATE  |PARTITIONED|
+                                                                              
-- STREAM_PROJECT  |PARTITIONED|
+                                                                               
 -- SORT_MERGE_EXCHANGE [$$114(ASC), $$tokenGroupped(ASC) ]  |PARTITIONED|
+                                                                               
   -- STABLE_SORT [$$114(ASC), $$tokenGroupped(ASC)]  |PARTITIONED|
+                                                                               
     -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
       -- EXTERNAL_GROUP_BY[$$121]  |PARTITIONED|
+                                                                               
               {
+                                                                               
                 -- AGGREGATE  |LOCAL|
+                                                                               
                   -- NESTED_TUPLE_SOURCE  |LOCAL|
+                                                                               
               }
+                                                                               
         -- HASH_PARTITION_EXCHANGE [$$121]  |PARTITIONED|
+                                                                               
           -- EXTERNAL_GROUP_BY[$$token]  |PARTITIONED|
+                                                                               
                   {
+                                                                               
                     -- AGGREGATE  |LOCAL|
+                                                                               
                       -- NESTED_TUPLE_SOURCE  |LOCAL|
+                                                                               
                   }
+                                                                               
             -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
               -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
                 -- UNNEST  |PARTITIONED|
+                                                                               
                   -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
                     -- ASSIGN  |PARTITIONED|
+                                                                               
                       -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
                         -- ASSIGN  |PARTITIONED|
+                                                                               
                           -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
                             -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
                               -- DATASOURCE_SCAN  |PARTITIONED|
+                                                                               
                                 -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
                                   -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                                          -- HASH_PARTITION_EXCHANGE 
[$$prefixTokenLeft]  |PARTITIONED|
                                             -- STREAM_PROJECT  |PARTITIONED|
-                                              -- ASSIGN  |PARTITIONED|
-                                                -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
-                                                  -- DATASOURCE_SCAN  
|PARTITIONED|
-                                                    -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
-                                                      -- EMPTY_TUPLE_SOURCE  
|PARTITIONED|
\ No newline at end of file
+                                              -- UNNEST  |PARTITIONED|
+                                                -- ASSIGN  |PARTITIONED|
+                                                  -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
+                                                    -- 
PRE_CLUSTERED_GROUP_BY[$$34]  |PARTITIONED|
+                                                            {
+                                                              -- AGGREGATE  
|LOCAL|
+                                                                -- 
STREAM_SELECT  |LOCAL|
+                                                                  -- 
NESTED_TUPLE_SOURCE  |LOCAL|
+                                                            }
+                                                      -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
+                                                        -- STABLE_SORT 
[$$34(ASC), $$i(ASC)]  |PARTITIONED|
+                                                          -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                            -- STREAM_PROJECT  
|PARTITIONED|
+                                                              -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                -- 
HYBRID_HASH_JOIN [$$token][$$tokenGroupped]  |PARTITIONED|
+                                                                  -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                    -- UNNEST  
|PARTITIONED|
+                                                                      -- 
STREAM_PROJECT  |PARTITIONED|
+                                                                        -- 
ASSIGN  |PARTITIONED|
+                                                                          -- 
STREAM_PROJECT  |PARTITIONED|
+                                                                            -- 
ASSIGN  |PARTITIONED|
+                                                                              
-- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
 -- DATASOURCE_SCAN  |PARTITIONED|
+                                                                               
   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
     -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                                                                  -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                    -- 
REPLICATE  |PARTITIONED|
+                                                                      -- 
BROADCAST_EXCHANGE  |PARTITIONED|
+                                                                        -- 
ASSIGN  |PARTITIONED|
+                                                                          -- 
RUNNING_AGGREGATE  |PARTITIONED|
+                                                                            -- 
STREAM_PROJECT  |PARTITIONED|
+                                                                              
-- SORT_MERGE_EXCHANGE [$$114(ASC), $$tokenGroupped(ASC) ]  |PARTITIONED|
+                                                                               
 -- STABLE_SORT [$$114(ASC), $$tokenGroupped(ASC)]  |PARTITIONED|
+                                                                               
   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
     -- EXTERNAL_GROUP_BY[$$121]  |PARTITIONED|
+                                                                               
             {
+                                                                               
               -- AGGREGATE  |LOCAL|
+                                                                               
                 -- NESTED_TUPLE_SOURCE  |LOCAL|
+                                                                               
             }
+                                                                               
       -- HASH_PARTITION_EXCHANGE [$$121]  |PARTITIONED|
+                                                                               
         -- EXTERNAL_GROUP_BY[$$token]  |PARTITIONED|
+                                                                               
                 {
+                                                                               
                   -- AGGREGATE  |LOCAL|
+                                                                               
                     -- NESTED_TUPLE_SOURCE  |LOCAL|
+                                                                               
                 }
+                                                                               
           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
             -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
               -- UNNEST  |PARTITIONED|
+                                                                               
                 -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
                   -- ASSIGN  |PARTITIONED|
+                                                                               
                     -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
                       -- ASSIGN  |PARTITIONED|
+                                                                               
                         -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
                           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
                             -- DATASOURCE_SCAN  |PARTITIONED|
+                                                                               
                               -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
                                 -- EMPTY_TUPLE_SOURCE  |PARTITIONED|

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/d906bd89/asterixdb/asterix-app/src/test/resources/optimizerts/results/nested-open-index/inverted-index-join/ngram-jaccard-inline.plan
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/optimizerts/results/nested-open-index/inverted-index-join/ngram-jaccard-inline.plan
 
b/asterixdb/asterix-app/src/test/resources/optimizerts/results/nested-open-index/inverted-index-join/ngram-jaccard-inline.plan
index b375fd6..789e9bc 100644
--- 
a/asterixdb/asterix-app/src/test/resources/optimizerts/results/nested-open-index/inverted-index-join/ngram-jaccard-inline.plan
+++ 
b/asterixdb/asterix-app/src/test/resources/optimizerts/results/nested-open-index/inverted-index-join/ngram-jaccard-inline.plan
@@ -3,35 +3,182 @@
     -- STREAM_PROJECT  |PARTITIONED|
       -- ASSIGN  |PARTITIONED|
         -- STREAM_PROJECT  |PARTITIONED|
-          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-            -- HYBRID_HASH_JOIN [$$41][$$26]  |PARTITIONED|
+          -- STREAM_SELECT  |PARTITIONED|
+            -- STREAM_PROJECT  |PARTITIONED|
               -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                -- STREAM_PROJECT  |PARTITIONED|
-                  -- ASSIGN  |PARTITIONED|
-                    -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                      -- DATASOURCE_SCAN  |PARTITIONED|
-                        -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                          -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
-              -- HASH_PARTITION_EXCHANGE [$$26]  |PARTITIONED|
-                -- STREAM_PROJECT  |PARTITIONED|
-                  -- STREAM_SELECT  |PARTITIONED|
-                    -- ASSIGN  |PARTITIONED|
+                -- HYBRID_HASH_JOIN [$$26][$$idLeft_0]  |PARTITIONED|
+                  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                    -- STREAM_PROJECT  |PARTITIONED|
                       -- ASSIGN  |PARTITIONED|
-                        -- STREAM_PROJECT  |PARTITIONED|
-                          -- ASSIGN  |PARTITIONED|
-                            -- STREAM_PROJECT  |PARTITIONED|
-                              -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                -- BTREE_SEARCH  |PARTITIONED|
-                                  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                    -- STABLE_SORT [$$46(ASC)]  |PARTITIONED|
+                        -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                          -- REPLICATE  |PARTITIONED|
+                            -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                              -- STREAM_PROJECT  |PARTITIONED|
+                                -- ASSIGN  |PARTITIONED|
+                                  -- STREAM_PROJECT  |PARTITIONED|
+                                    -- ASSIGN  |PARTITIONED|
                                       -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                        -- 
LENGTH_PARTITIONED_INVERTED_INDEX_SEARCH  |PARTITIONED|
-                                          -- BROADCAST_EXCHANGE  |PARTITIONED|
+                                        -- REPLICATE  |PARTITIONED|
+                                          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                             -- STREAM_PROJECT  |PARTITIONED|
                                               -- ASSIGN  |PARTITIONED|
-                                                -- STREAM_PROJECT  
|PARTITIONED|
-                                                  -- ASSIGN  |PARTITIONED|
+                                                -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
+                                                  -- DATASOURCE_SCAN  
|PARTITIONED|
                                                     -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
-                                                      -- DATASOURCE_SCAN  
|PARTITIONED|
-                                                        -- ONE_TO_ONE_EXCHANGE 
 |PARTITIONED|
-                                                          -- 
EMPTY_TUPLE_SOURCE  |PARTITIONED|
\ No newline at end of file
+                                                      -- EMPTY_TUPLE_SOURCE  
|PARTITIONED|
+                  -- HASH_PARTITION_EXCHANGE [$$idLeft_0]  |PARTITIONED|
+                    -- STREAM_PROJECT  |PARTITIONED|
+                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                        -- HYBRID_HASH_JOIN [$$27][$$idRight_0]  |PARTITIONED|
+                          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                            -- REPLICATE  |PARTITIONED|
+                              -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                -- STREAM_PROJECT  |PARTITIONED|
+                                  -- ASSIGN  |PARTITIONED|
+                                    -- STREAM_PROJECT  |PARTITIONED|
+                                      -- ASSIGN  |PARTITIONED|
+                                        -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                          -- REPLICATE  |PARTITIONED|
+                                            -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
+                                              -- STREAM_PROJECT  |PARTITIONED|
+                                                -- ASSIGN  |PARTITIONED|
+                                                  -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
+                                                    -- DATASOURCE_SCAN  
|PARTITIONED|
+                                                      -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
+                                                        -- EMPTY_TUPLE_SOURCE  
|PARTITIONED|
+                          -- HASH_PARTITION_EXCHANGE [$$idRight_0]  
|PARTITIONED|
+                            -- EXTERNAL_GROUP_BY[$$119, $$117]  |PARTITIONED|
+                                    {
+                                      -- AGGREGATE  |LOCAL|
+                                        -- NESTED_TUPLE_SOURCE  |LOCAL|
+                                    }
+                              -- HASH_PARTITION_EXCHANGE [$$119, $$117]  
|PARTITIONED|
+                                -- STREAM_PROJECT  |PARTITIONED|
+                                  -- STREAM_SELECT  |PARTITIONED|
+                                    -- STREAM_PROJECT  |PARTITIONED|
+                                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                        -- HYBRID_HASH_JOIN 
[$$prefixTokenRight][$$prefixTokenLeft]  |PARTITIONED|
+                                          -- HASH_PARTITION_EXCHANGE 
[$$prefixTokenRight]  |PARTITIONED|
+                                            -- UNNEST  |PARTITIONED|
+                                              -- STREAM_PROJECT  |PARTITIONED|
+                                                -- ASSIGN  |PARTITIONED|
+                                                  -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
+                                                    -- REPLICATE  |PARTITIONED|
+                                                      -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
+                                                        -- 
PRE_CLUSTERED_GROUP_BY[$$44]  |PARTITIONED|
+                                                                {
+                                                                  -- AGGREGATE 
 |LOCAL|
+                                                                    -- 
STREAM_SELECT  |LOCAL|
+                                                                      -- 
NESTED_TUPLE_SOURCE  |LOCAL|
+                                                                }
+                                                          -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                            -- STABLE_SORT 
[$$44(ASC), $$i(ASC)]  |PARTITIONED|
+                                                              -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                -- 
STREAM_PROJECT  |PARTITIONED|
+                                                                  -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                    -- 
HYBRID_HASH_JOIN [$$token][$$tokenGroupped]  |PARTITIONED|
+                                                                      -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                        -- 
UNNEST  |PARTITIONED|
+                                                                          -- 
STREAM_PROJECT  |PARTITIONED|
+                                                                            -- 
ASSIGN  |PARTITIONED|
+                                                                              
-- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
 -- REPLICATE  |PARTITIONED|
+                                                                               
   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
     -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
       -- ASSIGN  |PARTITIONED|
+                                                                               
         -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
           -- DATASOURCE_SCAN  |PARTITIONED|
+                                                                               
             -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
               -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                                                                      -- 
BROADCAST_EXCHANGE  |PARTITIONED|
+                                                                        -- 
ASSIGN  |PARTITIONED|
+                                                                          -- 
RUNNING_AGGREGATE  |PARTITIONED|
+                                                                            -- 
STREAM_PROJECT  |PARTITIONED|
+                                                                              
-- SORT_MERGE_EXCHANGE [$$124(ASC), $$tokenGroupped(ASC) ]  |PARTITIONED|
+                                                                               
 -- STABLE_SORT [$$124(ASC), $$tokenGroupped(ASC)]  |PARTITIONED|
+                                                                               
   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
     -- EXTERNAL_GROUP_BY[$$131]  |PARTITIONED|
+                                                                               
             {
+                                                                               
               -- AGGREGATE  |LOCAL|
+                                                                               
                 -- NESTED_TUPLE_SOURCE  |LOCAL|
+                                                                               
             }
+                                                                               
       -- HASH_PARTITION_EXCHANGE [$$131]  |PARTITIONED|
+                                                                               
         -- EXTERNAL_GROUP_BY[$$token]  |PARTITIONED|
+                                                                               
                 {
+                                                                               
                   -- AGGREGATE  |LOCAL|
+                                                                               
                     -- NESTED_TUPLE_SOURCE  |LOCAL|
+                                                                               
                 }
+                                                                               
           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
             -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
               -- UNNEST  |PARTITIONED|
+                                                                               
                 -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
                   -- ASSIGN  |PARTITIONED|
+                                                                               
                     -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
                       -- ASSIGN  |PARTITIONED|
+                                                                               
                         -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
                           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
                             -- DATASOURCE_SCAN  |PARTITIONED|
+                                                                               
                               -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
                                 -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                                          -- HASH_PARTITION_EXCHANGE 
[$$prefixTokenLeft]  |PARTITIONED|
+                                            -- STREAM_PROJECT  |PARTITIONED|
+                                              -- UNNEST  |PARTITIONED|
+                                                -- ASSIGN  |PARTITIONED|
+                                                  -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
+                                                    -- REPLICATE  |PARTITIONED|
+                                                      -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
+                                                        -- 
PRE_CLUSTERED_GROUP_BY[$$44]  |PARTITIONED|
+                                                                {
+                                                                  -- AGGREGATE 
 |LOCAL|
+                                                                    -- 
STREAM_SELECT  |LOCAL|
+                                                                      -- 
NESTED_TUPLE_SOURCE  |LOCAL|
+                                                                }
+                                                          -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                            -- STABLE_SORT 
[$$44(ASC), $$i(ASC)]  |PARTITIONED|
+                                                              -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                -- 
STREAM_PROJECT  |PARTITIONED|
+                                                                  -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                    -- 
HYBRID_HASH_JOIN [$$token][$$tokenGroupped]  |PARTITIONED|
+                                                                      -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                        -- 
UNNEST  |PARTITIONED|
+                                                                          -- 
STREAM_PROJECT  |PARTITIONED|
+                                                                            -- 
ASSIGN  |PARTITIONED|
+                                                                              
-- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
 -- REPLICATE  |PARTITIONED|
+                                                                               
   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
     -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
       -- ASSIGN  |PARTITIONED|
+                                                                               
         -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
           -- DATASOURCE_SCAN  |PARTITIONED|
+                                                                               
             -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
               -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                                                                      -- 
BROADCAST_EXCHANGE  |PARTITIONED|
+                                                                        -- 
ASSIGN  |PARTITIONED|
+                                                                          -- 
RUNNING_AGGREGATE  |PARTITIONED|
+                                                                            -- 
STREAM_PROJECT  |PARTITIONED|
+                                                                              
-- SORT_MERGE_EXCHANGE [$$124(ASC), $$tokenGroupped(ASC) ]  |PARTITIONED|
+                                                                               
 -- STABLE_SORT [$$124(ASC), $$tokenGroupped(ASC)]  |PARTITIONED|
+                                                                               
   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
     -- EXTERNAL_GROUP_BY[$$131]  |PARTITIONED|
+                                                                               
             {
+                                                                               
               -- AGGREGATE  |LOCAL|
+                                                                               
                 -- NESTED_TUPLE_SOURCE  |LOCAL|
+                                                                               
             }
+                                                                               
       -- HASH_PARTITION_EXCHANGE [$$131]  |PARTITIONED|
+                                                                               
         -- EXTERNAL_GROUP_BY[$$token]  |PARTITIONED|
+                                                                               
                 {
+                                                                               
                   -- AGGREGATE  |LOCAL|
+                                                                               
                     -- NESTED_TUPLE_SOURCE  |LOCAL|
+                                                                               
                 }
+                                                                               
           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
             -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
               -- UNNEST  |PARTITIONED|
+                                                                               
                 -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
                   -- ASSIGN  |PARTITIONED|
+                                                                               
                     -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
                       -- ASSIGN  |PARTITIONED|
+                                                                               
                         -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
                           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
                             -- DATASOURCE_SCAN  |PARTITIONED|
+                                                                               
                               -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
                                 -- EMPTY_TUPLE_SOURCE  |PARTITIONED|

Reply via email to