parquet_reader Derived Type

type, public :: parquet_reader

Opaque handle for an open parquet file being read; see parquet_writer's doc comment above for the shared handle-ownership/no-copy rules.


Finalization Procedures

final :: reader_finalize

Safety-net close if the reader is still open when it goes out of scope.

  • private subroutine reader_finalize(this)

    FINAL procedure: safety-net close for a reader whose variable goes out of scope (or is overwritten) still open; see parquet_writer's doc comment for why this is not a substitute for %close.

    Arguments

    Type IntentOptional Attributes Name
    type(parquet_reader), intent(inout) :: this

    reader being finalized.


Source Code

    type parquet_reader
        private
        type(c_ptr) :: handle = c_null_ptr !! Opaque C++ Arrow/Parquet reader handle; c_null_ptr until opened.
        !> Set by parquet_open_reader from its own `filename` argument, solely
        !> so parquet_get_nrows(..., check_positive=.true.) can name the file
        !> in its error message; not used for anything else.
        character(len=:), allocatable :: filename
        !> Flat key-value table metadata (whatever add_metadata wrote on the
        !> write side), copied once by parquet_open_reader from the underlying
        !> Arrow schema's KeyValueMetadata -- see parquet_reader_get_table_metadata_count
        !> and friends in parquet_bindings.f90. Every parquet_get_metadata call
        !> only scans this in-memory copy; it never re-reads the file. %description
        !> is never populated on this side (Arrow's flat KV store has no
        !> description field), only %key/%value.
        type(parquet_table_metadata) :: metadata
    contains
        final :: reader_finalize !! Safety-net close if the reader is still open when it goes out of scope.
    end type parquet_reader