SELECT COUNT(*) from
reviews
where stars > 4
group by stars;

distribute result [$$35]
-- DISTRIBUTE_RESULT  |PARTITIONED|
  exchange
  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
    project ([$$35])
    -- STREAM_PROJECT  |PARTITIONED|
      assign [$$35] <- [{"$1": $$40}]
      -- ASSIGN  |PARTITIONED|
        project ([$$40])
        -- STREAM_PROJECT  |PARTITIONED|
          exchange
          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
            group by ([$$stars := $$42]) decor ([]) {
                      aggregate [$$40] <- [agg-sql-sum($$41)]
                      -- AGGREGATE  |LOCAL|
                        nested tuple source
                        -- NESTED_TUPLE_SOURCE  |LOCAL|
                   }
            -- SORT_GROUP_BY[$$42]  |PARTITIONED|
              exchange
              -- HASH_PARTITION_EXCHANGE [$$42]  |PARTITIONED|
                group by ([$$42 := $$37]) decor ([]) {
                          aggregate [$$41] <- [agg-sql-count(1)]
                          -- AGGREGATE  |LOCAL|
                            nested tuple source
                            -- NESTED_TUPLE_SOURCE  |LOCAL|
                       }
                -- SORT_GROUP_BY[$$37]  |PARTITIONED|
                  exchange
                  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                    select (gt($$37, 4))
                    -- STREAM_SELECT  |PARTITIONED|
                      project ([$$37])
                      -- STREAM_PROJECT  |PARTITIONED|
                        assign [$$37] <- [$$reviews.getField("stars")]
                        -- ASSIGN  |PARTITIONED|
                          project ([$$reviews])
                          -- STREAM_PROJECT  |PARTITIONED|
                            exchange
                            -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                              unnest-map [$$38, $$reviews, $$39] <- index-search("reviews", 0, "Default", "reviews", FALSE, FALSE, 1, $$45, 1, $$45, TRUE, TRUE, TRUE)
                              -- BTREE_SEARCH  |PARTITIONED|
                                exchange
                                -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                  order (ASC, $$45) 
                                  -- STABLE_SORT [$$45(ASC)]  |PARTITIONED|
                                    exchange
                                    -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                      project ([$$45])
                                      -- STREAM_PROJECT  |PARTITIONED|
                                        exchange
                                        -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                          unnest-map [$$44, $$45] <- index-search("r_stars", 0, "Default", "reviews", FALSE, FALSE, 1, $$43, 0, TRUE, TRUE, FALSE)
                                          -- BTREE_SEARCH  |PARTITIONED|
                                            exchange
                                            -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                              assign [$$43] <- [4]
                                              -- ASSIGN  |PARTITIONED|
                                                empty-tuple-source
                                                -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
