public OrcWriterOptions.Builder toOrcWriterOptionsBuilder()
    {
        DefaultOrcWriterFlushPolicy flushPolicy = DefaultOrcWriterFlushPolicy.builder()
                .withStripeMinSize(stripeMinSize)
                .withStripeMaxSize(stripeMaxSize)
                .withStripeMaxRowCount(stripeMaxRowCount)
                .build();

        OptionalInt resolvedCompressionLevel = OptionalInt.empty();
        if (compressionLevel != DEFAULT_COMPRESSION_LEVEL) {
            resolvedCompressionLevel = OptionalInt.of(compressionLevel);
        }

        // Give separate copy to callers for isolation.
        return OrcWriterOptions.builder()
                .withFlushPolicy(flushPolicy)
                .withRowGroupMaxRowCount(rowGroupMaxRowCount)
                .withDictionaryMaxMemory(dictionaryMaxMemory)
                .withMaxStringStatisticsLimit(stringStatisticsLimit)
                .withMaxCompressionBufferSize(maxCompressionBufferSize)
                .withStreamLayoutFactory(getStreamLayoutFactory(streamLayoutType))
                .withDwrfStripeCacheEnabled(isDwrfStripeCacheEnabled)
                .withDwrfStripeCacheMaxSize(dwrfStripeCacheMaxSize)
                .withDwrfStripeCacheMode(dwrfStripeCacheMode)
                .withCompressionLevel(resolvedCompressionLevel);
    }
@Test
    public void testWithNoOptionsSet()
    {
        OrcFileWriterConfig config = new OrcFileWriterConfig();
        // should succeed.
        config.toOrcWriterOptionsBuilder().build();
    }