Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The rule InlineSubplanInputForNestedTupleSourceRule is to remove SubplanOperators containing DataScan, InnerJoin, LeftOuterJoin, UnionAll or Distinct. Given a qualified Subplan operator called S1, Let's call its input operator O1.

===General Cases===

 We have the following rewritings for general cases:

...

      unnest $$6 <- function-call: asterix:scan-collection, Args:[%0->$$26] -- |UNPARTITIONED|

        subplan {

                  aggregate [$$26] <- [function-call: asterix:listify, Args:[%0->$$22]] -- |UNPARTITIONED|

                    join (TRUE) -- |UNPARTITIONED|

                      select (%0->$$21) -- |UNPARTITIONED|

                        subplan {

                                  aggregate [$$21] <- [function-call: asterix:non-empty-stream, Args:[]] -- |UNPARTITIONED|

                                    join (function-call: algebricks:eq, Args:[%0->$$34, %0->$$7]) -- |UNPARTITIONED|

                                      nested tuple source -- |UNPARTITIONED|

                                      assign [$$34] <- [function-call: asterix:field-access-by-index, Args:[%0->$$10, AInt32: {1}]] -- |UNPARTITIONED|

                                        data-scan []<-[$$32, $$10] <- emergencyTest:userLocations -- |UNPARTITIONED|

                                          empty-tuple-source -- |UNPARTITIONED|

                               } -- |UNPARTITIONED|

                          data-scan []<-[$$31, $$8] <- emergencyTest:CHPReports -- |UNPARTITIONED|

                            nested tuple source -- |UNPARTITIONED|

                      assign [$$22] <- [function-call: asterix:open-record-constructor, Args:[AString: {shelter locations}, %0->$$25]] -- |UNPARTITIONED|

                        aggregate [$$25] <- [function-call: asterix:listify, Args:[%0->$$24]] -- |UNPARTITIONED|

                          assign [$$24] <- [function-call: asterix:field-access-by-index, Args:[%0->$$11, AInt32: {1}]] -- |UNPARTITIONED|

                            data-scan []<-[$$33, $$11] <- emergencyTest:tornadoShelters -- |UNPARTITIONED|

                              empty-tuple-source -- |UNPARTITIONED|

               } -- |UNPARTITIONED|

          assign [$$7] <- [function-call: asterix:field-access-by-index, Args:[%0->$$5, AInt32: {1}]] -- |UNPARTITIONED|

...

      unnest $$6 <- function-call: asterix:scan-collection, Args:[%0->$$26] -- |UNPARTITIONED|

        group by ([$$44 := %0->$$30]) decor ([%0->$$35; %0->$$5; %0->$$7]) {

                  aggregate [$$26] <- [function-call: asterix:listify, Args:[%0->$$22]] -- |UNPARTITIONED|

                    select (function-call: algebricks:not, Args:[function-call: algebricks:is-null, Args:[%0->$$43]]) -- |UNPARTITIONED|

                      nested tuple source -- |UNPARTITIONED|

               } -- |UNPARTITIONED|

          left outer join (function-call: algebricks:eq, Args:[%0->$$30, %0->$$42]) -- |UNPARTITIONED|

            assign [$$7] <- [function-call: asterix:field-access-by-index, Args:[%0->$$5, AInt32: {1}]] -- |UNPARTITIONED|

              assign [$$35] <- [function-call: asterix:field-access-by-name, Args:[%0->$$5, AString: {subscription-id}]] -- |UNPARTITIONED|

                data-scan []<-[$$30, $$5] <- emergencyTest:NearbySheltersDuringTornadoDangerChannelSubscriptions -- |UNPARTITIONED|

                  empty-tuple-source -- |UNPARTITIONED|

            assign [$$43] <- [TRUE] -- |UNPARTITIONED|

              join (TRUE) -- |UNPARTITIONED|

                select (%0->$$21) -- |UNPARTITIONED|

                  group by ([$$37 := %0->$$31; $$42 := %0->$$41]) decor ([%0->$$40; %0->$$39; %0->$$38; %0->$$8]) {

                            aggregate [$$21] <- [function-call: asterix:non-empty-stream, Args:[]] -- |UNPARTITIONED|

                              select (function-call: algebricks:not, Args:[function-call: algebricks:is-null, Args:[%0->$$36]]) -- |UNPARTITIONED|

                                nested tuple source -- |UNPARTITIONED|

                         } -- |UNPARTITIONED|

                    left outer join (function-call: algebricks:eq, Args:[%0->$$34, %0->$$38]) -- |UNPARTITIONED|

                      data-scan []<-[$$31, $$8] <- emergencyTest:CHPReports -- |UNPARTITIONED|

                        assign [$$38] <- [function-call: asterix:field-access-by-index, Args:[%0->$$39, AInt32: {1}]] -- |UNPARTITIONED|

                          assign [$$40] <- [function-call: asterix:field-access-by-name, Args:[%0->$$39, AString: {subscription-id}]] -- |UNPARTITIONED|

                            data-scan []<-[$$41, $$39] <- emergencyTest:NearbySheltersDuringTornadoDangerChannelSubscriptions -- |UNPARTITIONED|

                              empty-tuple-source -- |UNPARTITIONED|

                      assign [$$36] <- [TRUE] -- |UNPARTITIONED|

                        assign [$$34] <- [function-call: asterix:field-access-by-index, Args:[%0->$$10, AInt32: {1}]] -- |UNPARTITIONED|

                          data-scan []<-[$$32, $$10] <- emergencyTest:userLocations -- |UNPARTITIONED|

                            empty-tuple-source -- |UNPARTITIONED|

                assign [$$22] <- [function-call: asterix:open-record-constructor, Args:[AString: {shelter locations}, %0->$$25]] -- |UNPARTITIONED|

                  aggregate [$$25] <- [function-call: asterix:listify, Args:[%0->$$24]] -- |UNPARTITIONED|

                    assign [$$24] <- [function-call: asterix:field-access-by-index, Args:[%0->$$11, AInt32: {1}]] -- |UNPARTITIONED|

                      data-scan []<-[$$33, $$11] <- emergencyTest:tornadoShelters -- |UNPARTITIONED|

                        empty-tuple-source -- |UNPARTITIONED|

  

Special Cases

For special cases where:

a. there is a join (let's call it J1.) in the nested plan,

...