Package org.elasticsearch.nativeaccess
Class ParquetRsFunctions
java.lang.Object
org.elasticsearch.nativeaccess.ParquetRsFunctions
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 Summary
Modifier and TypeMethodDescriptionvoidgetSchemaFFI(String path, String configJson, long schemaAddr) Exports the Parquet file's Arrow schema via the Arrow C Data Interface.long[]getStatistics(String path, String configJson) Reads file-level statistics from a Parquet file.
-
Method Details
-
getStatistics
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), ornullfor local files- Returns:
- a two-element array:
[totalRows, totalBytes] - Throws:
IOException- if the file cannot be opened, is not a valid Parquet file, or ifconfigJsonis malformed JSON
-
getSchemaFFI
Exports the Parquet file's Arrow schema via the Arrow C Data Interface.The caller must allocate an
ArrowSchemastruct (e.g. viaorg.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), ornullfor local filesschemaAddr- the native memory address of a pre-allocatedFFI_ArrowSchemastruct where the exported schema will be written- Throws:
IOException- if the file cannot be opened, is not a valid Parquet file, or ifconfigJsonis malformed JSON
-