parquet_get_arrow_version Subroutine

public subroutine parquet_get_arrow_version(ver_string, mode)

Returns the version of the Arrow/Parquet C++ libraries this program is actually built against, formatted "major.minor.patch". mode absent or mode="arrow" reports the linked Arrow library's RUNTIME version -- what is loaded now, which need not be what the wrapper was compiled against; mode="parquet" reports the Parquet C++ library version the wrapper was COMPILED against. Any other mode value is an error.

This is the C++ half of version reporting and so lives here, beside the other "what is Arrow doing" queries, rather than in the Arrow-free parquet_version module. For the version of parquet-fortran itself, call parquet_get_version (use parquet_version, or use parquet). Quoting both is what makes a bug report actionable.

Arguments

Type IntentOptional Attributes Name
character(len=:), intent(out), allocatable :: ver_string

resulting version string.

character(len=*), intent(in), optional :: mode

"arrow" | "parquet"; absent = "arrow".


Source Code

    subroutine parquet_get_arrow_version(ver_string, mode)
        character(len=:), allocatable, intent(out) :: ver_string !! resulting version string.
        character(len=*), intent(in), optional :: mode
        !! "arrow" | "parquet"; absent = "arrow".
        integer(c_int) :: major, minor, patch
        character(len=32) :: buf
        character(len=:), allocatable :: preview
        character(len=:), allocatable :: which

        which = "arrow"
        if (present(mode)) which = mode
        select case (which)
        case ("arrow")
            call c_get_arrow_version(major, minor, patch)
        case ("parquet")
            call c_get_parquet_version(major, minor, patch)
        case default
            ! Capped preview, never the whole value -- `mode` is caller-supplied and unbounded, and
            ! ifx 2026.1.1's ERROR STOP runtime corrupts memory once the message reaches 8192 bytes.
            if (len(which) > 100) then
                preview = which(1:100) // "..."
            else
                preview = which
            end if
            error stop "parquet_get_arrow_version: invalid mode '" // preview // &
                "' (must be 'arrow' or 'parquet')"
        end select
        write(buf, '(i0,".",i0,".",i0)') major, minor, patch
        ver_string = trim(buf)
    end subroutine parquet_get_arrow_version