HashGroupingOperator has been updated to close inbound pages. Ordinals needs to do similar.
x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/OperatorTests.java
builder.appendInt(segments.getInt(i));
                        }
                        segments = builder.build();
                    }
                    IntVector docs = docVector.docs();
                    if (randomBoolean()) {
                        List<Integer> ids = new ArrayList<>(positionCount);
                        for (int i = 0; i < positionCount; i++) {
                            ids.add(docs.getInt(i));
                        }
                        Collections.shuffle(ids, random());
                        docs = blockFactory.newIntArrayVector(ids.stream().mapToInt(n -> n).toArray(), positionCount);
                    }
                    Block[] blocks = new Block[page.getBlockCount()];
                    blocks[0] = new DocVector(shards, segments, docs, false).asBlock();
                    for (int i = 1; i < blocks.length; i++) {
                        blocks[i] = page.getBlock(i);
                    }
                    return new Page(blocks);
                }
                @Override
                public String toString() {
                    return "ShuffleDocs";
                }
            };
            try (DirectoryReader reader = writer.getReader()) {
                Driver driver = new Driver(
                    driverContext,
                    luceneOperatorFactory(reader, new MatchAllDocsQuery(), LuceneOperator.NO_LIMIT).get(driverContext),
                    List.of(shuffleDocsOperator, new AbstractPageMappingOperator() {