parquet_set_default_compression Subroutine

public subroutine parquet_set_default_compression(name)

Sets the compression codec parquet_open_writer uses when the caller passes no compression=. One of "uncompressed", "snappy", "gzip", "zstd", "brotli", "lz4" (case-insensitive); anything else aborts, using the same list the writer's own argument is checked against.

Captured at writer open: a writer already open keeps the codec it was opened with.

Setting this changes what the default compression LEVEL means. The library's own level 3 is tuned for its own default codec, so it applies only when neither the codec argument nor this setting has been touched. Choose a codec here and the level falls back to that codec's own default unless parquet_set_default_compression_level says otherwise -- which is what stops a zstd-tuned level being attached to, say, snappy.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

codec name, case-insensitive.


Source Code

    subroutine parquet_set_default_compression(name)
        character(len=*), intent(in) :: name !! codec name, case-insensitive.
        character(len=:), allocatable :: folded, expected
        integer :: i
        logical :: ok

        call fold_ascii_lower(trim(name), folded)
        ok = .false.
        do i = 1, size(parquet_valid_compressions)
            if (folded == trim(parquet_valid_compressions(i))) then
                ok = .true.
                exit
            end if
        end do
        if (.not. ok) then
            call token_list(parquet_valid_compressions, expected)
            error stop "parquet_set_default_compression: unknown compression codec '" // &
                folded // "' (expected one of: " // expected // ")"
        end if
        cfg_default_compression = folded
    end subroutine parquet_set_default_compression