class MinusGrouping<Row> extends Grouping<Row> {
        /** */
        private MinusGrouping(ExecutionContext<Row> ctx, RowFactory<Row> rowFactory, AggregateType type, boolean all) {
            super(ctx, rowFactory, type, all);
        }

        /** {@inheritDoc} */
        @Override protected void addOnSingle(Row row, int setIdx) {<FILL_FUNCTION_BODY>}

        /** {@inheritDoc} */
        @Override protected void addOnMapper(Row row, int setIdx) {
            // Value in the map will always have 2 elements, first - count of keys in the first set,
            // second - count of keys in all sets except first.
            int[] cntrs = groups.computeIfAbsent(key(row), k -> new int[2]);

            cntrs[setIdx == 0 ? 0 : 1]++;
        }

        /** {@inheritDoc} */
        @Override protected boolean affectResult(int[] cntrs) {
            return cntrs[0] != cntrs[1];
        }

        /** {@inheritDoc} */
        @Override protected int availableRows(int[] cntrs) {
            assert cntrs.length == 2;

            if (all)
                return Math.max(cntrs[0] - cntrs[1], 0);
            else
                return cntrs[1] == 0 ? 1 : 0;
        }

        /** {@inheritDoc} */
        @Override protected void decrementAvailableRows(int[] cntrs, int amount) {
            assert amount > 0;
            assert all;

            cntrs[0] -= amount;
        }

        /** {@inheritDoc} */
        @Override protected int countersSize() {
            return 2;
        }
    }

            int[] cntrs;

            GroupKey key = key(row);

            if (setIdx == 0) {
                // Value in the map will always have 2 elements, first - count of keys in the first set,
                // second - count of keys in all sets except first.
                cntrs = groups.computeIfAbsent(key, k -> new int[2]);

                cntrs[0]++;
            }
            else if (all) {
                cntrs = groups.get(key);

                if (cntrs != null) {
                    cntrs[1]++;

                    if (cntrs[1] >= cntrs[0])
                        groups.remove(key);
                }
            }
            else
                groups.remove(key);
        
<methods>public void end(int) throws java.lang.Exception,public void push(Row, int) throws java.lang.Exception,public void request(int) throws java.lang.Exception<variables>private int curSrcIdx,private final non-sealed Grouping<Row> grouping,private boolean inLoop,private int requested,private final non-sealed org.apache.ignite.internal.processors.query.calcite.exec.exp.agg.AggregateType type,private int waiting