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
Document doc = new Document();
                BytesRef key = new BytesRef(randomByteArrayOfLength(keyLength));
                SortedSetDocValuesField docValuesField = new SortedSetDocValuesField(gField, key);
                doc.add(docValuesField);
                writer.addDocument(doc);
                expectedCounts.compute(key, (k, v) -> v == null ? 1 : v + 1);
            }
            writer.commit();
            Map<BytesRef, Long> actualCounts = new HashMap<>();
            boolean shuffleDocs = randomBoolean();
            Operator shuffleDocsOperator = new AbstractPageMappingOperator() {
                @Override
                protected Page process(Page page) {
                    if (shuffleDocs == false) {
                        return page;
                    }
                    DocVector docVector = (DocVector) page.getBlock(0).asVector();
                    int positionCount = docVector.getPositionCount();
                    IntVector shards = docVector.shards();
                    if (randomBoolean()) {
                        IntVector.Builder builder = IntVector.newVectorBuilder(positionCount);
                        for (int i = 0; i < positionCount; i++) {
                            builder.appendInt(shards.getInt(i));
                        }
                        shards = builder.build();
                    }
                    IntVector segments = docVector.segments();
                    if (randomBoolean()) {
                        IntVector.Builder builder = IntVector.newVectorBuilder(positionCount);
                        for (int i = 0; i < positionCount; i++) {