public static Map<Integer, ColumnStatistics> createEmptyColumnStatistics(List<OrcType> orcTypes, int nodeIndex, ColumnWriterOptions columnWriterOptions)
    {
        requireNonNull(orcTypes, "orcTypes is null");
        checkArgument(nodeIndex >= 0, "Invalid nodeIndex value: %s", nodeIndex);

        ImmutableMap.Builder<Integer, ColumnStatistics> columnStatistics = ImmutableMap.builder();
        LinkedList<Integer> stack = new LinkedList<>();
        stack.add(nodeIndex);

        while (!stack.isEmpty()) {
            int node = stack.removeLast();
            OrcType orcType = orcTypes.get(node);
            stack.addAll(orcType.getFieldTypeIndexes());

            StatisticsBuilder statisticsBuilder = createStatisticsBuilderSupplier(orcType, columnWriterOptions).get();
            ColumnStatistics emptyStatistics = statisticsBuilder.buildColumnStatistics();
            columnStatistics.put(node, emptyStatistics);
        }

        return columnStatistics.build();
    }
@Test
    public void testCreateEmptyColumnStatistics()
    {
        ColumnWriterOptions columnWriterOptions = ColumnWriterOptions.builder().setCompressionKind(CompressionKind.ZSTD).build();
        Type rootType = rowType(// node index 0
                TINYINT, // 1
                mapType(TINYINT, SMALLINT), // 2-4,
                REAL, // 5
                mapType(INTEGER, arrayType(BIGINT)), // 6-9
                DOUBLE, // 10
                arrayType(VARCHAR), // 11-12
                TIMESTAMP, // 13
                rowType(VARBINARY, rowType(BOOLEAN))); // 14-17
        List<OrcType> orcTypes = OrcType.toOrcType(0, rootType);

        // all CountStatisticsBuilders would usually return ColumnStatistics when no values have been provided
        Map<Integer, ColumnStatistics> columnStatistics = createEmptyColumnStatistics(orcTypes, 0, columnWriterOptions);
        assertEquals(columnStatistics.size(), 18);
        for (int i = 0; i < 18; i++) {
            ColumnStatistics emptyColumnStatistics = columnStatistics.get(i);
            assertNotNull(emptyColumnStatistics);
            assertEquals(emptyColumnStatistics.getNumberOfValues(), 0);
        }
    }