Class ParquetRsFunctions

java.lang.Object
org.elasticsearch.nativeaccess.ParquetRsFunctions

public final class ParquetRsFunctions extends Object
Public-facing Java API for Parquet operations backed by the Rust es_parquet_rs native library, accessed via Panama FFI.

All methods delegate to the low-level ParquetRsLibrary bindings and translate native error codes into IOException, including the native error message when available.

An optional JSON configuration string (configJson) can be supplied to configure access to remote object stores (S3, Azure, GCS). For local file paths, pass null.

  • Method Details

    • getStatistics

      public long[] getStatistics(String path, String configJson) throws IOException
      Reads file-level statistics from a Parquet file.

      Aggregates row counts and byte sizes across all row groups in the file.

      Parameters:
      path - the path to the Parquet file (local filesystem path or remote URI)
      configJson - optional JSON string containing storage configuration for remote object stores (e.g. S3 credentials, Azure connection info), or null for local files
      Returns:
      a two-element array: [totalRows, totalBytes]
      Throws:
      IOException - if the file cannot be opened, is not a valid Parquet file, or if configJson is malformed JSON
    • getSchemaFFI

      public void getSchemaFFI(String path, String configJson, long schemaAddr) throws IOException
      Exports the Parquet file's Arrow schema via the Arrow C Data Interface.

      The caller must allocate an ArrowSchema struct (e.g. via org.apache.arrow.c.ArrowSchema.allocateNew) and pass its memory address. On success the struct is populated with the schema exported from the Parquet file's metadata; ownership of any heap-allocated children is transferred to the caller.

      Parameters:
      path - the path to the Parquet file (local filesystem path or remote URI)
      configJson - optional JSON string containing storage configuration for remote object stores (e.g. S3 credentials, Azure connection info), or null for local files
      schemaAddr - the native memory address of a pre-allocated FFI_ArrowSchema struct where the exported schema will be written
      Throws:
      IOException - if the file cannot be opened, is not a valid Parquet file, or if configJson is malformed JSON