local exchange (GATHER, SINGLE, [])
    remote exchange (GATHER, SINGLE, [])
        final aggregation over (ca_country$gid, ca_county$gid, ca_state$gid, groupid, i_item_id$gid)
            local exchange (REPARTITION, HASH, ["ca_country$gid", "ca_county$gid", "ca_state$gid", "groupid", "i_item_id$gid"])
                remote exchange (REPARTITION, HASH, ["ca_country$gid", "ca_county$gid", "ca_state$gid", "groupid", "i_item_id$gid"])
                    partial aggregation over (ca_country$gid, ca_county$gid, ca_state$gid, groupid, i_item_id$gid)
                        join (INNER, PARTITIONED):
                            remote exchange (REPARTITION, HASH, ["cs_item_sk"])
                                join (INNER, PARTITIONED):
                                    remote exchange (REPARTITION, HASH, ["cd_demo_sk"])
                                        scan customer_demographics (pushdown = true)
                                    local exchange (GATHER, SINGLE, [])
                                        remote exchange (REPARTITION, HASH, ["cs_bill_cdemo_sk"])
                                            join (INNER, REPLICATED):
                                                join (INNER, REPLICATED):
                                                    scan catalog_sales
                                                    local exchange (GATHER, SINGLE, [])
                                                        remote exchange (REPLICATE, BROADCAST, [])
                                                            scan date_dim (pushdown = true)
                                                local exchange (GATHER, SINGLE, [])
                                                    remote exchange (REPLICATE, BROADCAST, [])
                                                        join (INNER, REPLICATED):
                                                            scan customer_demographics
                                                            local exchange (GATHER, SINGLE, [])
                                                                remote exchange (REPLICATE, BROADCAST, [])
                                                                    join (INNER, PARTITIONED):
                                                                        remote exchange (REPARTITION, HASH, ["c_current_addr_sk"])
                                                                            scan customer (pushdown = true)
                                                                        local exchange (GATHER, SINGLE, [])
                                                                            remote exchange (REPARTITION, HASH, ["ca_address_sk"])
                                                                                scan customer_address (pushdown = true)
                            local exchange (GATHER, SINGLE, [])
                                remote exchange (REPARTITION, HASH, ["i_item_sk"])
                                    scan item
