You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by et...@apache.org on 2025/09/29 22:09:40 UTC

(arrow-rs) branch gh5854_thrift_remodel updated (1365ec2b6a -> b4b4d261ca)

This is an automated email from the ASF dual-hosted git repository.

etseidl pushed a change to branch gh5854_thrift_remodel
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git


    from 1365ec2b6a Merge remote-tracking branch 'origin/main' into gh5854_thrift_remodel
     add b6bea12b68 Add Parquet geospatial statistics utility (#8414)
     add 4ba9a2509c [geo] add geospatial statistics and bbox types for parquet (#8225)
     add 0737c61e76 Add examples of using `Field::try_extension_type` (#8475)
     add 17ce47cc4c Implement AsRef for Schema and Field (#8417)
     add 234cc15108 Support parquet canonical extension type roundtrip (#8409)
     add 3cdafafcad [json] Optimize primitive numbers to string (50%-250% faster) (#7819)
     add 1c81321dfe Migrate `arrow-pyarrow-testing` to Rust 2024 (#8487)
     add dfbb9f10f7 Migrate `arrow-ord` to Rust 2024 (#8484)
     add fedef666ee Migrate `arrow-pyarrow` to Rust 2024 (#8485)
     add 447bf3e30d Adds Duration(TimeUnit) support to arrow-avro reader and writer (#8433)
     add d1038bfcf3 Migrate `arrow-pyarrow-integration-testing` to Rust 2024 (#8486)
     add 04cd6cf0ed Migrate `arrow-data` to Rust 2024 (#8455)
     add e799557521 Migrate `arrow-select` to Rust 2024 (#8490)
     add e5e4db9820 Migrate `arrow-array` to Rust 2024 (#8450)
     add 28cf02db55 Migrate `arrow-buffer` to Rust 2024 (#8452)
     add 9cb6bec3e4 Migrate `arrow-row` to Rust 2024 (#8488)
     add 027e9e5a6d Migrate `arrow-string` to Rust 2024 (#8491)
     add 422da15fa5 [Variant] Add a VariantBuilderExt impl for VariantValueArrayBuilder (#8501)
     add 883380b68c Migrate `arrow-schema` to Rust 2024 (#8489)
     new b4b4d261ca Merge remote-tracking branch 'origin/main' into gh5854_thrift_remodel

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 arrow-array/Cargo.toml                             |    2 +-
 arrow-array/benches/fixed_size_list_array.rs       |    2 +-
 arrow-array/benches/occupancy.rs                   |    2 +-
 arrow-array/benches/union_array.rs                 |    2 +-
 arrow-array/src/arithmetic.rs                      |    6 +-
 arrow-array/src/array/binary_array.rs              |    2 +-
 arrow-array/src/array/boolean_array.rs             |   10 +-
 arrow-array/src/array/byte_array.rs                |   39 +-
 arrow-array/src/array/byte_view_array.rs           |   33 +-
 arrow-array/src/array/dictionary_array.rs          |   10 +-
 arrow-array/src/array/fixed_size_binary_array.rs   |   19 +-
 arrow-array/src/array/fixed_size_list_array.rs     |   27 +-
 arrow-array/src/array/list_array.rs                |   10 +-
 arrow-array/src/array/list_view_array.rs           |   17 +-
 arrow-array/src/array/map_array.rs                 |    6 +-
 arrow-array/src/array/mod.rs                       |    4 +-
 arrow-array/src/array/null_array.rs                |    2 +-
 arrow-array/src/array/primitive_array.rs           |   38 +-
 arrow-array/src/array/run_array.rs                 |   10 +-
 arrow-array/src/array/string_array.rs              |    4 +-
 arrow-array/src/array/struct_array.rs              |    7 +-
 arrow-array/src/array/union_array.rs               |    8 +-
 arrow-array/src/builder/buffer_builder.rs          |    2 +-
 .../fixed_size_binary_dictionary_builder.rs        |   12 +-
 arrow-array/src/builder/fixed_size_list_builder.rs |    8 +-
 .../src/builder/generic_byte_run_builder.rs        |    6 +-
 arrow-array/src/builder/generic_bytes_builder.rs   |    2 +-
 .../builder/generic_bytes_dictionary_builder.rs    |    2 +-
 .../src/builder/generic_bytes_view_builder.rs      |   25 +-
 arrow-array/src/builder/generic_list_builder.rs    |    4 +-
 .../src/builder/generic_list_view_builder.rs       |    2 +-
 arrow-array/src/builder/map_builder.rs             |    2 +-
 arrow-array/src/builder/mod.rs                     |    2 +-
 .../src/builder/primitive_dictionary_builder.rs    |    8 +-
 arrow-array/src/builder/primitive_run_builder.rs   |    2 +-
 arrow-array/src/builder/struct_builder.rs          |   14 +-
 arrow-array/src/builder/union_builder.rs           |    4 +-
 arrow-array/src/ffi.rs                             |   66 +-
 arrow-array/src/ffi_stream.rs                      |   10 +-
 arrow-array/src/record_batch.rs                    |   24 +-
 arrow-array/src/run_iterator.rs                    |    6 +-
 arrow-array/src/temporal_conversions.rs            |    8 +-
 arrow-array/src/trusted_len.rs                     |   14 +-
 arrow-array/src/types.rs                           |   20 +-
 arrow-avro/Cargo.toml                              |    1 +
 arrow-avro/src/codec.rs                            |   40 +
 arrow-avro/src/lib.rs                              |    7 +
 arrow-avro/src/reader/mod.rs                       |  109 +-
 arrow-avro/src/reader/record.rs                    |  148 +++
 arrow-avro/src/schema.rs                           |   39 +-
 arrow-avro/src/writer/encoder.rs                   |   78 +-
 arrow-avro/src/writer/mod.rs                       |   70 +-
 arrow-avro/test/data/README.md                     |   72 ++
 arrow-avro/test/data/duration_logical_types.avro   |  Bin 0 -> 556 bytes
 arrow-buffer/Cargo.toml                            |    2 +-
 arrow-buffer/benches/bit_mask.rs                   |    2 +-
 arrow-buffer/src/bigint/mod.rs                     |   10 +-
 arrow-buffer/src/buffer/boolean.rs                 |    4 +-
 arrow-buffer/src/buffer/immutable.rs               |   10 +-
 arrow-buffer/src/buffer/mutable.rs                 |   34 +-
 arrow-buffer/src/buffer/run.rs                     |    2 +-
 arrow-buffer/src/buffer/scalar.rs                  |    6 +-
 arrow-buffer/src/builder/boolean.rs                |    2 +-
 arrow-buffer/src/native.rs                         |    2 +-
 arrow-buffer/src/pool.rs                           |    2 +-
 arrow-buffer/src/util/bit_mask.rs                  |   16 +-
 arrow-buffer/src/util/bit_util.rs                  |   10 +-
 arrow-data/Cargo.toml                              |    2 +-
 arrow-data/src/data.rs                             |   55 +-
 arrow-data/src/decimal.rs                          |    4 +-
 arrow-data/src/equal/boolean.rs                    |    2 +-
 arrow-data/src/equal/dictionary.rs                 |    2 +-
 arrow-data/src/equal/fixed_list.rs                 |    2 +-
 arrow-data/src/equal/list.rs                       |    2 +-
 arrow-data/src/equal/structure.rs                  |    2 +-
 arrow-data/src/equal/utils.rs                      |    2 +-
 arrow-data/src/equal/variable_size.rs              |    2 +-
 arrow-data/src/ffi.rs                              |   12 +-
 arrow-data/src/transform/boolean.rs                |    4 +-
 arrow-data/src/transform/fixed_binary.rs           |    2 +-
 arrow-data/src/transform/fixed_size_list.rs        |    2 +-
 arrow-data/src/transform/list.rs                   |    2 +-
 arrow-data/src/transform/mod.rs                    |    4 +-
 arrow-data/src/transform/null.rs                   |    2 +-
 arrow-data/src/transform/primitive.rs              |    2 +-
 arrow-data/src/transform/run.rs                    |    2 +-
 arrow-data/src/transform/structure.rs              |    2 +-
 arrow-data/src/transform/union.rs                  |    2 +-
 arrow-data/src/transform/utils.rs                  |    6 +-
 arrow-data/src/transform/variable_size.rs          |    2 +-
 arrow-json/Cargo.toml                              |    2 +
 arrow-json/src/reader/string_array.rs              |   14 +-
 arrow-ord/Cargo.toml                               |    2 +-
 arrow-ord/src/cmp.rs                               |   12 +-
 arrow-ord/src/comparison.rs                        |    4 +-
 arrow-ord/src/ord.rs                               |    2 +-
 arrow-ord/src/rank.rs                              |    2 +-
 arrow-ord/src/sort.rs                              |   16 +-
 arrow-pyarrow-integration-testing/Cargo.toml       |    2 +-
 arrow-pyarrow-integration-testing/src/lib.rs       |    2 +-
 arrow-pyarrow-testing/Cargo.toml                   |    2 +-
 arrow-pyarrow-testing/src/lib.rs                   |    2 +-
 arrow-pyarrow/Cargo.toml                           |    2 +-
 arrow-pyarrow/src/lib.rs                           |    4 +-
 arrow-row/Cargo.toml                               |    3 +-
 arrow-row/src/fixed.rs                             |    6 +-
 arrow-row/src/lib.rs                               |   65 +-
 arrow-row/src/list.rs                              |   16 +-
 arrow-row/src/run.rs                               |    8 +-
 arrow-row/src/variable.rs                          |    6 +-
 arrow-schema/Cargo.toml                            |    2 +-
 arrow-schema/src/datatype_parse.rs                 |   89 +-
 arrow-schema/src/extension/canonical/bool8.rs      |    4 +-
 .../src/extension/canonical/fixed_shape_tensor.rs  |    4 +-
 arrow-schema/src/extension/canonical/json.rs       |    4 +-
 arrow-schema/src/extension/canonical/mod.rs        |   16 +-
 arrow-schema/src/extension/canonical/opaque.rs     |    4 +-
 arrow-schema/src/extension/canonical/uuid.rs       |    4 +-
 .../extension/canonical/variable_shape_tensor.rs   |   23 +-
 arrow-schema/src/ffi.rs                            |  145 +--
 arrow-schema/src/field.rs                          |  155 ++-
 arrow-schema/src/fields.rs                         |   10 +-
 arrow-schema/src/schema.rs                         |   43 +-
 arrow-select/Cargo.toml                            |    2 +-
 arrow-select/src/coalesce.rs                       |   14 +-
 arrow-select/src/concat.rs                         |   52 +-
 arrow-select/src/dictionary.rs                     |   10 +-
 arrow-select/src/filter.rs                         |    4 +-
 arrow-select/src/interleave.rs                     |    4 +-
 arrow-select/src/nullif.rs                         |    4 +-
 arrow-select/src/take.rs                           |    4 +-
 arrow-select/src/union_extract.rs                  |   10 +-
 arrow-select/src/window.rs                         |    2 +-
 arrow-string/Cargo.toml                            |    2 +-
 arrow-string/src/length.rs                         |   12 +-
 arrow-string/src/like.rs                           |   36 +-
 arrow-string/src/substring.rs                      |    6 +-
 parquet-geospatial/Cargo.toml                      |    6 +
 parquet-geospatial/src/bounding.rs                 |  602 +++++++++++
 parquet-geospatial/src/interval.rs                 | 1080 ++++++++++++++++++++
 parquet-geospatial/src/lib.rs                      |    3 +
 parquet-variant-compute/src/shred_variant.rs       |    9 +-
 .../src/variant_array_builder.rs                   |   81 +-
 parquet/benches/metadata.rs                        |    2 -
 parquet/src/arrow/schema/complex.rs                |   16 +-
 parquet/src/arrow/schema/extension.rs              |   89 +-
 parquet/src/arrow/schema/mod.rs                    |  118 +--
 parquet/src/arrow/schema/primitive.rs              |    2 +
 parquet/src/basic.rs                               |    5 +
 parquet/src/file/metadata/mod.rs                   |   30 +-
 parquet/src/file/metadata/thrift_gen.rs            |  139 ++-
 parquet/src/geospatial/bounding_box.rs             |  233 +++++
 parquet/src/geospatial/mod.rs                      |   50 +
 parquet/src/geospatial/statistics.rs               |  145 +++
 parquet/src/lib.rs                                 |    2 +-
 parquet/src/parquet_thrift.rs                      |   21 +
 parquet/src/schema/types.rs                        |    2 +
 parquet/src/variant.rs                             |    4 +-
 158 files changed, 3989 insertions(+), 775 deletions(-)
 create mode 100644 arrow-avro/test/data/duration_logical_types.avro
 create mode 100644 parquet-geospatial/src/bounding.rs
 create mode 100644 parquet-geospatial/src/interval.rs
 create mode 100644 parquet/src/geospatial/bounding_box.rs
 create mode 100644 parquet/src/geospatial/mod.rs
 create mode 100644 parquet/src/geospatial/statistics.rs


(arrow-rs) 01/01: Merge remote-tracking branch 'origin/main' into gh5854_thrift_remodel

Posted by et...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

etseidl pushed a commit to branch gh5854_thrift_remodel
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git

commit b4b4d261cad97fa37630756ff22cdce73cd25db4
Merge: 1365ec2b6a 883380b68c
Author: Ed Seidl <et...@live.com>
AuthorDate: Mon Sep 29 15:09:27 2025 -0700

    Merge remote-tracking branch 'origin/main' into gh5854_thrift_remodel

 arrow-array/Cargo.toml                             |    2 +-
 arrow-array/benches/fixed_size_list_array.rs       |    2 +-
 arrow-array/benches/occupancy.rs                   |    2 +-
 arrow-array/benches/union_array.rs                 |    2 +-
 arrow-array/src/arithmetic.rs                      |    6 +-
 arrow-array/src/array/binary_array.rs              |    2 +-
 arrow-array/src/array/boolean_array.rs             |   10 +-
 arrow-array/src/array/byte_array.rs                |   39 +-
 arrow-array/src/array/byte_view_array.rs           |   33 +-
 arrow-array/src/array/dictionary_array.rs          |   10 +-
 arrow-array/src/array/fixed_size_binary_array.rs   |   19 +-
 arrow-array/src/array/fixed_size_list_array.rs     |   27 +-
 arrow-array/src/array/list_array.rs                |   10 +-
 arrow-array/src/array/list_view_array.rs           |   17 +-
 arrow-array/src/array/map_array.rs                 |    6 +-
 arrow-array/src/array/mod.rs                       |    4 +-
 arrow-array/src/array/null_array.rs                |    2 +-
 arrow-array/src/array/primitive_array.rs           |   38 +-
 arrow-array/src/array/run_array.rs                 |   10 +-
 arrow-array/src/array/string_array.rs              |    4 +-
 arrow-array/src/array/struct_array.rs              |    7 +-
 arrow-array/src/array/union_array.rs               |    8 +-
 arrow-array/src/builder/buffer_builder.rs          |    2 +-
 .../fixed_size_binary_dictionary_builder.rs        |   12 +-
 arrow-array/src/builder/fixed_size_list_builder.rs |    8 +-
 .../src/builder/generic_byte_run_builder.rs        |    6 +-
 arrow-array/src/builder/generic_bytes_builder.rs   |    2 +-
 .../builder/generic_bytes_dictionary_builder.rs    |    2 +-
 .../src/builder/generic_bytes_view_builder.rs      |   25 +-
 arrow-array/src/builder/generic_list_builder.rs    |    4 +-
 .../src/builder/generic_list_view_builder.rs       |    2 +-
 arrow-array/src/builder/map_builder.rs             |    2 +-
 arrow-array/src/builder/mod.rs                     |    2 +-
 .../src/builder/primitive_dictionary_builder.rs    |    8 +-
 arrow-array/src/builder/primitive_run_builder.rs   |    2 +-
 arrow-array/src/builder/struct_builder.rs          |   14 +-
 arrow-array/src/builder/union_builder.rs           |    4 +-
 arrow-array/src/ffi.rs                             |   66 +-
 arrow-array/src/ffi_stream.rs                      |   10 +-
 arrow-array/src/record_batch.rs                    |   24 +-
 arrow-array/src/run_iterator.rs                    |    6 +-
 arrow-array/src/temporal_conversions.rs            |    8 +-
 arrow-array/src/trusted_len.rs                     |   14 +-
 arrow-array/src/types.rs                           |   20 +-
 arrow-avro/Cargo.toml                              |    1 +
 arrow-avro/src/codec.rs                            |   40 +
 arrow-avro/src/lib.rs                              |    7 +
 arrow-avro/src/reader/mod.rs                       |  109 +-
 arrow-avro/src/reader/record.rs                    |  148 +++
 arrow-avro/src/schema.rs                           |   39 +-
 arrow-avro/src/writer/encoder.rs                   |   78 +-
 arrow-avro/src/writer/mod.rs                       |   70 +-
 arrow-avro/test/data/README.md                     |   72 ++
 arrow-avro/test/data/duration_logical_types.avro   |  Bin 0 -> 556 bytes
 arrow-buffer/Cargo.toml                            |    2 +-
 arrow-buffer/benches/bit_mask.rs                   |    2 +-
 arrow-buffer/src/bigint/mod.rs                     |   10 +-
 arrow-buffer/src/buffer/boolean.rs                 |    4 +-
 arrow-buffer/src/buffer/immutable.rs               |   10 +-
 arrow-buffer/src/buffer/mutable.rs                 |   34 +-
 arrow-buffer/src/buffer/run.rs                     |    2 +-
 arrow-buffer/src/buffer/scalar.rs                  |    6 +-
 arrow-buffer/src/builder/boolean.rs                |    2 +-
 arrow-buffer/src/native.rs                         |    2 +-
 arrow-buffer/src/pool.rs                           |    2 +-
 arrow-buffer/src/util/bit_mask.rs                  |   16 +-
 arrow-buffer/src/util/bit_util.rs                  |   10 +-
 arrow-data/Cargo.toml                              |    2 +-
 arrow-data/src/data.rs                             |   55 +-
 arrow-data/src/decimal.rs                          |    4 +-
 arrow-data/src/equal/boolean.rs                    |    2 +-
 arrow-data/src/equal/dictionary.rs                 |    2 +-
 arrow-data/src/equal/fixed_list.rs                 |    2 +-
 arrow-data/src/equal/list.rs                       |    2 +-
 arrow-data/src/equal/structure.rs                  |    2 +-
 arrow-data/src/equal/utils.rs                      |    2 +-
 arrow-data/src/equal/variable_size.rs              |    2 +-
 arrow-data/src/ffi.rs                              |   12 +-
 arrow-data/src/transform/boolean.rs                |    4 +-
 arrow-data/src/transform/fixed_binary.rs           |    2 +-
 arrow-data/src/transform/fixed_size_list.rs        |    2 +-
 arrow-data/src/transform/list.rs                   |    2 +-
 arrow-data/src/transform/mod.rs                    |    4 +-
 arrow-data/src/transform/null.rs                   |    2 +-
 arrow-data/src/transform/primitive.rs              |    2 +-
 arrow-data/src/transform/run.rs                    |    2 +-
 arrow-data/src/transform/structure.rs              |    2 +-
 arrow-data/src/transform/union.rs                  |    2 +-
 arrow-data/src/transform/utils.rs                  |    6 +-
 arrow-data/src/transform/variable_size.rs          |    2 +-
 arrow-json/Cargo.toml                              |    2 +
 arrow-json/src/reader/string_array.rs              |   14 +-
 arrow-ord/Cargo.toml                               |    2 +-
 arrow-ord/src/cmp.rs                               |   12 +-
 arrow-ord/src/comparison.rs                        |    4 +-
 arrow-ord/src/ord.rs                               |    2 +-
 arrow-ord/src/rank.rs                              |    2 +-
 arrow-ord/src/sort.rs                              |   16 +-
 arrow-pyarrow-integration-testing/Cargo.toml       |    2 +-
 arrow-pyarrow-integration-testing/src/lib.rs       |    2 +-
 arrow-pyarrow-testing/Cargo.toml                   |    2 +-
 arrow-pyarrow-testing/src/lib.rs                   |    2 +-
 arrow-pyarrow/Cargo.toml                           |    2 +-
 arrow-pyarrow/src/lib.rs                           |    4 +-
 arrow-row/Cargo.toml                               |    3 +-
 arrow-row/src/fixed.rs                             |    6 +-
 arrow-row/src/lib.rs                               |   65 +-
 arrow-row/src/list.rs                              |   16 +-
 arrow-row/src/run.rs                               |    8 +-
 arrow-row/src/variable.rs                          |    6 +-
 arrow-schema/Cargo.toml                            |    2 +-
 arrow-schema/src/datatype_parse.rs                 |   89 +-
 arrow-schema/src/extension/canonical/bool8.rs      |    4 +-
 .../src/extension/canonical/fixed_shape_tensor.rs  |    4 +-
 arrow-schema/src/extension/canonical/json.rs       |    4 +-
 arrow-schema/src/extension/canonical/mod.rs        |   16 +-
 arrow-schema/src/extension/canonical/opaque.rs     |    4 +-
 arrow-schema/src/extension/canonical/uuid.rs       |    4 +-
 .../extension/canonical/variable_shape_tensor.rs   |   23 +-
 arrow-schema/src/ffi.rs                            |  145 +--
 arrow-schema/src/field.rs                          |  155 ++-
 arrow-schema/src/fields.rs                         |   10 +-
 arrow-schema/src/schema.rs                         |   43 +-
 arrow-select/Cargo.toml                            |    2 +-
 arrow-select/src/coalesce.rs                       |   14 +-
 arrow-select/src/concat.rs                         |   52 +-
 arrow-select/src/dictionary.rs                     |   10 +-
 arrow-select/src/filter.rs                         |    4 +-
 arrow-select/src/interleave.rs                     |    4 +-
 arrow-select/src/nullif.rs                         |    4 +-
 arrow-select/src/take.rs                           |    4 +-
 arrow-select/src/union_extract.rs                  |   10 +-
 arrow-select/src/window.rs                         |    2 +-
 arrow-string/Cargo.toml                            |    2 +-
 arrow-string/src/length.rs                         |   12 +-
 arrow-string/src/like.rs                           |   36 +-
 arrow-string/src/substring.rs                      |    6 +-
 parquet-geospatial/Cargo.toml                      |    6 +
 parquet-geospatial/src/bounding.rs                 |  602 +++++++++++
 parquet-geospatial/src/interval.rs                 | 1080 ++++++++++++++++++++
 parquet-geospatial/src/lib.rs                      |    3 +
 parquet-variant-compute/src/shred_variant.rs       |    9 +-
 .../src/variant_array_builder.rs                   |   81 +-
 parquet/benches/metadata.rs                        |    2 -
 parquet/src/arrow/schema/complex.rs                |   16 +-
 parquet/src/arrow/schema/extension.rs              |   89 +-
 parquet/src/arrow/schema/mod.rs                    |  118 +--
 parquet/src/arrow/schema/primitive.rs              |    2 +
 parquet/src/basic.rs                               |    5 +
 parquet/src/file/metadata/mod.rs                   |   30 +-
 parquet/src/file/metadata/thrift_gen.rs            |  139 ++-
 parquet/src/geospatial/bounding_box.rs             |  233 +++++
 parquet/src/geospatial/mod.rs                      |   50 +
 parquet/src/geospatial/statistics.rs               |  145 +++
 parquet/src/lib.rs                                 |    2 +-
 parquet/src/parquet_thrift.rs                      |   21 +
 parquet/src/schema/types.rs                        |    2 +
 parquet/src/variant.rs                             |    4 +-
 158 files changed, 3989 insertions(+), 775 deletions(-)

diff --cc parquet/src/arrow/schema/extension.rs
index 752b9a5ced,c6d04328ac..b4ccac773e
--- a/parquet/src/arrow/schema/extension.rs
+++ b/parquet/src/arrow/schema/extension.rs
@@@ -34,19 -35,47 +35,47 @@@ use arrow_schema::Field
  /// Some Parquet logical types, such as Variant, do not map directly to an
  /// Arrow DataType, and instead are represented by an Arrow ExtensionType.
  /// Extension types are attached to Arrow Fields via metadata.
- pub(crate) fn add_extension_type(mut arrow_field: Field, parquet_type: &Type) -> Field {
-     match parquet_type.get_basic_info().logical_type() {
+ pub(crate) fn try_add_extension_type(
+     mut arrow_field: Field,
+     parquet_type: &Type,
+ ) -> Result<Field, ParquetError> {
+     let Some(parquet_logical_type) = parquet_type.get_basic_info().logical_type() else {
+         return Ok(arrow_field);
+     };
+     match parquet_logical_type {
          #[cfg(feature = "variant_experimental")]
-         Some(LogicalType::Variant) => {
-             // try to add the Variant extension type, but if that fails (e.g. because the
-             // storage type is not supported), just return the field as is
-             arrow_field
-                 .try_with_extension_type(parquet_variant_compute::VariantType)
-                 .ok();
-             arrow_field
 -        LogicalType::Variant => {
++        LogicalType::Variant { .. } => {
+             arrow_field.try_with_extension_type(parquet_variant_compute::VariantType)?;
          }
-         // TODO add other LogicalTypes here
-         _ => arrow_field,
+         #[cfg(feature = "arrow_canonical_extension_types")]
+         LogicalType::Uuid => {
+             arrow_field.try_with_extension_type(arrow_schema::extension::Uuid)?;
+         }
+         #[cfg(feature = "arrow_canonical_extension_types")]
+         LogicalType::Json => {
+             arrow_field.try_with_extension_type(arrow_schema::extension::Json::default())?;
+         }
+         _ => {}
+     };
+     Ok(arrow_field)
+ }
+ 
+ /// Returns true if [`try_add_extension_type`] would add an extension type
+ /// to the specified Parquet field.
+ ///
+ /// This is used to preallocate the metadata hashmap size
+ pub(crate) fn has_extension_type(parquet_type: &Type) -> bool {
+     let Some(parquet_logical_type) = parquet_type.get_basic_info().logical_type() else {
+         return false;
+     };
+     match parquet_logical_type {
+         #[cfg(feature = "variant_experimental")]
 -        LogicalType::Variant => true,
++        LogicalType::Variant { .. } => true,
+         #[cfg(feature = "arrow_canonical_extension_types")]
+         LogicalType::Uuid => true,
+         #[cfg(feature = "arrow_canonical_extension_types")]
+         LogicalType::Json => true,
+         _ => false,
      }
  }
  
@@@ -60,7 -89,7 +89,7 @@@ pub(crate) fn logical_type_for_struct(f
          return None;
      }
      match field.try_extension_type::<VariantType>() {
--        Ok(VariantType) => Some(LogicalType::Variant),
++        Ok(VariantType) => Some(LogicalType::Variant { specification_version: None }),
          // Given check above, this should not error, but if it does ignore
          Err(_e) => None,
      }
diff --cc parquet/src/arrow/schema/primitive.rs
index 0992a05cd2,24b18b39bc..fb1b83d9fc
--- a/parquet/src/arrow/schema/primitive.rs
+++ b/parquet/src/arrow/schema/primitive.rs
@@@ -276,6 -276,8 +276,8 @@@ fn from_byte_array(info: &BasicTypeInfo
          (Some(LogicalType::Json), _) => Ok(DataType::Utf8),
          (Some(LogicalType::Bson), _) => Ok(DataType::Binary),
          (Some(LogicalType::Enum), _) => Ok(DataType::Binary),
 -        (Some(LogicalType::Geometry), _) => Ok(DataType::Binary),
 -        (Some(LogicalType::Geography), _) => Ok(DataType::Binary),
++        (Some(LogicalType::Geometry { .. }), _) => Ok(DataType::Binary),
++        (Some(LogicalType::Geography { .. }), _) => Ok(DataType::Binary),
          (None, ConvertedType::NONE) => Ok(DataType::Binary),
          (None, ConvertedType::JSON) => Ok(DataType::Utf8),
          (None, ConvertedType::BSON) => Ok(DataType::Binary),
diff --cc parquet/src/basic.rs
index e0cb57b51b,6353b5f4ee..f9150a7e86
--- a/parquet/src/basic.rs
+++ b/parquet/src/basic.rs
@@@ -1566,6 -1201,8 +1566,11 @@@ impl str::FromStr for LogicalType 
                  "Interval parquet logical type not yet supported"
              )),
              "FLOAT16" => Ok(LogicalType::Float16),
 -            "GEOMETRY" => Ok(LogicalType::Geometry),
 -            "GEOGRAPHY" => Ok(LogicalType::Geography),
++            "GEOMETRY" => Ok(LogicalType::Geometry { crs: None }),
++            "GEOGRAPHY" => Ok(LogicalType::Geography {
++                crs: None,
++                algorithm: None,
++            }),
              other => Err(general_err!("Invalid parquet logical type {}", other)),
          }
      }
diff --cc parquet/src/file/metadata/mod.rs
index 22c2f8fb44,4aa0388fd2..2257b8fdf2
--- a/parquet/src/file/metadata/mod.rs
+++ b/parquet/src/file/metadata/mod.rs
@@@ -103,13 -107,16 +103,14 @@@ use crate::encryption::decrypt::FileDec
  #[cfg(feature = "encryption")]
  use crate::file::column_crypto_metadata::{self, ColumnCryptoMetaData};
  pub(crate) use crate::file::metadata::memory::HeapSize;
 -use crate::file::page_encoding_stats::{self, PageEncodingStats};
 -use crate::file::page_index::index::Index;
 -use crate::file::page_index::offset_index::OffsetIndexMetaData;
 +use crate::file::page_index::column_index::{ByteArrayColumnIndex, PrimitiveColumnIndex};
  use crate::file::statistics::{self, Statistics};
 -use crate::format::ColumnCryptoMetaData as TColumnCryptoMetaData;
 -use crate::format::{
 -    BoundaryOrder, ColumnChunk, ColumnIndex, ColumnMetaData, OffsetIndex, PageLocation, RowGroup,
 -    SizeStatistics, SortingColumn,
 +use crate::file::{
 +    page_encoding_stats::{self, PageEncodingStats},
 +    page_index::{column_index::ColumnIndexMetaData, offset_index::PageLocation},
  };
 +use crate::format::ColumnCryptoMetaData as TColumnCryptoMetaData;
+ use crate::geospatial::statistics as geo_statistics;
  use crate::schema::types::{
      ColumnDescPtr, ColumnDescriptor, ColumnPath, SchemaDescPtr, SchemaDescriptor,
      Type as SchemaType,
@@@ -1170,6 -1176,8 +1178,8 @@@ impl ColumnChunkMetaData 
          let index_page_offset = col_metadata.index_page_offset;
          let dictionary_page_offset = col_metadata.dictionary_page_offset;
          let statistics = statistics::from_thrift(column_type, col_metadata.statistics)?;
 -        let geo_statistics =
 -            geo_statistics::from_thrift(col_metadata.geospatial_statistics).map(Box::new);
++        //let geo_statistics =
++        //    geo_statistics::from_thrift(col_metadata.geospatial_statistics).map(Box::new);
          let encoding_stats = col_metadata
              .encoding_stats
              .as_ref()
@@@ -1232,10 -1240,9 +1242,11 @@@
              unencoded_byte_array_data_bytes,
              repetition_level_histogram,
              definition_level_histogram,
 -            geo_statistics,
++            geo_statistics: None,
              #[cfg(feature = "encryption")]
              column_crypto_metadata,
 +            #[cfg(feature = "encryption")]
 +            encrypted_column_metadata: None,
          };
          Ok(result)
      }
@@@ -2071,9 -1992,9 +2091,9 @@@ mod tests 
              .build();
  
          #[cfg(not(feature = "encryption"))]
-         let base_expected_size = 2280;
 -        let base_expected_size = 2344;
++        let base_expected_size = 2312;
          #[cfg(feature = "encryption")]
-         let base_expected_size = 2712;
 -        let base_expected_size = 2680;
++        let base_expected_size = 2744;
  
          assert_eq!(parquet_meta.memory_size(), base_expected_size);
  
@@@ -2111,9 -2022,9 +2131,9 @@@
              .build();
  
          #[cfg(not(feature = "encryption"))]
-         let bigger_expected_size = 2704;
 -        let bigger_expected_size = 2848;
++        let bigger_expected_size = 2736;
          #[cfg(feature = "encryption")]
-         let bigger_expected_size = 3136;
 -        let bigger_expected_size = 3184;
++        let bigger_expected_size = 3168;
  
          // more set fields means more memory usage
          assert!(bigger_expected_size > base_expected_size);
diff --cc parquet/src/file/metadata/thrift_gen.rs
index 5665ad2ce9,0000000000..062a903c79
mode 100644,000000..100644
--- a/parquet/src/file/metadata/thrift_gen.rs
+++ b/parquet/src/file/metadata/thrift_gen.rs
@@@ -1,1532 -1,0 +1,1653 @@@
 +// Licensed to the Apache Software Foundation (ASF) under one
 +// or more contributor license agreements.  See the NOTICE file
 +// distributed with this work for additional information
 +// regarding copyright ownership.  The ASF licenses this file
 +// to you under the Apache License, Version 2.0 (the
 +// "License"); you may not use this file except in compliance
 +// with the License.  You may obtain a copy of the License at
 +//
 +//   http://www.apache.org/licenses/LICENSE-2.0
 +//
 +// Unless required by applicable law or agreed to in writing,
 +// software distributed under the License is distributed on an
 +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 +// KIND, either express or implied.  See the License for the
 +// specific language governing permissions and limitations
 +// under the License.
 +
 +// a collection of generated structs used to parse thrift metadata
 +
 +use std::io::Write;
 +use std::sync::Arc;
 +
 +use crate::{
 +    basic::{
 +        ColumnOrder, Compression, ConvertedType, Encoding, LogicalType, PageType, Repetition, Type,
 +    },
 +    data_type::{ByteArray, FixedLenByteArray, Int96},
 +    errors::{ParquetError, Result},
 +    file::{
 +        metadata::{
 +            ColumnChunkMetaData, KeyValue, LevelHistogram, ParquetMetaData, RowGroupMetaData,
 +            SortingColumn,
 +        },
 +        page_encoding_stats::PageEncodingStats,
 +        statistics::ValueStatistics,
 +    },
 +    parquet_thrift::{
 +        read_thrift_vec, ElementType, FieldType, ReadThrift, ThriftCompactInputProtocol,
 +        ThriftCompactOutputProtocol, WriteThrift, WriteThriftField,
 +    },
 +    schema::types::{
 +        num_nodes, parquet_schema_from_array, ColumnDescriptor, SchemaDescriptor, TypePtr,
 +    },
 +    thrift_struct, thrift_union,
 +    util::bit_util::FromBytes,
 +};
 +#[cfg(feature = "encryption")]
 +use crate::{
 +    encryption::decrypt::{FileDecryptionProperties, FileDecryptor},
 +    file::column_crypto_metadata::ColumnCryptoMetaData,
 +    parquet_thrift::ThriftSliceInputProtocol,
 +    schema::types::SchemaDescPtr,
 +};
 +
 +// this needs to be visible to the schema conversion code
 +thrift_struct!(
 +pub(crate) struct SchemaElement<'a> {
 +  /** Data type for this field. Not set if the current element is a non-leaf node */
 +  1: optional Type type_;
 +  2: optional i32 type_length;
 +  3: optional Repetition repetition_type;
 +  4: required string<'a> name;
 +  5: optional i32 num_children;
 +  6: optional ConvertedType converted_type;
 +  7: optional i32 scale
 +  8: optional i32 precision
 +  9: optional i32 field_id;
 +  10: optional LogicalType logical_type
 +}
 +);
 +
 +thrift_struct!(
 +pub(crate) struct AesGcmV1 {
 +  /// AAD prefix
 +  1: optional binary aad_prefix
 +
 +  /// Unique file identifier part of AAD suffix
 +  2: optional binary aad_file_unique
 +
 +  /// In files encrypted with AAD prefix without storing it,
 +  /// readers must supply the prefix
 +  3: optional bool supply_aad_prefix
 +}
 +);
 +
 +thrift_struct!(
 +pub(crate) struct AesGcmCtrV1 {
 +  /// AAD prefix
 +  1: optional binary aad_prefix
 +
 +  /// Unique file identifier part of AAD suffix
 +  2: optional binary aad_file_unique
 +
 +  /// In files encrypted with AAD prefix without storing it,
 +  /// readers must supply the prefix
 +  3: optional bool supply_aad_prefix
 +}
 +);
 +
 +thrift_union!(
 +union EncryptionAlgorithm {
 +  1: (AesGcmV1) AES_GCM_V1
 +  2: (AesGcmCtrV1) AES_GCM_CTR_V1
 +}
 +);
 +
 +#[cfg(feature = "encryption")]
 +thrift_struct!(
 +/// Crypto metadata for files with encrypted footer
 +pub(crate) struct FileCryptoMetaData {
 +  /// Encryption algorithm. This field is only used for files
 +  /// with encrypted footer. Files with plaintext footer store algorithm id
 +  /// inside footer (FileMetaData structure).
 +  1: required EncryptionAlgorithm encryption_algorithm
 +
 +  /** Retrieval metadata of key used for encryption of footer,
 +   *  and (possibly) columns **/
 +  2: optional binary key_metadata
 +}
 +);
 +
- // expose for benchmarking
- pub(crate) fn bench_file_metadata(bytes: &bytes::Bytes) {
-     use crate::parquet_thrift::{ReadThrift, ThriftSliceInputProtocol};
-     let mut prot = ThriftSliceInputProtocol::new(bytes);
-     crate::file::metadata::thrift_gen::FileMetaData::read_thrift(&mut prot).unwrap();
- }
- 
 +// the following are only used internally so are private
 +thrift_struct!(
 +struct FileMetaData<'a> {
 +  /** Version of this file **/
 +  1: required i32 version
 +  2: required list<'a><SchemaElement> schema;
 +  3: required i64 num_rows
 +  4: required list<'a><RowGroup> row_groups
 +  5: optional list<KeyValue> key_value_metadata
 +  6: optional string created_by
 +  7: optional list<ColumnOrder> column_orders;
 +  8: optional EncryptionAlgorithm encryption_algorithm
 +  9: optional binary footer_signing_key_metadata
 +}
 +);
 +
 +thrift_struct!(
 +struct RowGroup<'a> {
 +  1: required list<'a><ColumnChunk> columns
 +  2: required i64 total_byte_size
 +  3: required i64 num_rows
 +  4: optional list<SortingColumn> sorting_columns
 +  5: optional i64 file_offset
 +  // we don't expose total_compressed_size so skip
 +  //6: optional i64 total_compressed_size
 +  7: optional i16 ordinal
 +}
 +);
 +
 +#[cfg(feature = "encryption")]
 +thrift_struct!(
 +struct ColumnChunk<'a> {
 +  1: optional string<'a> file_path
 +  2: required i64 file_offset = 0
 +  3: optional ColumnMetaData<'a> meta_data
 +  4: optional i64 offset_index_offset
 +  5: optional i32 offset_index_length
 +  6: optional i64 column_index_offset
 +  7: optional i32 column_index_length
 +  8: optional ColumnCryptoMetaData crypto_metadata
 +  9: optional binary<'a> encrypted_column_metadata
 +}
 +);
 +#[cfg(not(feature = "encryption"))]
 +thrift_struct!(
 +struct ColumnChunk<'a> {
 +  1: optional string file_path
 +  2: required i64 file_offset = 0
 +  3: optional ColumnMetaData<'a> meta_data
 +  4: optional i64 offset_index_offset
 +  5: optional i32 offset_index_length
 +  6: optional i64 column_index_offset
 +  7: optional i32 column_index_length
 +}
 +);
 +
 +type CompressionCodec = Compression;
 +thrift_struct!(
 +struct ColumnMetaData<'a> {
 +  1: required Type type_
 +  2: required list<Encoding> encodings
 +  // we don't expose path_in_schema so skip
 +  //3: required list<string> path_in_schema
 +  4: required CompressionCodec codec
 +  5: required i64 num_values
 +  6: required i64 total_uncompressed_size
 +  7: required i64 total_compressed_size
 +  // we don't expose key_value_metadata so skip
 +  //8: optional list<KeyValue> key_value_metadata
 +  9: required i64 data_page_offset
 +  10: optional i64 index_page_offset
 +  11: optional i64 dictionary_page_offset
 +  12: optional Statistics<'a> statistics
 +  13: optional list<PageEncodingStats> encoding_stats;
 +  14: optional i64 bloom_filter_offset;
 +  15: optional i32 bloom_filter_length;
 +  16: optional SizeStatistics size_statistics;
 +  17: optional GeospatialStatistics geospatial_statistics;
 +}
 +);
 +
 +thrift_struct!(
 +struct BoundingBox {
 +  1: required double xmin;
 +  2: required double xmax;
 +  3: required double ymin;
 +  4: required double ymax;
 +  5: optional double zmin;
 +  6: optional double zmax;
 +  7: optional double mmin;
 +  8: optional double mmax;
 +}
 +);
 +
 +thrift_struct!(
 +struct GeospatialStatistics {
 +  /** A bounding box of geospatial instances */
 +  1: optional BoundingBox bbox;
 +  /** Geospatial type codes of all instances, or an empty list if not known */
 +  2: optional list<i32> geospatial_types;
 +}
 +);
 +
 +thrift_struct!(
 +struct SizeStatistics {
 +   1: optional i64 unencoded_byte_array_data_bytes;
 +   2: optional list<i64> repetition_level_histogram;
 +   3: optional list<i64> definition_level_histogram;
 +}
 +);
 +
 +thrift_struct!(
 +pub(crate) struct Statistics<'a> {
 +   1: optional binary<'a> max;
 +   2: optional binary<'a> min;
 +   3: optional i64 null_count;
 +   4: optional i64 distinct_count;
 +   5: optional binary<'a> max_value;
 +   6: optional binary<'a> min_value;
 +   7: optional bool is_max_value_exact;
 +   8: optional bool is_min_value_exact;
 +}
 +);
 +
 +// convert collection of thrift RowGroups into RowGroupMetaData
 +fn convert_row_groups(
 +    mut row_groups: Vec<RowGroup>,
 +    schema_descr: Arc<SchemaDescriptor>,
 +) -> Result<Vec<RowGroupMetaData>> {
 +    let mut res: Vec<RowGroupMetaData> = Vec::with_capacity(row_groups.len());
 +    for rg in row_groups.drain(0..) {
 +        res.push(convert_row_group(rg, schema_descr.clone())?);
 +    }
 +
 +    Ok(res)
 +}
 +
 +fn convert_row_group(
 +    row_group: RowGroup,
 +    schema_descr: Arc<SchemaDescriptor>,
 +) -> Result<RowGroupMetaData> {
 +    let num_rows = row_group.num_rows;
 +    let sorting_columns = row_group.sorting_columns;
 +    let total_byte_size = row_group.total_byte_size;
 +    let file_offset = row_group.file_offset;
 +    let ordinal = row_group.ordinal;
 +
 +    let columns = convert_columns(row_group.columns, schema_descr.clone())?;
 +
 +    Ok(RowGroupMetaData {
 +        columns,
 +        num_rows,
 +        sorting_columns,
 +        total_byte_size,
 +        schema_descr,
 +        file_offset,
 +        ordinal,
 +    })
 +}
 +
 +fn convert_columns(
 +    mut columns: Vec<ColumnChunk>,
 +    schema_descr: Arc<SchemaDescriptor>,
 +) -> Result<Vec<ColumnChunkMetaData>> {
 +    let mut res: Vec<ColumnChunkMetaData> = Vec::with_capacity(columns.len());
 +    for (c, d) in columns.drain(0..).zip(schema_descr.columns()) {
 +        res.push(convert_column(c, d.clone())?);
 +    }
 +
 +    Ok(res)
 +}
 +
 +fn convert_column(
 +    column: ColumnChunk,
 +    column_descr: Arc<ColumnDescriptor>,
 +) -> Result<ColumnChunkMetaData> {
 +    if column.meta_data.is_none() {
 +        return Err(general_err!("Expected to have column metadata"));
 +    }
 +    let col_metadata = column.meta_data.unwrap();
 +    let column_type = col_metadata.type_;
 +    let encodings = col_metadata.encodings;
 +    let compression = col_metadata.codec;
 +    let file_path = column.file_path.map(|v| v.to_owned());
 +    let file_offset = column.file_offset;
 +    let num_values = col_metadata.num_values;
 +    let total_compressed_size = col_metadata.total_compressed_size;
 +    let total_uncompressed_size = col_metadata.total_uncompressed_size;
 +    let data_page_offset = col_metadata.data_page_offset;
 +    let index_page_offset = col_metadata.index_page_offset;
 +    let dictionary_page_offset = col_metadata.dictionary_page_offset;
 +    let statistics = convert_stats(column_type, col_metadata.statistics)?;
 +    let encoding_stats = col_metadata.encoding_stats;
 +    let bloom_filter_offset = col_metadata.bloom_filter_offset;
 +    let bloom_filter_length = col_metadata.bloom_filter_length;
 +    let offset_index_offset = column.offset_index_offset;
 +    let offset_index_length = column.offset_index_length;
 +    let column_index_offset = column.column_index_offset;
 +    let column_index_length = column.column_index_length;
 +    let (unencoded_byte_array_data_bytes, repetition_level_histogram, definition_level_histogram) =
 +        if let Some(size_stats) = col_metadata.size_statistics {
 +            (
 +                size_stats.unencoded_byte_array_data_bytes,
 +                size_stats.repetition_level_histogram,
 +                size_stats.definition_level_histogram,
 +            )
 +        } else {
 +            (None, None, None)
 +        };
 +
++    let geo_statistics = convert_geo_stats(col_metadata.geospatial_statistics);
++
 +    let repetition_level_histogram = repetition_level_histogram.map(LevelHistogram::from);
 +    let definition_level_histogram = definition_level_histogram.map(LevelHistogram::from);
 +
 +    let result = ColumnChunkMetaData {
 +        column_descr,
 +        encodings,
 +        file_path,
 +        file_offset,
 +        num_values,
 +        compression,
 +        total_compressed_size,
 +        total_uncompressed_size,
 +        data_page_offset,
 +        index_page_offset,
 +        dictionary_page_offset,
 +        statistics,
++        geo_statistics,
 +        encoding_stats,
 +        bloom_filter_offset,
 +        bloom_filter_length,
 +        offset_index_offset,
 +        offset_index_length,
 +        column_index_offset,
 +        column_index_length,
 +        unencoded_byte_array_data_bytes,
 +        repetition_level_histogram,
 +        definition_level_histogram,
 +        #[cfg(feature = "encryption")]
 +        column_crypto_metadata: column.crypto_metadata,
 +        #[cfg(feature = "encryption")]
 +        encrypted_column_metadata: None,
 +    };
 +    Ok(result)
 +}
 +
++fn convert_geo_stats(
++    stats: Option<GeospatialStatistics>,
++) -> Option<Box<crate::geospatial::statistics::GeospatialStatistics>> {
++    stats.map(|st| {
++        let bbox = convert_bounding_box(st.bbox);
++        let geospatial_types: Option<Vec<i32>> = st.geospatial_types.filter(|v| !v.is_empty());
++        Box::new(crate::geospatial::statistics::GeospatialStatistics::new(
++            bbox,
++            geospatial_types,
++        ))
++    })
++}
++
++fn convert_bounding_box(
++    bbox: Option<BoundingBox>,
++) -> Option<crate::geospatial::bounding_box::BoundingBox> {
++    bbox.map(|bb| {
++        let mut newbb = crate::geospatial::bounding_box::BoundingBox::new(
++            bb.xmin.into(),
++            bb.xmax.into(),
++            bb.ymin.into(),
++            bb.ymax.into(),
++        );
++
++        newbb = match (bb.zmin, bb.zmax) {
++            (Some(zmin), Some(zmax)) => newbb.with_zrange(zmin.into(), zmax.into()),
++            // If either None or mismatch, leave it as None and don't error
++            _ => newbb,
++        };
++
++        newbb = match (bb.mmin, bb.mmax) {
++            (Some(mmin), Some(mmax)) => newbb.with_mrange(mmin.into(), mmax.into()),
++            // If either None or mismatch, leave it as None and don't error
++            _ => newbb,
++        };
++
++        newbb
++    })
++}
++
 +pub(crate) fn convert_stats(
 +    physical_type: Type,
 +    thrift_stats: Option<Statistics>,
 +) -> Result<Option<crate::file::statistics::Statistics>> {
 +    use crate::file::statistics::Statistics as FStatistics;
 +    Ok(match thrift_stats {
 +        Some(stats) => {
 +            // Number of nulls recorded, when it is not available, we just mark it as 0.
 +            // TODO this should be `None` if there is no information about NULLS.
 +            // see https://github.com/apache/arrow-rs/pull/6216/files
 +            let null_count = stats.null_count.unwrap_or(0);
 +
 +            if null_count < 0 {
 +                return Err(ParquetError::General(format!(
 +                    "Statistics null count is negative {null_count}",
 +                )));
 +            }
 +
 +            // Generic null count.
 +            let null_count = Some(null_count as u64);
 +            // Generic distinct count (count of distinct values occurring)
 +            let distinct_count = stats.distinct_count.map(|value| value as u64);
 +            // Whether or not statistics use deprecated min/max fields.
 +            let old_format = stats.min_value.is_none() && stats.max_value.is_none();
 +            // Generic min value as bytes.
 +            let min = if old_format {
 +                stats.min
 +            } else {
 +                stats.min_value
 +            };
 +            // Generic max value as bytes.
 +            let max = if old_format {
 +                stats.max
 +            } else {
 +                stats.max_value
 +            };
 +
 +            fn check_len(min: &Option<&[u8]>, max: &Option<&[u8]>, len: usize) -> Result<()> {
 +                if let Some(min) = min {
 +                    if min.len() < len {
 +                        return Err(ParquetError::General(
 +                            "Insufficient bytes to parse min statistic".to_string(),
 +                        ));
 +                    }
 +                }
 +                if let Some(max) = max {
 +                    if max.len() < len {
 +                        return Err(ParquetError::General(
 +                            "Insufficient bytes to parse max statistic".to_string(),
 +                        ));
 +                    }
 +                }
 +                Ok(())
 +            }
 +
 +            match physical_type {
 +                Type::BOOLEAN => check_len(&min, &max, 1),
 +                Type::INT32 | Type::FLOAT => check_len(&min, &max, 4),
 +                Type::INT64 | Type::DOUBLE => check_len(&min, &max, 8),
 +                Type::INT96 => check_len(&min, &max, 12),
 +                _ => Ok(()),
 +            }?;
 +
 +            // Values are encoded using PLAIN encoding definition, except that
 +            // variable-length byte arrays do not include a length prefix.
 +            //
 +            // Instead of using actual decoder, we manually convert values.
 +            let res = match physical_type {
 +                Type::BOOLEAN => FStatistics::boolean(
 +                    min.map(|data| data[0] != 0),
 +                    max.map(|data| data[0] != 0),
 +                    distinct_count,
 +                    null_count,
 +                    old_format,
 +                ),
 +                Type::INT32 => FStatistics::int32(
 +                    min.map(|data| i32::from_le_bytes(data[..4].try_into().unwrap())),
 +                    max.map(|data| i32::from_le_bytes(data[..4].try_into().unwrap())),
 +                    distinct_count,
 +                    null_count,
 +                    old_format,
 +                ),
 +                Type::INT64 => FStatistics::int64(
 +                    min.map(|data| i64::from_le_bytes(data[..8].try_into().unwrap())),
 +                    max.map(|data| i64::from_le_bytes(data[..8].try_into().unwrap())),
 +                    distinct_count,
 +                    null_count,
 +                    old_format,
 +                ),
 +                Type::INT96 => {
 +                    // INT96 statistics may not be correct, because comparison is signed
 +                    let min = if let Some(data) = min {
 +                        assert_eq!(data.len(), 12);
 +                        Some(Int96::try_from_le_slice(data)?)
 +                    } else {
 +                        None
 +                    };
 +                    let max = if let Some(data) = max {
 +                        assert_eq!(data.len(), 12);
 +                        Some(Int96::try_from_le_slice(data)?)
 +                    } else {
 +                        None
 +                    };
 +                    FStatistics::int96(min, max, distinct_count, null_count, old_format)
 +                }
 +                Type::FLOAT => FStatistics::float(
 +                    min.map(|data| f32::from_le_bytes(data[..4].try_into().unwrap())),
 +                    max.map(|data| f32::from_le_bytes(data[..4].try_into().unwrap())),
 +                    distinct_count,
 +                    null_count,
 +                    old_format,
 +                ),
 +                Type::DOUBLE => FStatistics::double(
 +                    min.map(|data| f64::from_le_bytes(data[..8].try_into().unwrap())),
 +                    max.map(|data| f64::from_le_bytes(data[..8].try_into().unwrap())),
 +                    distinct_count,
 +                    null_count,
 +                    old_format,
 +                ),
 +                Type::BYTE_ARRAY => FStatistics::ByteArray(
 +                    ValueStatistics::new(
 +                        min.map(ByteArray::from),
 +                        max.map(ByteArray::from),
 +                        distinct_count,
 +                        null_count,
 +                        old_format,
 +                    )
 +                    .with_max_is_exact(stats.is_max_value_exact.unwrap_or(false))
 +                    .with_min_is_exact(stats.is_min_value_exact.unwrap_or(false)),
 +                ),
 +                Type::FIXED_LEN_BYTE_ARRAY => FStatistics::FixedLenByteArray(
 +                    ValueStatistics::new(
 +                        min.map(ByteArray::from).map(FixedLenByteArray::from),
 +                        max.map(ByteArray::from).map(FixedLenByteArray::from),
 +                        distinct_count,
 +                        null_count,
 +                        old_format,
 +                    )
 +                    .with_max_is_exact(stats.is_max_value_exact.unwrap_or(false))
 +                    .with_min_is_exact(stats.is_min_value_exact.unwrap_or(false)),
 +                ),
 +            };
 +
 +            Some(res)
 +        }
 +        None => None,
 +    })
 +}
 +
 +#[cfg(feature = "encryption")]
 +fn row_group_from_encrypted_thrift(
 +    mut rg: RowGroup,
 +    schema_descr: SchemaDescPtr,
 +    decryptor: Option<&FileDecryptor>,
 +) -> Result<RowGroupMetaData> {
 +    if schema_descr.num_columns() != rg.columns.len() {
 +        return Err(general_err!(
 +            "Column count mismatch. Schema has {} columns while Row Group has {}",
 +            schema_descr.num_columns(),
 +            rg.columns.len()
 +        ));
 +    }
 +    let total_byte_size = rg.total_byte_size;
 +    let num_rows = rg.num_rows;
 +    let mut columns = vec![];
 +
 +    for (i, (mut c, d)) in rg
 +        .columns
 +        .drain(0..)
 +        .zip(schema_descr.columns())
 +        .enumerate()
 +    {
 +        // Read encrypted metadata if it's present and we have a decryptor.
 +        if let (true, Some(decryptor)) = (c.encrypted_column_metadata.is_some(), decryptor) {
 +            let column_decryptor = match c.crypto_metadata.as_ref() {
 +                None => {
 +                    return Err(general_err!(
 +                        "No crypto_metadata is set for column '{}', which has encrypted metadata",
 +                        d.path().string()
 +                    ));
 +                }
 +                Some(ColumnCryptoMetaData::ENCRYPTION_WITH_COLUMN_KEY(crypto_metadata)) => {
 +                    let column_name = crypto_metadata.path_in_schema.join(".");
 +                    decryptor.get_column_metadata_decryptor(
 +                        column_name.as_str(),
 +                        crypto_metadata.key_metadata.as_deref(),
 +                    )?
 +                }
 +                Some(ColumnCryptoMetaData::ENCRYPTION_WITH_FOOTER_KEY) => {
 +                    decryptor.get_footer_decryptor()?
 +                }
 +            };
 +
 +            let column_aad = crate::encryption::modules::create_module_aad(
 +                decryptor.file_aad(),
 +                crate::encryption::modules::ModuleType::ColumnMetaData,
 +                rg.ordinal.unwrap() as usize,
 +                i,
 +                None,
 +            )?;
 +
 +            let buf = c.encrypted_column_metadata.unwrap();
 +            let decrypted_cc_buf =
 +                column_decryptor
 +                    .decrypt(buf, column_aad.as_ref())
 +                    .map_err(|_| {
 +                        general_err!(
 +                            "Unable to decrypt column '{}', perhaps the column key is wrong?",
 +                            d.path().string()
 +                        )
 +                    })?;
 +
 +            let mut prot = ThriftSliceInputProtocol::new(decrypted_cc_buf.as_slice());
 +            let col_meta = ColumnMetaData::read_thrift(&mut prot)?;
 +            c.meta_data = Some(col_meta);
 +            columns.push(convert_column(c, d.clone())?);
 +        } else {
 +            columns.push(convert_column(c, d.clone())?);
 +        }
 +    }
 +
 +    let sorting_columns = rg.sorting_columns;
 +    let file_offset = rg.file_offset;
 +    let ordinal = rg.ordinal;
 +
 +    Ok(RowGroupMetaData {
 +        columns,
 +        num_rows,
 +        sorting_columns,
 +        total_byte_size,
 +        schema_descr,
 +        file_offset,
 +        ordinal,
 +    })
 +}
 +
 +#[cfg(feature = "encryption")]
 +pub(crate) fn parquet_metadata_with_encryption(
 +    file_decryption_properties: Option<&FileDecryptionProperties>,
 +    encrypted_footer: bool,
 +    buf: &[u8],
 +) -> Result<ParquetMetaData> {
 +    let mut prot = ThriftSliceInputProtocol::new(buf);
 +    let mut file_decryptor = None;
 +    let decrypted_fmd_buf;
 +
 +    if encrypted_footer {
 +        if let Some(file_decryption_properties) = file_decryption_properties {
 +            let t_file_crypto_metadata: FileCryptoMetaData =
 +                FileCryptoMetaData::read_thrift(&mut prot)
 +                    .map_err(|e| general_err!("Could not parse crypto metadata: {}", e))?;
 +            let supply_aad_prefix = match &t_file_crypto_metadata.encryption_algorithm {
 +                EncryptionAlgorithm::AES_GCM_V1(algo) => algo.supply_aad_prefix,
 +                _ => Some(false),
 +            }
 +            .unwrap_or(false);
 +            if supply_aad_prefix && file_decryption_properties.aad_prefix().is_none() {
 +                return Err(general_err!(
 +                        "Parquet file was encrypted with an AAD prefix that is not stored in the file, \
 +                        but no AAD prefix was provided in the file decryption properties"
 +                    ));
 +            }
 +            let decryptor = get_file_decryptor(
 +                t_file_crypto_metadata.encryption_algorithm,
 +                t_file_crypto_metadata.key_metadata.as_ref(),
 +                file_decryption_properties,
 +            )?;
 +            let footer_decryptor = decryptor.get_footer_decryptor();
 +            let aad_footer = crate::encryption::modules::create_footer_aad(decryptor.file_aad())?;
 +
 +            decrypted_fmd_buf = footer_decryptor?
 +                .decrypt(prot.as_slice().as_ref(), aad_footer.as_ref())
 +                .map_err(|_| {
 +                    general_err!(
 +                        "Provided footer key and AAD were unable to decrypt parquet footer"
 +                    )
 +                })?;
 +            prot = ThriftSliceInputProtocol::new(decrypted_fmd_buf.as_ref());
 +
 +            file_decryptor = Some(decryptor);
 +        } else {
 +            return Err(general_err!(
 +                "Parquet file has an encrypted footer but decryption properties were not provided"
 +            ));
 +        }
 +    }
 +
 +    let file_meta = super::thrift_gen::FileMetaData::read_thrift(&mut prot)
 +        .map_err(|e| general_err!("Could not parse metadata: {}", e))?;
 +
 +    let version = file_meta.version;
 +    let num_rows = file_meta.num_rows;
 +    let created_by = file_meta.created_by.map(|c| c.to_owned());
 +    let key_value_metadata = file_meta.key_value_metadata;
 +
 +    let val = parquet_schema_from_array(file_meta.schema)?;
 +    let schema_descr = Arc::new(SchemaDescriptor::new(val));
 +
 +    if let (Some(algo), Some(file_decryption_properties)) =
 +        (file_meta.encryption_algorithm, file_decryption_properties)
 +    {
 +        // File has a plaintext footer but encryption algorithm is set
 +        let file_decryptor_value = get_file_decryptor(
 +            algo,
 +            file_meta.footer_signing_key_metadata.as_ref(),
 +            file_decryption_properties,
 +        )?;
 +        if file_decryption_properties.check_plaintext_footer_integrity() && !encrypted_footer {
 +            file_decryptor_value.verify_plaintext_footer_signature(buf)?;
 +        }
 +        file_decryptor = Some(file_decryptor_value);
 +    }
 +
 +    // decrypt column chunk info
 +    let mut row_groups = Vec::with_capacity(file_meta.row_groups.len());
 +    for rg in file_meta.row_groups {
 +        let r = row_group_from_encrypted_thrift(rg, schema_descr.clone(), file_decryptor.as_ref())?;
 +        row_groups.push(r);
 +    }
 +
 +    // need to map read column orders to actual values based on the schema
 +    if file_meta
 +        .column_orders
 +        .as_ref()
 +        .is_some_and(|cos| cos.len() != schema_descr.num_columns())
 +    {
 +        return Err(general_err!("Column order length mismatch"));
 +    }
 +
 +    let column_orders = file_meta.column_orders.map(|cos| {
 +        let mut res = Vec::with_capacity(cos.len());
 +        for (i, column) in schema_descr.columns().iter().enumerate() {
 +            match cos[i] {
 +                ColumnOrder::TYPE_DEFINED_ORDER(_) => {
 +                    let sort_order = ColumnOrder::get_sort_order(
 +                        column.logical_type(),
 +                        column.converted_type(),
 +                        column.physical_type(),
 +                    );
 +                    res.push(ColumnOrder::TYPE_DEFINED_ORDER(sort_order));
 +                }
 +                _ => res.push(cos[i]),
 +            }
 +        }
 +        res
 +    });
 +
 +    let fmd = crate::file::metadata::FileMetaData::new(
 +        version,
 +        num_rows,
 +        created_by,
 +        key_value_metadata,
 +        schema_descr,
 +        column_orders,
 +    );
 +    let mut metadata = ParquetMetaData::new(fmd, row_groups);
 +
 +    metadata.with_file_decryptor(file_decryptor);
 +
 +    Ok(metadata)
 +}
 +
 +#[cfg(feature = "encryption")]
 +pub(super) fn get_file_decryptor(
 +    encryption_algorithm: EncryptionAlgorithm,
 +    footer_key_metadata: Option<&Vec<u8>>,
 +    file_decryption_properties: &FileDecryptionProperties,
 +) -> Result<FileDecryptor> {
 +    match encryption_algorithm {
 +        EncryptionAlgorithm::AES_GCM_V1(algo) => {
 +            let aad_file_unique = algo
 +                .aad_file_unique
 +                .ok_or_else(|| general_err!("AAD unique file identifier is not set"))?;
 +            let aad_prefix = if let Some(aad_prefix) = file_decryption_properties.aad_prefix() {
 +                aad_prefix.clone()
 +            } else {
 +                algo.aad_prefix.map(|v| v.to_vec()).unwrap_or_default()
 +            };
 +            let aad_file_unique = aad_file_unique.to_vec();
 +
 +            FileDecryptor::new(
 +                file_decryption_properties,
 +                footer_key_metadata.map(|v| v.as_slice()),
 +                aad_file_unique,
 +                aad_prefix,
 +            )
 +        }
 +        EncryptionAlgorithm::AES_GCM_CTR_V1(_) => Err(nyi_err!(
 +            "The AES_GCM_CTR_V1 encryption algorithm is not yet supported"
 +        )),
 +    }
 +}
 +
 +/// Create ParquetMetaData from thrift input. Note that this only decodes the file metadata in
 +/// the Parquet footer. Page indexes will need to be added later.
 +impl<'a, R: ThriftCompactInputProtocol<'a>> ReadThrift<'a, R> for ParquetMetaData {
 +    fn read_thrift(prot: &mut R) -> Result<Self> {
 +        let file_meta = super::thrift_gen::FileMetaData::read_thrift(prot)?;
 +
 +        let version = file_meta.version;
 +        let num_rows = file_meta.num_rows;
 +        let row_groups = file_meta.row_groups;
 +        let created_by = file_meta.created_by.map(|c| c.to_owned());
 +        let key_value_metadata = file_meta.key_value_metadata;
 +
 +        let val = parquet_schema_from_array(file_meta.schema)?;
 +        let schema_descr = Arc::new(SchemaDescriptor::new(val));
 +
 +        // need schema_descr to get final RowGroupMetaData
 +        let row_groups = convert_row_groups(row_groups, schema_descr.clone())?;
 +
 +        // need to map read column orders to actual values based on the schema
 +        if file_meta
 +            .column_orders
 +            .as_ref()
 +            .is_some_and(|cos| cos.len() != schema_descr.num_columns())
 +        {
 +            return Err(general_err!("Column order length mismatch"));
 +        }
 +
 +        let column_orders = file_meta.column_orders.map(|cos| {
 +            let mut res = Vec::with_capacity(cos.len());
 +            for (i, column) in schema_descr.columns().iter().enumerate() {
 +                match cos[i] {
 +                    ColumnOrder::TYPE_DEFINED_ORDER(_) => {
 +                        let sort_order = ColumnOrder::get_sort_order(
 +                            column.logical_type(),
 +                            column.converted_type(),
 +                            column.physical_type(),
 +                        );
 +                        res.push(ColumnOrder::TYPE_DEFINED_ORDER(sort_order));
 +                    }
 +                    _ => res.push(cos[i]),
 +                }
 +            }
 +            res
 +        });
 +
 +        let fmd = crate::file::metadata::FileMetaData::new(
 +            version,
 +            num_rows,
 +            created_by,
 +            key_value_metadata,
 +            schema_descr,
 +            column_orders,
 +        );
 +
 +        Ok(ParquetMetaData::new(fmd, row_groups))
 +    }
 +}
 +
 +thrift_struct!(
 +    pub(crate) struct IndexPageHeader {}
 +);
 +
 +thrift_struct!(
 +pub(crate) struct DictionaryPageHeader {
 +  /// Number of values in the dictionary
 +  1: required i32 num_values;
 +
 +  /// Encoding using this dictionary page
 +  2: required Encoding encoding
 +
 +  /// If true, the entries in the dictionary are sorted in ascending order
 +  3: optional bool is_sorted;
 +}
 +);
 +
 +thrift_struct!(
 +/// Statistics for the page header.
 +///
 +/// This is a duplicate of the [`Statistics`] struct above. Because the page reader uses
 +/// the [`Read`] API, we cannot read the min/max values as slices. This should not be
 +/// a huge problem since this crate no longer reads the page header statistics by default.
 +///
 +/// [`Read`]: crate::parquet_thrift::ThriftReadInputProtocol
 +pub(crate) struct PageStatistics {
 +   1: optional binary max;
 +   2: optional binary min;
 +   3: optional i64 null_count;
 +   4: optional i64 distinct_count;
 +   5: optional binary max_value;
 +   6: optional binary min_value;
 +   7: optional bool is_max_value_exact;
 +   8: optional bool is_min_value_exact;
 +}
 +);
 +
 +thrift_struct!(
 +pub(crate) struct DataPageHeader {
 +  1: required i32 num_values
 +  2: required Encoding encoding
 +  3: required Encoding definition_level_encoding;
 +  4: required Encoding repetition_level_encoding;
 +  5: optional PageStatistics statistics;
 +}
 +);
 +
 +impl DataPageHeader {
 +    // reader that skips decoding page statistics
 +    fn read_thrift_without_stats<'a, R>(prot: &mut R) -> Result<Self>
 +    where
 +        R: ThriftCompactInputProtocol<'a>,
 +    {
 +        let mut num_values: Option<i32> = None;
 +        let mut encoding: Option<Encoding> = None;
 +        let mut definition_level_encoding: Option<Encoding> = None;
 +        let mut repetition_level_encoding: Option<Encoding> = None;
 +        let statistics: Option<PageStatistics> = None;
 +        let mut last_field_id = 0i16;
 +        loop {
 +            let field_ident = prot.read_field_begin(last_field_id)?;
 +            if field_ident.field_type == FieldType::Stop {
 +                break;
 +            }
 +            match field_ident.id {
 +                1 => {
 +                    let val = i32::read_thrift(&mut *prot)?;
 +                    num_values = Some(val);
 +                }
 +                2 => {
 +                    let val = Encoding::read_thrift(&mut *prot)?;
 +                    encoding = Some(val);
 +                }
 +                3 => {
 +                    let val = Encoding::read_thrift(&mut *prot)?;
 +                    definition_level_encoding = Some(val);
 +                }
 +                4 => {
 +                    let val = Encoding::read_thrift(&mut *prot)?;
 +                    repetition_level_encoding = Some(val);
 +                }
 +                _ => {
 +                    prot.skip(field_ident.field_type)?;
 +                }
 +            };
 +            last_field_id = field_ident.id;
 +        }
 +        let Some(num_values) = num_values else {
 +            return Err(ParquetError::General(
 +                "Required field num_values is missing".to_owned(),
 +            ));
 +        };
 +        let Some(encoding) = encoding else {
 +            return Err(ParquetError::General(
 +                "Required field encoding is missing".to_owned(),
 +            ));
 +        };
 +        let Some(definition_level_encoding) = definition_level_encoding else {
 +            return Err(ParquetError::General(
 +                "Required field definition_level_encoding is missing".to_owned(),
 +            ));
 +        };
 +        let Some(repetition_level_encoding) = repetition_level_encoding else {
 +            return Err(ParquetError::General(
 +                "Required field repetition_level_encoding is missing".to_owned(),
 +            ));
 +        };
 +        Ok(Self {
 +            num_values,
 +            encoding,
 +            definition_level_encoding,
 +            repetition_level_encoding,
 +            statistics,
 +        })
 +    }
 +}
 +
 +thrift_struct!(
 +pub(crate) struct DataPageHeaderV2 {
 +  1: required i32 num_values
 +  2: required i32 num_nulls
 +  3: required i32 num_rows
 +  4: required Encoding encoding
 +  5: required i32 definition_levels_byte_length;
 +  6: required i32 repetition_levels_byte_length;
 +  7: optional bool is_compressed = true;
 +  8: optional PageStatistics statistics;
 +}
 +);
 +
 +impl DataPageHeaderV2 {
 +    // reader that skips decoding page statistics
 +    fn read_thrift_without_stats<'a, R>(prot: &mut R) -> Result<Self>
 +    where
 +        R: ThriftCompactInputProtocol<'a>,
 +    {
 +        let mut num_values: Option<i32> = None;
 +        let mut num_nulls: Option<i32> = None;
 +        let mut num_rows: Option<i32> = None;
 +        let mut encoding: Option<Encoding> = None;
 +        let mut definition_levels_byte_length: Option<i32> = None;
 +        let mut repetition_levels_byte_length: Option<i32> = None;
 +        let mut is_compressed: Option<bool> = None;
 +        let statistics: Option<PageStatistics> = None;
 +        let mut last_field_id = 0i16;
 +        loop {
 +            let field_ident = prot.read_field_begin(last_field_id)?;
 +            if field_ident.field_type == FieldType::Stop {
 +                break;
 +            }
 +            match field_ident.id {
 +                1 => {
 +                    let val = i32::read_thrift(&mut *prot)?;
 +                    num_values = Some(val);
 +                }
 +                2 => {
 +                    let val = i32::read_thrift(&mut *prot)?;
 +                    num_nulls = Some(val);
 +                }
 +                3 => {
 +                    let val = i32::read_thrift(&mut *prot)?;
 +                    num_rows = Some(val);
 +                }
 +                4 => {
 +                    let val = Encoding::read_thrift(&mut *prot)?;
 +                    encoding = Some(val);
 +                }
 +                5 => {
 +                    let val = i32::read_thrift(&mut *prot)?;
 +                    definition_levels_byte_length = Some(val);
 +                }
 +                6 => {
 +                    let val = i32::read_thrift(&mut *prot)?;
 +                    repetition_levels_byte_length = Some(val);
 +                }
 +                7 => {
 +                    let val = field_ident.bool_val.unwrap();
 +                    is_compressed = Some(val);
 +                }
 +                _ => {
 +                    prot.skip(field_ident.field_type)?;
 +                }
 +            };
 +            last_field_id = field_ident.id;
 +        }
 +        let Some(num_values) = num_values else {
 +            return Err(ParquetError::General(
 +                "Required field num_values is missing".to_owned(),
 +            ));
 +        };
 +        let Some(num_nulls) = num_nulls else {
 +            return Err(ParquetError::General(
 +                "Required field num_nulls is missing".to_owned(),
 +            ));
 +        };
 +        let Some(num_rows) = num_rows else {
 +            return Err(ParquetError::General(
 +                "Required field num_rows is missing".to_owned(),
 +            ));
 +        };
 +        let Some(encoding) = encoding else {
 +            return Err(ParquetError::General(
 +                "Required field encoding is missing".to_owned(),
 +            ));
 +        };
 +        let Some(definition_levels_byte_length) = definition_levels_byte_length else {
 +            return Err(ParquetError::General(
 +                "Required field definition_levels_byte_length is missing".to_owned(),
 +            ));
 +        };
 +        let Some(repetition_levels_byte_length) = repetition_levels_byte_length else {
 +            return Err(ParquetError::General(
 +                "Required field repetition_levels_byte_length is missing".to_owned(),
 +            ));
 +        };
 +        Ok(Self {
 +            num_values,
 +            num_nulls,
 +            num_rows,
 +            encoding,
 +            definition_levels_byte_length,
 +            repetition_levels_byte_length,
 +            is_compressed,
 +            statistics,
 +        })
 +    }
 +}
 +
 +thrift_struct!(
 +pub(crate) struct PageHeader {
 +  /// the type of the page: indicates which of the *_header fields is set
 +  1: required PageType type_
 +
 +  /// Uncompressed page size in bytes (not including this header)
 +  2: required i32 uncompressed_page_size
 +
 +  /// Compressed (and potentially encrypted) page size in bytes, not including this header
 +  3: required i32 compressed_page_size
 +
 +  /// The 32-bit CRC checksum for the page, to be be calculated as follows:
 +  4: optional i32 crc
 +
 +  // Headers for page specific data.  One only will be set.
 +  5: optional DataPageHeader data_page_header;
 +  6: optional IndexPageHeader index_page_header;
 +  7: optional DictionaryPageHeader dictionary_page_header;
 +  8: optional DataPageHeaderV2 data_page_header_v2;
 +}
 +);
 +
 +impl PageHeader {
 +    // reader that skips reading page statistics. obtained by running
 +    // `cargo expand -p parquet --all-features --lib file::metadata::thrift_gen`
 +    // and modifying the impl of `read_thrift`
 +    pub(crate) fn read_thrift_without_stats<'a, R>(prot: &mut R) -> Result<Self>
 +    where
 +        R: ThriftCompactInputProtocol<'a>,
 +    {
 +        let mut type_: Option<PageType> = None;
 +        let mut uncompressed_page_size: Option<i32> = None;
 +        let mut compressed_page_size: Option<i32> = None;
 +        let mut crc: Option<i32> = None;
 +        let mut data_page_header: Option<DataPageHeader> = None;
 +        let mut index_page_header: Option<IndexPageHeader> = None;
 +        let mut dictionary_page_header: Option<DictionaryPageHeader> = None;
 +        let mut data_page_header_v2: Option<DataPageHeaderV2> = None;
 +        let mut last_field_id = 0i16;
 +        loop {
 +            let field_ident = prot.read_field_begin(last_field_id)?;
 +            if field_ident.field_type == FieldType::Stop {
 +                break;
 +            }
 +            match field_ident.id {
 +                1 => {
 +                    let val = PageType::read_thrift(&mut *prot)?;
 +                    type_ = Some(val);
 +                }
 +                2 => {
 +                    let val = i32::read_thrift(&mut *prot)?;
 +                    uncompressed_page_size = Some(val);
 +                }
 +                3 => {
 +                    let val = i32::read_thrift(&mut *prot)?;
 +                    compressed_page_size = Some(val);
 +                }
 +                4 => {
 +                    let val = i32::read_thrift(&mut *prot)?;
 +                    crc = Some(val);
 +                }
 +                5 => {
 +                    let val = DataPageHeader::read_thrift_without_stats(&mut *prot)?;
 +                    data_page_header = Some(val);
 +                }
 +                6 => {
 +                    let val = IndexPageHeader::read_thrift(&mut *prot)?;
 +                    index_page_header = Some(val);
 +                }
 +                7 => {
 +                    let val = DictionaryPageHeader::read_thrift(&mut *prot)?;
 +                    dictionary_page_header = Some(val);
 +                }
 +                8 => {
 +                    let val = DataPageHeaderV2::read_thrift_without_stats(&mut *prot)?;
 +                    data_page_header_v2 = Some(val);
 +                }
 +                _ => {
 +                    prot.skip(field_ident.field_type)?;
 +                }
 +            };
 +            last_field_id = field_ident.id;
 +        }
 +        let Some(type_) = type_ else {
 +            return Err(ParquetError::General(
 +                "Required field type_ is missing".to_owned(),
 +            ));
 +        };
 +        let Some(uncompressed_page_size) = uncompressed_page_size else {
 +            return Err(ParquetError::General(
 +                "Required field uncompressed_page_size is missing".to_owned(),
 +            ));
 +        };
 +        let Some(compressed_page_size) = compressed_page_size else {
 +            return Err(ParquetError::General(
 +                "Required field compressed_page_size is missing".to_owned(),
 +            ));
 +        };
 +        Ok(Self {
 +            type_,
 +            uncompressed_page_size,
 +            compressed_page_size,
 +            crc,
 +            data_page_header,
 +            index_page_header,
 +            dictionary_page_header,
 +            data_page_header_v2,
 +        })
 +    }
 +}
 +
 +/////////////////////////////////////////////////
 +// helper functions for writing file meta data
 +
 +// serialize the bits of the column chunk needed for a thrift ColumnMetaData
 +// struct ColumnMetaData {
 +//   1: required Type type
 +//   2: required list<Encoding> encodings
 +//   3: required list<string> path_in_schema
 +//   4: required CompressionCodec codec
 +//   5: required i64 num_values
 +//   6: required i64 total_uncompressed_size
 +//   7: required i64 total_compressed_size
 +//   8: optional list<KeyValue> key_value_metadata
 +//   9: required i64 data_page_offset
 +//   10: optional i64 index_page_offset
 +//   11: optional i64 dictionary_page_offset
 +//   12: optional Statistics statistics;
 +//   13: optional list<PageEncodingStats> encoding_stats;
 +//   14: optional i64 bloom_filter_offset;
 +//   15: optional i32 bloom_filter_length;
 +//   16: optional SizeStatistics size_statistics;
 +//   17: optional GeospatialStatistics geospatial_statistics;
 +// }
 +pub(crate) fn serialize_column_meta_data<W: Write>(
 +    column_chunk: &ColumnChunkMetaData,
 +    w: &mut ThriftCompactOutputProtocol<W>,
 +) -> Result<()> {
 +    use crate::file::statistics::page_stats_to_thrift;
 +
 +    column_chunk.column_type().write_thrift_field(w, 1, 0)?;
 +    column_chunk.encodings.write_thrift_field(w, 2, 1)?;
 +    let path = column_chunk.column_descr.path().parts();
 +    let path: Vec<&str> = path.iter().map(|v| v.as_str()).collect();
 +    path.write_thrift_field(w, 3, 2)?;
 +    column_chunk.compression.write_thrift_field(w, 4, 3)?;
 +    column_chunk.num_values.write_thrift_field(w, 5, 4)?;
 +    column_chunk
 +        .total_uncompressed_size
 +        .write_thrift_field(w, 6, 5)?;
 +    column_chunk
 +        .total_compressed_size
 +        .write_thrift_field(w, 7, 6)?;
 +    // no key_value_metadata here
 +    let mut last_field_id = column_chunk.data_page_offset.write_thrift_field(w, 9, 7)?;
 +    if let Some(index_page_offset) = column_chunk.index_page_offset {
 +        last_field_id = index_page_offset.write_thrift_field(w, 10, last_field_id)?;
 +    }
 +    if let Some(dictionary_page_offset) = column_chunk.dictionary_page_offset {
 +        last_field_id = dictionary_page_offset.write_thrift_field(w, 11, last_field_id)?;
 +    }
 +    // PageStatistics is the same as thrift Statistics, but writable
 +    let stats = page_stats_to_thrift(column_chunk.statistics());
 +    if let Some(stats) = stats {
 +        last_field_id = stats.write_thrift_field(w, 12, last_field_id)?;
 +    }
 +    if let Some(page_encoding_stats) = column_chunk.page_encoding_stats() {
 +        last_field_id = page_encoding_stats.write_thrift_field(w, 13, last_field_id)?;
 +    }
 +    if let Some(bloom_filter_offset) = column_chunk.bloom_filter_offset {
 +        last_field_id = bloom_filter_offset.write_thrift_field(w, 14, last_field_id)?;
 +    }
 +    if let Some(bloom_filter_length) = column_chunk.bloom_filter_length {
 +        last_field_id = bloom_filter_length.write_thrift_field(w, 15, last_field_id)?;
 +    }
 +
 +    // SizeStatistics
 +    let size_stats = if column_chunk.unencoded_byte_array_data_bytes.is_some()
 +        || column_chunk.repetition_level_histogram.is_some()
 +        || column_chunk.definition_level_histogram.is_some()
 +    {
 +        let repetition_level_histogram = column_chunk
 +            .repetition_level_histogram()
 +            .map(|hist| hist.clone().into_inner());
 +
 +        let definition_level_histogram = column_chunk
 +            .definition_level_histogram()
 +            .map(|hist| hist.clone().into_inner());
 +
 +        Some(SizeStatistics {
 +            unencoded_byte_array_data_bytes: column_chunk.unencoded_byte_array_data_bytes,
 +            repetition_level_histogram,
 +            definition_level_histogram,
 +        })
 +    } else {
 +        None
 +    };
 +    if let Some(size_stats) = size_stats {
-         size_stats.write_thrift_field(w, 16, last_field_id)?;
++        last_field_id = size_stats.write_thrift_field(w, 16, last_field_id)?;
++    }
++
++    if let Some(geo_stats) = column_chunk.geo_statistics() {
++        geo_stats.write_thrift_field(w, 17, last_field_id)?;
 +    }
 +
-     // TODO: field 17 geo spatial stats here
 +    w.write_struct_end()
 +}
 +
 +// temp struct used for writing
 +pub(crate) struct FileMeta<'a> {
 +    pub(crate) file_metadata: &'a crate::file::metadata::FileMetaData,
 +    pub(crate) row_groups: &'a Vec<RowGroupMetaData>,
 +    pub(crate) encryption_algorithm: Option<EncryptionAlgorithm>,
 +    pub(crate) footer_signing_key_metadata: Option<Vec<u8>>,
 +}
 +
 +impl<'a> WriteThrift for FileMeta<'a> {
 +    const ELEMENT_TYPE: ElementType = ElementType::Struct;
 +
 +    fn write_thrift<W: Write>(&self, writer: &mut ThriftCompactOutputProtocol<W>) -> Result<()> {
 +        self.file_metadata
 +            .version
 +            .write_thrift_field(writer, 1, 0)?;
 +
 +        // field 2 is schema. do depth-first traversal of tree, converting to SchemaElement and
 +        // writing along the way.
 +        let root = self.file_metadata.schema_descr().root_schema_ptr();
 +        let schema_len = num_nodes(&root);
 +        writer.write_field_begin(FieldType::List, 2, 1)?;
 +        writer.write_list_begin(ElementType::Struct, schema_len)?;
 +        // recursively write Type nodes as SchemaElements
 +        write_schema(&root, writer)?;
 +
 +        self.file_metadata
 +            .num_rows
 +            .write_thrift_field(writer, 3, 2)?;
 +
 +        // this will call RowGroupMetaData::write_thrift
 +        let mut last_field_id = self.row_groups.write_thrift_field(writer, 4, 3)?;
 +
 +        if let Some(kv_metadata) = self.file_metadata.key_value_metadata() {
 +            last_field_id = kv_metadata.write_thrift_field(writer, 5, last_field_id)?;
 +        }
 +        if let Some(created_by) = self.file_metadata.created_by() {
 +            last_field_id = created_by.write_thrift_field(writer, 6, last_field_id)?;
 +        }
 +        if let Some(column_orders) = self.file_metadata.column_orders() {
 +            last_field_id = column_orders.write_thrift_field(writer, 7, last_field_id)?;
 +        }
 +        if let Some(algo) = self.encryption_algorithm.as_ref() {
 +            last_field_id = algo.write_thrift_field(writer, 8, last_field_id)?;
 +        }
 +        if let Some(key) = self.footer_signing_key_metadata.as_ref() {
 +            key.as_slice()
 +                .write_thrift_field(writer, 9, last_field_id)?;
 +        }
 +
 +        writer.write_struct_end()
 +    }
 +}
 +
 +fn write_schema<W: Write>(
 +    node: &TypePtr,
 +    writer: &mut ThriftCompactOutputProtocol<W>,
 +) -> Result<()> {
 +    match node.as_ref() {
 +        crate::schema::types::Type::PrimitiveType {
 +            basic_info,
 +            physical_type,
 +            type_length,
 +            scale,
 +            precision,
 +        } => {
 +            let element = SchemaElement {
 +                type_: Some(*physical_type),
 +                type_length: if *type_length >= 0 {
 +                    Some(*type_length)
 +                } else {
 +                    None
 +                },
 +                repetition_type: Some(basic_info.repetition()),
 +                name: basic_info.name(),
 +                num_children: None,
 +                converted_type: match basic_info.converted_type() {
 +                    ConvertedType::NONE => None,
 +                    other => Some(other),
 +                },
 +                scale: if *scale >= 0 { Some(*scale) } else { None },
 +                precision: if *precision >= 0 {
 +                    Some(*precision)
 +                } else {
 +                    None
 +                },
 +                field_id: if basic_info.has_id() {
 +                    Some(basic_info.id())
 +                } else {
 +                    None
 +                },
 +                logical_type: basic_info.logical_type(),
 +            };
 +            element.write_thrift(writer)
 +        }
 +        crate::schema::types::Type::GroupType { basic_info, fields } => {
 +            let repetition = if basic_info.has_repetition() {
 +                Some(basic_info.repetition())
 +            } else {
 +                None
 +            };
 +
 +            let element = SchemaElement {
 +                type_: None,
 +                type_length: None,
 +                repetition_type: repetition,
 +                name: basic_info.name(),
 +                num_children: Some(fields.len().try_into()?),
 +                converted_type: match basic_info.converted_type() {
 +                    ConvertedType::NONE => None,
 +                    other => Some(other),
 +                },
 +                scale: None,
 +                precision: None,
 +                field_id: if basic_info.has_id() {
 +                    Some(basic_info.id())
 +                } else {
 +                    None
 +                },
 +                logical_type: basic_info.logical_type(),
 +            };
 +
 +            element.write_thrift(writer)?;
 +
 +            // Add child elements for a group
 +            for field in fields {
 +                write_schema(field, writer)?;
 +            }
 +            Ok(())
 +        }
 +    }
 +}
 +
 +// struct RowGroup {
 +//   1: required list<ColumnChunk> columns
 +//   2: required i64 total_byte_size
 +//   3: required i64 num_rows
 +//   4: optional list<SortingColumn> sorting_columns
 +//   5: optional i64 file_offset
 +//   6: optional i64 total_compressed_size
 +//   7: optional i16 ordinal
 +// }
 +impl WriteThrift for RowGroupMetaData {
 +    const ELEMENT_TYPE: ElementType = ElementType::Struct;
 +
 +    fn write_thrift<W: Write>(&self, writer: &mut ThriftCompactOutputProtocol<W>) -> Result<()> {
 +        // this will call ColumnChunkMetaData::write_thrift
 +        self.columns.write_thrift_field(writer, 1, 0)?;
 +        self.total_byte_size.write_thrift_field(writer, 2, 1)?;
 +        let mut last_field_id = self.num_rows.write_thrift_field(writer, 3, 2)?;
 +        if let Some(sorting_columns) = self.sorting_columns() {
 +            last_field_id = sorting_columns.write_thrift_field(writer, 4, last_field_id)?;
 +        }
 +        if let Some(file_offset) = self.file_offset() {
 +            last_field_id = file_offset.write_thrift_field(writer, 5, last_field_id)?;
 +        }
 +        // this is optional, but we'll always write it
 +        last_field_id = self
 +            .compressed_size()
 +            .write_thrift_field(writer, 6, last_field_id)?;
 +        if let Some(ordinal) = self.ordinal() {
 +            ordinal.write_thrift_field(writer, 7, last_field_id)?;
 +        }
 +        writer.write_struct_end()
 +    }
 +}
 +
 +// struct ColumnChunk {
 +//   1: optional string file_path
 +//   2: required i64 file_offset = 0
 +//   3: optional ColumnMetaData meta_data
 +//   4: optional i64 offset_index_offset
 +//   5: optional i32 offset_index_length
 +//   6: optional i64 column_index_offset
 +//   7: optional i32 column_index_length
 +//   8: optional ColumnCryptoMetaData crypto_metadata
 +//   9: optional binary encrypted_column_metadata
 +// }
 +impl WriteThrift for ColumnChunkMetaData {
 +    const ELEMENT_TYPE: ElementType = ElementType::Struct;
 +
 +    #[allow(unused_assignments)]
 +    fn write_thrift<W: Write>(&self, writer: &mut ThriftCompactOutputProtocol<W>) -> Result<()> {
 +        let mut last_field_id = 0i16;
 +        if let Some(file_path) = self.file_path() {
 +            last_field_id = file_path.write_thrift_field(writer, 1, last_field_id)?;
 +        }
 +        last_field_id = self
 +            .file_offset()
 +            .write_thrift_field(writer, 2, last_field_id)?;
 +
 +        #[cfg(feature = "encryption")]
 +        {
 +            // only write the ColumnMetaData if we haven't already encrypted it
 +            if self.encrypted_column_metadata.is_none() {
 +                writer.write_field_begin(FieldType::Struct, 3, last_field_id)?;
 +                serialize_column_meta_data(self, writer)?;
 +                last_field_id = 3;
 +            }
 +        }
 +        #[cfg(not(feature = "encryption"))]
 +        {
 +            // always write the ColumnMetaData
 +            writer.write_field_begin(FieldType::Struct, 3, last_field_id)?;
 +            serialize_column_meta_data(self, writer)?;
 +            last_field_id = 3;
 +        }
 +
 +        if let Some(offset_idx_off) = self.offset_index_offset() {
 +            last_field_id = offset_idx_off.write_thrift_field(writer, 4, last_field_id)?;
 +        }
 +        if let Some(offset_idx_len) = self.offset_index_length() {
 +            last_field_id = offset_idx_len.write_thrift_field(writer, 5, last_field_id)?;
 +        }
 +        if let Some(column_idx_off) = self.column_index_offset() {
 +            last_field_id = column_idx_off.write_thrift_field(writer, 6, last_field_id)?;
 +        }
 +        if let Some(column_idx_len) = self.column_index_length() {
 +            last_field_id = column_idx_len.write_thrift_field(writer, 7, last_field_id)?;
 +        }
 +        #[cfg(feature = "encryption")]
 +        {
 +            if let Some(crypto_metadata) = self.crypto_metadata() {
 +                last_field_id = crypto_metadata.write_thrift_field(writer, 8, last_field_id)?;
 +            }
 +            if let Some(encrypted_meta) = self.encrypted_column_metadata.as_ref() {
 +                encrypted_meta
 +                    .as_slice()
 +                    .write_thrift_field(writer, 9, last_field_id)?;
 +            }
 +        }
 +
 +        writer.write_struct_end()
 +    }
 +}
 +
++// struct GeospatialStatistics {
++//   1: optional BoundingBox bbox;
++//   2: optional list<i32> geospatial_types;
++// }
++impl WriteThrift for crate::geospatial::statistics::GeospatialStatistics {
++    const ELEMENT_TYPE: ElementType = ElementType::Struct;
++
++    fn write_thrift<W: Write>(&self, writer: &mut ThriftCompactOutputProtocol<W>) -> Result<()> {
++        let mut last_field_id = 0i16;
++        if let Some(bbox) = self.bbox() {
++            last_field_id = bbox.write_thrift_field(writer, 1, last_field_id)?;
++        }
++        if let Some(geo_types) = self.geospatial_types() {
++            geo_types.write_thrift_field(writer, 2, last_field_id)?;
++        }
++
++        writer.write_struct_end()
++    }
++}
++
++impl WriteThriftField for crate::geospatial::statistics::GeospatialStatistics {
++    fn write_thrift_field<W: Write>(
++        &self,
++        writer: &mut ThriftCompactOutputProtocol<W>,
++        field_id: i16,
++        last_field_id: i16,
++    ) -> Result<i16> {
++        writer.write_field_begin(FieldType::Struct, field_id, last_field_id)?;
++        self.write_thrift(writer)?;
++        Ok(field_id)
++    }
++}
++
++// struct BoundingBox {
++//   1: required double xmin;
++//   2: required double xmax;
++//   3: required double ymin;
++//   4: required double ymax;
++//   5: optional double zmin;
++//   6: optional double zmax;
++//   7: optional double mmin;
++//   8: optional double mmax;
++// }
++impl WriteThrift for crate::geospatial::bounding_box::BoundingBox {
++    const ELEMENT_TYPE: ElementType = ElementType::Struct;
++
++    fn write_thrift<W: Write>(&self, writer: &mut ThriftCompactOutputProtocol<W>) -> Result<()> {
++        self.get_xmin().write_thrift_field(writer, 1, 0)?;
++        self.get_xmax().write_thrift_field(writer, 2, 1)?;
++        self.get_ymin().write_thrift_field(writer, 3, 2)?;
++        let mut last_field_id = self.get_ymax().write_thrift_field(writer, 4, 3)?;
++
++        if let Some(zmin) = self.get_zmin() {
++            last_field_id = zmin.write_thrift_field(writer, 5, last_field_id)?;
++        }
++        if let Some(zmax) = self.get_zmax() {
++            last_field_id = zmax.write_thrift_field(writer, 6, last_field_id)?;
++        }
++        if let Some(mmin) = self.get_mmin() {
++            last_field_id = mmin.write_thrift_field(writer, 7, last_field_id)?;
++        }
++        if let Some(mmax) = self.get_mmax() {
++            mmax.write_thrift_field(writer, 8, last_field_id)?;
++        }
++
++        writer.write_struct_end()
++    }
++}
++
++impl WriteThriftField for crate::geospatial::bounding_box::BoundingBox {
++    fn write_thrift_field<W: Write>(
++        &self,
++        writer: &mut ThriftCompactOutputProtocol<W>,
++        field_id: i16,
++        last_field_id: i16,
++    ) -> Result<i16> {
++        writer.write_field_begin(FieldType::Struct, field_id, last_field_id)?;
++        self.write_thrift(writer)?;
++        Ok(field_id)
++    }
++}
++
 +#[cfg(test)]
 +mod tests {
 +    use crate::file::metadata::thrift_gen::BoundingBox;
 +    use crate::parquet_thrift::tests::test_roundtrip;
 +
 +    #[test]
 +    fn test_bounding_box_roundtrip() {
 +        test_roundtrip(BoundingBox {
 +            xmin: 0.1.into(),
 +            xmax: 10.3.into(),
 +            ymin: 0.001.into(),
 +            ymax: 128.5.into(),
 +            zmin: None,
 +            zmax: None,
 +            mmin: None,
 +            mmax: None,
 +        });
 +
 +        test_roundtrip(BoundingBox {
 +            xmin: 0.1.into(),
 +            xmax: 10.3.into(),
 +            ymin: 0.001.into(),
 +            ymax: 128.5.into(),
 +            zmin: Some(11.0.into()),
 +            zmax: Some(1300.0.into()),
 +            mmin: None,
 +            mmax: None,
 +        });
 +
 +        test_roundtrip(BoundingBox {
 +            xmin: 0.1.into(),
 +            xmax: 10.3.into(),
 +            ymin: 0.001.into(),
 +            ymax: 128.5.into(),
 +            zmin: Some(11.0.into()),
 +            zmax: Some(1300.0.into()),
 +            mmin: Some(3.7.into()),
 +            mmax: Some(42.0.into()),
 +        });
 +    }
 +}
diff --cc parquet/src/geospatial/bounding_box.rs
index 0000000000,7d9eb58d00..aa6798eb8d
mode 000000,100644..100644
--- a/parquet/src/geospatial/bounding_box.rs
+++ b/parquet/src/geospatial/bounding_box.rs
@@@ -1,0 -1,413 +1,233 @@@
+ // Licensed to the Apache Software Foundation (ASF) under one
+ // or more contributor license agreements.  See the NOTICE file
+ // distributed with this work for additional information
+ // regarding copyright ownership.  The ASF licenses this file
+ // to you under the Apache License, Version 2.0 (the
+ // "License"); you may not use this file except in compliance
+ // with the License.  You may obtain a copy of the License at
+ //
+ //   http://www.apache.org/licenses/LICENSE-2.0
+ //
+ // Unless required by applicable law or agreed to in writing,
+ // software distributed under the License is distributed on an
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ // KIND, either express or implied.  See the License for the
+ // specific language governing permissions and limitations
+ // under the License.
+ 
+ //! Bounding box for GEOMETRY or GEOGRAPHY type in the representation of min/max
+ //! value pair of coordinates from each axis.
+ //!
+ //! Derived from the parquet format spec: <https://github.com/apache/parquet-format/blob/master/Geospatial.md>
+ //!
+ //!
+ use crate::format as parquet;
+ 
+ /// A geospatial instance has at least two coordinate dimensions: X and Y for 2D coordinates of each point.
+ /// X represents longitude/easting and Y represents latitude/northing. A geospatial instance can optionally
+ /// have Z and/or M values associated with each point.
+ ///
+ /// The Z values introduce the third dimension coordinate, typically used to indicate height or elevation.
+ ///
+ /// M values allow tracking a value in a fourth dimension. These can represent:
+ /// - Linear reference values (e.g., highway milepost)
+ /// - Timestamps
+ /// - Other values defined by the CRS
+ ///
+ /// The bounding box is defined as min/max value pairs of coordinates from each axis. X and Y values are
+ /// always present, while Z and M are omitted for 2D geospatial instances.
+ ///
+ /// When calculating a bounding box:
+ /// - Null or NaN values in a coordinate dimension are skipped
+ /// - If a dimension has only null/NaN values, that dimension is omitted
+ /// - If either X or Y dimension is missing, no bounding box is produced
+ /// - Example: POINT (1 NaN) contributes to X but not to Y, Z, or M dimensions
+ ///
+ /// Special cases:
+ /// - For X values only, xmin may exceed xmax. In this case, a point matches if x >= xmin OR x <= xmax
+ /// - This wraparound can occur when the bounding box crosses the antimeridian line.
+ /// - In geographic terms: xmin=westernmost, xmax=easternmost, ymin=southernmost, ymax=northernmost
+ ///
+ /// For GEOGRAPHY types:
+ /// - X values must be within [-180, 180] (longitude)
+ /// - Y values must be within [-90, 90] (latitude)
+ ///
+ /// Derived from the parquet format [spec][bounding-box-spec]
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// use parquet::geospatial::bounding_box::BoundingBox;
+ ///
+ /// // 2D bounding box
+ /// let bbox_2d = BoundingBox::new(0.0, 0.0, 100.0, 100.0);
+ ///
+ /// // 3D bounding box with elevation
+ /// let bbox_3d = BoundingBox::new(0.0, 0.0, 100.0, 100.0)
+ ///     .with_zrange(0.0, 1000.0);
+ ///
+ /// // 3D bounding box with elevation and measured value
+ /// let bbox_3d_m = BoundingBox::new(0.0, 0.0, 100.0, 100.0)
+ ///     .with_zrange(0.0, 1000.0)
+ ///     .with_mrange(0.0, 1000.0);
+ /// ```
+ ///
+ /// [bounding-box-spec]: https://github.com/apache/parquet-format/blob/master/Geospatial.md#bounding-box
+ #[derive(Clone, Debug, PartialEq)]
+ pub struct BoundingBox {
+     /// X coordinates (longitude or easting): (min, max)
+     x_range: (f64, f64),
+     /// Y coordinates (latitude or northing): (min, max)
+     y_range: (f64, f64),
+     /// Z coordinates (elevation/height): (min, max), if present
+     z_range: Option<(f64, f64)>,
+     /// M coordinates (measured value): (min, max), if present
+     m_range: Option<(f64, f64)>,
+ }
+ 
+ impl BoundingBox {
+     /// Creates a new bounding box with the specified coordinates.
+     pub fn new(xmin: f64, xmax: f64, ymin: f64, ymax: f64) -> Self {
+         Self {
+             x_range: (xmin, xmax),
+             y_range: (ymin, ymax),
+             z_range: None,
+             m_range: None,
+         }
+     }
+ 
+     /// Updates the bounding box with specified X-coordinate range.
+     pub fn with_xrange(mut self, xmin: f64, xmax: f64) -> Self {
+         self.x_range = (xmin, xmax);
+         self
+     }
+ 
+     /// Updates the bounding box with specified Y-coordinate range.
+     pub fn with_yrange(mut self, ymin: f64, ymax: f64) -> Self {
+         self.y_range = (ymin, ymax);
+         self
+     }
+ 
+     /// Creates a new bounding box with the specified Z-coordinate range.
+     pub fn with_zrange(mut self, zmin: f64, zmax: f64) -> Self {
+         self.z_range = Some((zmin, zmax));
+         self
+     }
+ 
+     /// Creates a new bounding box with the specified M-coordinate range.
+     pub fn with_mrange(mut self, mmin: f64, mmax: f64) -> Self {
+         self.m_range = Some((mmin, mmax));
+         self
+     }
+ 
+     /// Returns the minimum x-coordinate.
+     pub fn get_xmin(&self) -> f64 {
+         self.x_range.0
+     }
+ 
+     /// Returns the maximum x-coordinate.
+     pub fn get_xmax(&self) -> f64 {
+         self.x_range.1
+     }
+ 
+     /// Returns the minimum y-coordinate.
+     pub fn get_ymin(&self) -> f64 {
+         self.y_range.0
+     }
+ 
+     /// Returns the maximum y-coordinate.
+     pub fn get_ymax(&self) -> f64 {
+         self.y_range.1
+     }
+ 
+     /// Returns the minimum z-coordinate, if present.
+     pub fn get_zmin(&self) -> Option<f64> {
+         self.z_range.map(|z| z.0)
+     }
+ 
+     /// Returns the maximum z-coordinate, if present.
+     pub fn get_zmax(&self) -> Option<f64> {
+         self.z_range.map(|z| z.1)
+     }
+ 
+     /// Returns the minimum m-value (measure), if present.
+     pub fn get_mmin(&self) -> Option<f64> {
+         self.m_range.map(|m| m.0)
+     }
+ 
+     /// Returns the maximum m-value (measure), if present.
+     pub fn get_mmax(&self) -> Option<f64> {
+         self.m_range.map(|m| m.1)
+     }
+ 
+     /// Returns `true` if both zmin and zmax are present.
+     pub fn is_z_valid(&self) -> bool {
+         self.z_range.is_some()
+     }
+ 
+     /// Returns `true` if both mmin and mmax are present.
+     pub fn is_m_valid(&self) -> bool {
+         self.m_range.is_some()
+     }
+ }
+ 
+ impl From<BoundingBox> for parquet::BoundingBox {
+     /// Converts our internal `BoundingBox` to the Thrift-generated format.
+     fn from(b: BoundingBox) -> parquet::BoundingBox {
+         parquet::BoundingBox {
+             xmin: b.x_range.0.into(),
+             xmax: b.x_range.1.into(),
+             ymin: b.y_range.0.into(),
+             ymax: b.y_range.1.into(),
+             zmin: b.z_range.map(|z| z.0.into()),
+             zmax: b.z_range.map(|z| z.1.into()),
+             mmin: b.m_range.map(|m| m.0.into()),
+             mmax: b.m_range.map(|m| m.1.into()),
+         }
+     }
+ }
+ 
 -impl From<parquet::BoundingBox> for BoundingBox {
 -    fn from(bbox: parquet::BoundingBox) -> Self {
 -        let mut new_bbox = Self::new(
 -            bbox.xmin.into(),
 -            bbox.xmax.into(),
 -            bbox.ymin.into(),
 -            bbox.ymax.into(),
 -        );
 -
 -        new_bbox = match (bbox.zmin, bbox.zmax) {
 -            (Some(zmin), Some(zmax)) => new_bbox.with_zrange(zmin.into(), zmax.into()),
 -            // If either None or mismatch, leave it as None and don't error
 -            _ => new_bbox,
 -        };
 -
 -        new_bbox = match (bbox.mmin, bbox.mmax) {
 -            (Some(mmin), Some(mmax)) => new_bbox.with_mrange(mmin.into(), mmax.into()),
 -            // If either None or mismatch, leave it as None and don't error
 -            _ => new_bbox,
 -        };
 -
 -        new_bbox
 -    }
 -}
 -
+ #[cfg(test)]
+ mod tests {
+     use super::*;
+ 
+     #[test]
+     fn test_bounding_box() {
+         let bbox = BoundingBox::new(0.0, 0.0, 10.0, 10.0);
+         assert_eq!(bbox.get_xmin(), 0.0);
+         assert_eq!(bbox.get_xmax(), 0.0);
+         assert_eq!(bbox.get_ymin(), 10.0);
+         assert_eq!(bbox.get_ymax(), 10.0);
+         assert_eq!(bbox.get_zmin(), None);
+         assert_eq!(bbox.get_zmax(), None);
+         assert_eq!(bbox.get_mmin(), None);
+         assert_eq!(bbox.get_mmax(), None);
+         assert!(!bbox.is_z_valid());
+         assert!(!bbox.is_m_valid());
+ 
+         // test with zrange
+         let bbox_z = BoundingBox::new(0.0, 0.0, 10.0, 10.0).with_zrange(5.0, 15.0);
+         assert_eq!(bbox_z.get_zmin(), Some(5.0));
+         assert_eq!(bbox_z.get_zmax(), Some(15.0));
+         assert!(bbox_z.is_z_valid());
+         assert!(!bbox_z.is_m_valid());
+ 
+         // test with mrange
+         let bbox_m = BoundingBox::new(0.0, 0.0, 10.0, 10.0).with_mrange(10.0, 20.0);
+         assert_eq!(bbox_m.get_mmin(), Some(10.0));
+         assert_eq!(bbox_m.get_mmax(), Some(20.0));
+         assert!(!bbox_m.is_z_valid());
+         assert!(bbox_m.is_m_valid());
+ 
+         // test with zrange and mrange
+         let bbox_zm = BoundingBox::new(0.0, 0.0, 10.0, 10.0)
+             .with_zrange(5.0, 15.0)
+             .with_mrange(10.0, 20.0);
+         assert_eq!(bbox_zm.get_zmin(), Some(5.0));
+         assert_eq!(bbox_zm.get_zmax(), Some(15.0));
+         assert_eq!(bbox_zm.get_mmin(), Some(10.0));
+         assert_eq!(bbox_zm.get_mmax(), Some(20.0));
+         assert!(bbox_zm.is_z_valid());
+         assert!(bbox_zm.is_m_valid());
+     }
 -
 -    #[test]
 -    fn test_bounding_box_to_thrift() {
 -        use thrift::OrderedFloat;
 -
 -        let bbox = BoundingBox::new(0.0, 0.0, 10.0, 10.0);
 -        let thrift_bbox: parquet::BoundingBox = bbox.into();
 -        assert_eq!(thrift_bbox.xmin, 0.0);
 -        assert_eq!(thrift_bbox.xmax, 0.0);
 -        assert_eq!(thrift_bbox.ymin, 10.0);
 -        assert_eq!(thrift_bbox.ymax, 10.0);
 -        assert_eq!(thrift_bbox.zmin, None);
 -        assert_eq!(thrift_bbox.zmax, None);
 -        assert_eq!(thrift_bbox.mmin, None);
 -        assert_eq!(thrift_bbox.mmax, None);
 -
 -        let bbox_z = BoundingBox::new(0.0, 0.0, 10.0, 10.0).with_zrange(5.0, 15.0);
 -        let thrift_bbox_z: parquet::BoundingBox = bbox_z.into();
 -        assert_eq!(thrift_bbox_z.zmin, Some(OrderedFloat(5.0)));
 -        assert_eq!(thrift_bbox_z.zmax, Some(OrderedFloat(15.0)));
 -        assert_eq!(thrift_bbox_z.mmin, None);
 -        assert_eq!(thrift_bbox_z.mmax, None);
 -
 -        let bbox_m = BoundingBox::new(0.0, 0.0, 10.0, 10.0).with_mrange(10.0, 20.0);
 -        let thrift_bbox_m: parquet::BoundingBox = bbox_m.into();
 -        assert_eq!(thrift_bbox_m.zmin, None);
 -        assert_eq!(thrift_bbox_m.zmax, None);
 -        assert_eq!(thrift_bbox_m.mmin, Some(OrderedFloat(10.0)));
 -        assert_eq!(thrift_bbox_m.mmax, Some(OrderedFloat(20.0)));
 -
 -        let bbox_z_m = BoundingBox::new(0.0, 0.0, 10.0, 10.0)
 -            .with_zrange(5.0, 15.0)
 -            .with_mrange(10.0, 20.0);
 -        let thrift_bbox_zm: parquet::BoundingBox = bbox_z_m.into();
 -        assert_eq!(thrift_bbox_zm.zmin, Some(OrderedFloat(5.0)));
 -        assert_eq!(thrift_bbox_zm.zmax, Some(OrderedFloat(15.0)));
 -        assert_eq!(thrift_bbox_zm.mmin, Some(OrderedFloat(10.0)));
 -        assert_eq!(thrift_bbox_zm.mmax, Some(OrderedFloat(20.0)));
 -    }
 -
 -    #[test]
 -    fn test_bounding_box_from_thrift() {
 -        use thrift::OrderedFloat;
 -
 -        let thrift_bbox = parquet::BoundingBox {
 -            xmin: OrderedFloat(0.0),
 -            xmax: OrderedFloat(0.0),
 -            ymin: OrderedFloat(10.0),
 -            ymax: OrderedFloat(10.0),
 -            zmin: None,
 -            zmax: None,
 -            mmin: None,
 -            mmax: None,
 -        };
 -        let bbox: BoundingBox = thrift_bbox.into();
 -        assert_eq!(bbox.get_xmin(), 0.0);
 -        assert_eq!(bbox.get_xmax(), 0.0);
 -        assert_eq!(bbox.get_ymin(), 10.0);
 -        assert_eq!(bbox.get_ymax(), 10.0);
 -        assert_eq!(bbox.get_zmin(), None);
 -        assert_eq!(bbox.get_zmax(), None);
 -        assert_eq!(bbox.get_mmin(), None);
 -        assert_eq!(bbox.get_mmax(), None);
 -
 -        let thrift_bbox_z = parquet::BoundingBox {
 -            xmin: OrderedFloat(0.0),
 -            xmax: OrderedFloat(0.0),
 -            ymin: OrderedFloat(10.0),
 -            ymax: OrderedFloat(10.0),
 -            zmin: Some(OrderedFloat(130.0)),
 -            zmax: Some(OrderedFloat(130.0)),
 -            mmin: None,
 -            mmax: None,
 -        };
 -        let bbox_z: BoundingBox = thrift_bbox_z.into();
 -        assert_eq!(bbox_z.get_xmin(), 0.0);
 -        assert_eq!(bbox_z.get_xmax(), 0.0);
 -        assert_eq!(bbox_z.get_ymin(), 10.0);
 -        assert_eq!(bbox_z.get_ymax(), 10.0);
 -        assert_eq!(bbox_z.get_zmin(), Some(130.0));
 -        assert_eq!(bbox_z.get_zmax(), Some(130.0));
 -        assert_eq!(bbox_z.get_mmin(), None);
 -        assert_eq!(bbox_z.get_mmax(), None);
 -
 -        let thrift_bbox_m = parquet::BoundingBox {
 -            xmin: OrderedFloat(0.0),
 -            xmax: OrderedFloat(0.0),
 -            ymin: OrderedFloat(10.0),
 -            ymax: OrderedFloat(10.0),
 -            zmin: None,
 -            zmax: None,
 -            mmin: Some(OrderedFloat(120.0)),
 -            mmax: Some(OrderedFloat(120.0)),
 -        };
 -        let bbox_m: BoundingBox = thrift_bbox_m.into();
 -        assert_eq!(bbox_m.get_xmin(), 0.0);
 -        assert_eq!(bbox_m.get_xmax(), 0.0);
 -        assert_eq!(bbox_m.get_ymin(), 10.0);
 -        assert_eq!(bbox_m.get_ymax(), 10.0);
 -        assert_eq!(bbox_m.get_zmin(), None);
 -        assert_eq!(bbox_m.get_zmax(), None);
 -        assert_eq!(bbox_m.get_mmin(), Some(120.0));
 -        assert_eq!(bbox_m.get_mmax(), Some(120.0));
 -
 -        let thrift_bbox_zm = parquet::BoundingBox {
 -            xmin: OrderedFloat(0.0),
 -            xmax: OrderedFloat(0.0),
 -            ymin: OrderedFloat(10.0),
 -            ymax: OrderedFloat(10.0),
 -            zmin: Some(OrderedFloat(130.0)),
 -            zmax: Some(OrderedFloat(130.0)),
 -            mmin: Some(OrderedFloat(120.0)),
 -            mmax: Some(OrderedFloat(120.0)),
 -        };
 -
 -        let bbox_zm: BoundingBox = thrift_bbox_zm.into();
 -        assert_eq!(bbox_zm.get_xmin(), 0.0);
 -        assert_eq!(bbox_zm.get_xmax(), 0.0);
 -        assert_eq!(bbox_zm.get_ymin(), 10.0);
 -        assert_eq!(bbox_zm.get_ymax(), 10.0);
 -        assert_eq!(bbox_zm.get_zmin(), Some(130.0));
 -        assert_eq!(bbox_zm.get_zmax(), Some(130.0));
 -        assert_eq!(bbox_zm.get_mmin(), Some(120.0));
 -        assert_eq!(bbox_zm.get_mmax(), Some(120.0));
 -    }
 -
 -    #[test]
 -    fn test_bounding_box_thrift_roundtrip() {
 -        use thrift::OrderedFloat;
 -
 -        let thrift_bbox = parquet::BoundingBox {
 -            xmin: OrderedFloat(0.0),
 -            xmax: OrderedFloat(0.0),
 -            ymin: OrderedFloat(10.0),
 -            ymax: OrderedFloat(10.0),
 -            zmin: Some(OrderedFloat(130.0)),
 -            zmax: Some(OrderedFloat(130.0)),
 -            mmin: Some(OrderedFloat(120.0)),
 -            mmax: Some(OrderedFloat(120.0)),
 -        };
 -
 -        // cloning to make sure it's not moved
 -        let bbox: BoundingBox = thrift_bbox.clone().into();
 -        assert_eq!(bbox.get_xmin(), 0.0);
 -        assert_eq!(bbox.get_xmax(), 0.0);
 -        assert_eq!(bbox.get_ymin(), 10.0);
 -        assert_eq!(bbox.get_ymax(), 10.0);
 -        assert_eq!(bbox.get_zmin(), Some(130.0));
 -        assert_eq!(bbox.get_zmax(), Some(130.0));
 -        assert_eq!(bbox.get_mmin(), Some(120.0));
 -        assert_eq!(bbox.get_mmax(), Some(120.0));
 -
 -        let thrift_bbox_2: parquet::BoundingBox = bbox.into();
 -        assert_eq!(thrift_bbox_2, thrift_bbox);
 -    }
+ }
diff --cc parquet/src/geospatial/statistics.rs
index 0000000000,2a39c494bd..6d7cd030f4
mode 000000,100644..100644
--- a/parquet/src/geospatial/statistics.rs
+++ b/parquet/src/geospatial/statistics.rs
@@@ -1,0 -1,164 +1,145 @@@
+ // Licensed to the Apache Software Foundation (ASF) under one
+ // or more contributor license agreements.  See the NOTICE file
+ // distributed with this work for additional information
+ // regarding copyright ownership.  The ASF licenses this file
+ // to you under the Apache License, Version 2.0 (the
+ // "License"); you may not use this file except in compliance
+ // with the License.  You may obtain a copy of the License at
+ //
+ //   http://www.apache.org/licenses/LICENSE-2.0
+ //
+ // Unless required by applicable law or agreed to in writing,
+ // software distributed under the License is distributed on an
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ // KIND, either express or implied.  See the License for the
+ // specific language governing permissions and limitations
+ // under the License.
+ 
+ //! Geospatial statistics for Parquet files.
+ //!
+ //! This module provides functionality for working with geospatial statistics in Parquet files.
+ //! It includes support for bounding boxes and geospatial statistics in column chunk metadata.
+ 
+ use crate::format::GeospatialStatistics as TGeospatialStatistics;
+ use crate::geospatial::bounding_box::BoundingBox;
+ 
+ // ----------------------------------------------------------------------
+ // Geospatial Statistics
+ 
+ /// Represents geospatial statistics for a Parquet column or dataset.
+ ///
+ /// This struct contains metadata about the spatial characteristics of geospatial data,
+ /// including bounding box information and the types of geospatial geometries present.
+ /// It's used to optimize spatial queries and provide spatial context for data analysis.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// use parquet::geospatial::statistics::GeospatialStatistics;
+ /// use parquet::geospatial::bounding_box::BoundingBox;
+ ///
+ /// // Statistics with bounding box
+ /// let bbox = BoundingBox::new(0.0, 0.0, 100.0, 100.0);
+ /// let stats = GeospatialStatistics::new(Some(bbox), Some(vec![1, 2, 3]));
+ /// ```
+ #[derive(Clone, Debug, PartialEq, Default)]
+ pub struct GeospatialStatistics {
+     /// Optional bounding defining the spatial extent, where None represents a lack of information.
+     bbox: Option<BoundingBox>,
+     /// Optional list of geometry type identifiers, where None represents lack of information
+     geospatial_types: Option<Vec<i32>>,
+ }
+ 
+ impl GeospatialStatistics {
+     /// Creates a new geospatial statistics instance with the specified data.
+     pub fn new(bbox: Option<BoundingBox>, geospatial_types: Option<Vec<i32>>) -> Self {
+         Self {
+             bbox,
+             geospatial_types,
+         }
+     }
 -}
+ 
 -/// Converts a Thrift-generated geospatial statistics object to the internal representation.
 -pub fn from_thrift(geo_statistics: Option<TGeospatialStatistics>) -> Option<GeospatialStatistics> {
 -    let geo_stats = geo_statistics?;
 -    let bbox = geo_stats.bbox.map(|bbox| bbox.into());
 -    // If vector is empty, then set it to None
 -    let geospatial_types: Option<Vec<i32>> = geo_stats.geospatial_types.filter(|v| !v.is_empty());
 -    Some(GeospatialStatistics::new(bbox, geospatial_types))
++    /// Return the optional `BoundingBox`.
++    pub fn bbox(&self) -> Option<&BoundingBox> {
++        self.bbox.as_ref()
++    }
++
++    /// Return the optional list of geospatial types.
++    pub fn geospatial_types(&self) -> Option<&Vec<i32>> {
++        self.geospatial_types.as_ref()
++    }
+ }
+ 
+ /// Converts our internal geospatial statistics to the Thrift-generated format.
+ pub fn to_thrift(geo_statistics: Option<&GeospatialStatistics>) -> Option<TGeospatialStatistics> {
+     let geo_stats = geo_statistics?;
+     let bbox = geo_stats.bbox.clone().map(|bbox| bbox.into());
+     let geospatial_types = geo_stats.geospatial_types.clone();
+     Some(TGeospatialStatistics::new(bbox, geospatial_types))
+ }
+ 
+ #[cfg(test)]
+ mod tests {
+     use super::*;
+ 
 -    /// Tests the conversion from Thrift format when no statistics are provided.
 -    #[test]
 -    fn test_from_thrift() {
 -        assert_eq!(from_thrift(None), None);
 -        assert_eq!(
 -            from_thrift(Some(TGeospatialStatistics::new(None, None))),
 -            Some(GeospatialStatistics::default())
 -        );
 -    }
 -
 -    /// Tests the conversion from Thrift format with actual geospatial data.
 -    #[test]
 -    fn test_geo_statistics_from_thrift() {
 -        let bbox = BoundingBox::new(0.0, 0.0, 100.0, 100.0);
 -        let geospatial_types = vec![1, 2, 3];
 -        let stats = GeospatialStatistics::new(Some(bbox), Some(geospatial_types));
 -        let thrift_stats = to_thrift(Some(&stats));
 -        assert_eq!(from_thrift(thrift_stats), Some(stats));
 -    }
 -
+     #[test]
+     fn test_bbox_to_thrift() {
+         use crate::format as parquet;
+         use thrift::OrderedFloat;
+ 
+         let bbox = BoundingBox::new(0.0, 0.0, 100.0, 100.0);
+         let thrift_bbox: parquet::BoundingBox = bbox.into();
+         assert_eq!(thrift_bbox.xmin, 0.0);
+         assert_eq!(thrift_bbox.xmax, 0.0);
+         assert_eq!(thrift_bbox.ymin, 100.0);
+         assert_eq!(thrift_bbox.ymax, 100.0);
+         assert_eq!(thrift_bbox.zmin, None);
+         assert_eq!(thrift_bbox.zmax, None);
+         assert_eq!(thrift_bbox.mmin, None);
+         assert_eq!(thrift_bbox.mmax, None);
+ 
+         let bbox_z = BoundingBox::new(0.0, 0.0, 100.0, 100.0).with_zrange(5.0, 15.0);
+         let thrift_bbox_z: parquet::BoundingBox = bbox_z.into();
+         assert_eq!(thrift_bbox_z.zmin, Some(OrderedFloat(5.0)));
+         assert_eq!(thrift_bbox_z.zmax, Some(OrderedFloat(15.0)));
+ 
+         let bbox_m = BoundingBox::new(0.0, 0.0, 100.0, 100.0).with_mrange(10.0, 20.0);
+         let thrift_bbox_m: parquet::BoundingBox = bbox_m.into();
+         assert_eq!(thrift_bbox_m.mmin, Some(OrderedFloat(10.0)));
+         assert_eq!(thrift_bbox_m.mmax, Some(OrderedFloat(20.0)));
+     }
+ 
+     #[test]
+     fn test_read_geospatial_statistics_from_file() {
+         use crate::file::reader::{FileReader, SerializedFileReader};
+         use std::fs::File;
+ 
+         let path = format!(
+             "{}/geospatial/geospatial.parquet",
+             arrow::util::test_util::parquet_test_data(),
+         );
+         let file = File::open(path).unwrap();
+         let reader = SerializedFileReader::try_from(file).unwrap();
+         let metadata = reader.metadata();
+ 
+         // geospatial.parquet schema:
+         //    optional binary field_id=-1 group (String);
+         //    optional binary field_id=-1 wkt (String);
+         //    optional binary field_id=-1 geometry (Geometry(crs=));
+         let geo_statistics = metadata.row_group(0).column(2).geo_statistics();
+         assert!(geo_statistics.is_some());
+ 
+         let expected_bbox = BoundingBox::new(10.0, 40.0, 10.0, 40.0)
+             .with_zrange(30.0, 80.0)
+             .with_mrange(200.0, 1600.0);
+         let expected_geospatial_types = vec![
+             1, 2, 3, 4, 5, 6, 7, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 2001, 2002, 2003, 2004,
+             2005, 2006, 2007, 3001, 3002, 3003, 3004, 3005, 3006, 3007,
+         ];
+         assert_eq!(
+             geo_statistics.unwrap().geospatial_types,
+             Some(expected_geospatial_types)
+         );
+         assert_eq!(geo_statistics.unwrap().bbox, Some(expected_bbox));
+     }
+ }
diff --cc parquet/src/lib.rs
index ff0eac08be,446a500aaf..a93bf0ee72
--- a/parquet/src/lib.rs
+++ b/parquet/src/lib.rs
@@@ -188,10 -188,7 +188,9 @@@ pub mod file
  pub mod record;
  pub mod schema;
  
 +mod parquet_macros;
 +mod parquet_thrift;
  pub mod thrift;
- 
  /// What data is needed to read the next item from a decoder.
  ///
  /// This is used to communicate between the decoder and the caller
diff --cc parquet/src/parquet_thrift.rs
index 5d549f012c,0000000000..6c3c70a8eb
mode 100644,000000..100644
--- a/parquet/src/parquet_thrift.rs
+++ b/parquet/src/parquet_thrift.rs
@@@ -1,1088 -1,0 +1,1109 @@@
 +// Licensed to the Apache Software Foundation (ASF) under one
 +// or more contributor license agreements.  See the NOTICE file
 +// distributed with this work for additional information
 +// regarding copyright ownership.  The ASF licenses this file
 +// to you under the Apache License, Version 2.0 (the
 +// "License"); you may not use this file except in compliance
 +// with the License.  You may obtain a copy of the License at
 +//
 +//   http://www.apache.org/licenses/LICENSE-2.0
 +//
 +// Unless required by applicable law or agreed to in writing,
 +// software distributed under the License is distributed on an
 +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 +// KIND, either express or implied.  See the License for the
 +// specific language governing permissions and limitations
 +// under the License.
 +
 +//! experimental replacement for thrift decoder
 +// this is a copy of TCompactSliceInputProtocol, but modified
 +// to not allocate byte arrays or strings.
 +#![allow(dead_code)]
 +
 +use std::{
 +    cmp::Ordering,
 +    io::{Read, Write},
 +};
 +
 +use crate::errors::{ParquetError, Result};
 +
 +/// Wrapper for thrift `double` fields. This is used to provide
 +/// an implementation of `Eq` for floats. This implementation
 +/// uses IEEE 754 total order.
 +#[derive(Debug, Clone, Copy, PartialEq)]
 +pub struct OrderedF64(f64);
 +
 +impl From<f64> for OrderedF64 {
 +    fn from(value: f64) -> Self {
 +        Self(value)
 +    }
 +}
 +
 +impl From<OrderedF64> for f64 {
 +    fn from(value: OrderedF64) -> Self {
 +        value.0
 +    }
 +}
 +
 +impl Eq for OrderedF64 {} // Marker trait, requires PartialEq
 +
 +impl Ord for OrderedF64 {
 +    fn cmp(&self, other: &Self) -> Ordering {
 +        self.0.total_cmp(&other.0)
 +    }
 +}
 +
 +impl PartialOrd for OrderedF64 {
 +    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
 +        Some(self.cmp(other))
 +    }
 +}
 +
 +// Thrift compact protocol types for struct fields.
 +#[derive(Clone, Copy, Debug, Eq, PartialEq)]
 +pub(crate) enum FieldType {
 +    Stop = 0,
 +    BooleanTrue = 1,
 +    BooleanFalse = 2,
 +    Byte = 3,
 +    I16 = 4,
 +    I32 = 5,
 +    I64 = 6,
 +    Double = 7,
 +    Binary = 8,
 +    List = 9,
 +    Set = 10,
 +    Map = 11,
 +    Struct = 12,
 +}
 +
 +impl TryFrom<u8> for FieldType {
 +    type Error = ParquetError;
 +    fn try_from(value: u8) -> Result<Self> {
 +        match value {
 +            0 => Ok(Self::Stop),
 +            1 => Ok(Self::BooleanTrue),
 +            2 => Ok(Self::BooleanFalse),
 +            3 => Ok(Self::Byte),
 +            4 => Ok(Self::I16),
 +            5 => Ok(Self::I32),
 +            6 => Ok(Self::I64),
 +            7 => Ok(Self::Double),
 +            8 => Ok(Self::Binary),
 +            9 => Ok(Self::List),
 +            10 => Ok(Self::Set),
 +            11 => Ok(Self::Map),
 +            12 => Ok(Self::Struct),
 +            _ => Err(general_err!("Unexpected struct field type{}", value)),
 +        }
 +    }
 +}
 +
 +impl TryFrom<ElementType> for FieldType {
 +    type Error = ParquetError;
 +    fn try_from(value: ElementType) -> std::result::Result<Self, Self::Error> {
 +        match value {
 +            ElementType::Bool => Ok(Self::BooleanTrue),
 +            ElementType::Byte => Ok(Self::Byte),
 +            ElementType::I16 => Ok(Self::I16),
 +            ElementType::I32 => Ok(Self::I32),
 +            ElementType::I64 => Ok(Self::I64),
 +            ElementType::Double => Ok(Self::Double),
 +            ElementType::Binary => Ok(Self::Binary),
 +            ElementType::List => Ok(Self::List),
 +            ElementType::Struct => Ok(Self::Struct),
 +            _ => Err(general_err!("Unexpected list element type{:?}", value)),
 +        }
 +    }
 +}
 +
 +// Thrift compact protocol types for list elements
 +#[derive(Clone, Copy, Debug, Eq, PartialEq)]
 +pub(crate) enum ElementType {
 +    Bool = 2,
 +    Byte = 3,
 +    I16 = 4,
 +    I32 = 5,
 +    I64 = 6,
 +    Double = 7,
 +    Binary = 8,
 +    List = 9,
 +    Set = 10,
 +    Map = 11,
 +    Struct = 12,
 +}
 +
 +impl TryFrom<u8> for ElementType {
 +    type Error = ParquetError;
 +    fn try_from(value: u8) -> Result<Self> {
 +        match value {
 +            // For historical and compatibility reasons, a reader should be capable to deal with both cases.
 +            // The only valid value in the original spec was 2, but due to an widespread implementation bug
 +            // the defacto standard across large parts of the library became 1 instead.
 +            // As a result, both values are now allowed.
 +            // https://github.com/apache/thrift/blob/master/doc/specs/thrift-compact-protocol.md#list-and-set
 +            1 | 2 => Ok(Self::Bool),
 +            3 => Ok(Self::Byte),
 +            4 => Ok(Self::I16),
 +            5 => Ok(Self::I32),
 +            6 => Ok(Self::I64),
 +            7 => Ok(Self::Double),
 +            8 => Ok(Self::Binary),
 +            9 => Ok(Self::List),
 +            10 => Ok(Self::Set),
 +            11 => Ok(Self::Map),
 +            12 => Ok(Self::Struct),
 +            _ => Err(general_err!("Unexpected list/set element type{}", value)),
 +        }
 +    }
 +}
 +
 +/// Struct used to describe a [thrift struct] field during decoding.
 +///
 +/// [thrift struct]: https://github.com/apache/thrift/blob/master/doc/specs/thrift-compact-protocol.md#struct-encoding
 +pub(crate) struct FieldIdentifier {
 +    /// The type for the field.
 +    pub(crate) field_type: FieldType,
 +    /// The field's `id`. May be computed from delta or directly decoded.
 +    pub(crate) id: i16,
 +    /// Stores the value for booleans.
 +    ///
 +    /// Boolean fields store no data, instead the field type is either boolean true, or
 +    /// boolean false.
 +    pub(crate) bool_val: Option<bool>,
 +}
 +
 +/// Struct used to describe a [thrift list].
 +///
 +/// [thrift list]: https://github.com/apache/thrift/blob/master/doc/specs/thrift-compact-protocol.md#list-and-set
 +#[derive(Clone, Debug, Eq, PartialEq)]
 +pub(crate) struct ListIdentifier {
 +    /// The type for each element in the list.
 +    pub(crate) element_type: ElementType,
 +    /// Number of elements contained in the list.
 +    pub(crate) size: i32,
 +}
 +
 +/// Low-level object used to deserialize structs encoded with the Thrift [compact] protocol.
 +///
 +/// Implementation of this trait must provide the low-level functions `read_byte`, `read_bytes`,
 +/// `skip_bytes`, and `read_double`. These primitives are used by the default functions provided
 +/// here to perform deserialization.
 +///
 +/// [compact]: https://github.com/apache/thrift/blob/master/doc/specs/thrift-compact-protocol.md
 +pub(crate) trait ThriftCompactInputProtocol<'a> {
 +    /// Read a single byte from the input.
 +    fn read_byte(&mut self) -> Result<u8>;
 +
 +    /// Read a Thrift encoded [binary] from the input.
 +    ///
 +    /// [binary]: https://github.com/apache/thrift/blob/master/doc/specs/thrift-compact-protocol.md#binary-encoding
 +    fn read_bytes(&mut self) -> Result<&'a [u8]>;
 +
 +    fn read_bytes_owned(&mut self) -> Result<Vec<u8>>;
 +
 +    /// Skip the next `n` bytes of input.
 +    fn skip_bytes(&mut self, n: usize) -> Result<()>;
 +
 +    /// Read a ULEB128 encoded unsigned varint from the input.
 +    fn read_vlq(&mut self) -> Result<u64> {
 +        let mut in_progress = 0;
 +        let mut shift = 0;
 +        loop {
 +            let byte = self.read_byte()?;
 +            in_progress |= ((byte & 0x7F) as u64).wrapping_shl(shift);
 +            shift += 7;
 +            if byte & 0x80 == 0 {
 +                return Ok(in_progress);
 +            }
 +        }
 +    }
 +
 +    /// Read a zig-zag encoded signed varint from the input.
 +    fn read_zig_zag(&mut self) -> Result<i64> {
 +        let val = self.read_vlq()?;
 +        Ok((val >> 1) as i64 ^ -((val & 1) as i64))
 +    }
 +
 +    /// Read the [`ListIdentifier`] for a Thrift encoded list.
 +    fn read_list_begin(&mut self) -> Result<ListIdentifier> {
 +        let header = self.read_byte()?;
 +        let element_type = ElementType::try_from(header & 0x0f)?;
 +
 +        let possible_element_count = (header & 0xF0) >> 4;
 +        let element_count = if possible_element_count != 15 {
 +            // high bits set high if count and type encoded separately
 +            possible_element_count as i32
 +        } else {
 +            self.read_vlq()? as _
 +        };
 +
 +        Ok(ListIdentifier {
 +            element_type,
 +            size: element_count,
 +        })
 +    }
 +
 +    /// Read the [`FieldIdentifier`] for a field in a Thrift encoded struct.
 +    fn read_field_begin(&mut self, last_field_id: i16) -> Result<FieldIdentifier> {
 +        // we can read at least one byte, which is:
 +        // - the type
 +        // - the field delta and the type
 +        let field_type = self.read_byte()?;
 +        let field_delta = (field_type & 0xf0) >> 4;
 +        let field_type = FieldType::try_from(field_type & 0xf)?;
 +        let mut bool_val: Option<bool> = None;
 +
 +        match field_type {
 +            FieldType::Stop => Ok(FieldIdentifier {
 +                field_type: FieldType::Stop,
 +                id: 0,
 +                bool_val,
 +            }),
 +            _ => {
 +                // special handling for bools
 +                if field_type == FieldType::BooleanFalse {
 +                    bool_val = Some(false);
 +                } else if field_type == FieldType::BooleanTrue {
 +                    bool_val = Some(true);
 +                }
 +                let field_id = if field_delta != 0 {
 +                    last_field_id.checked_add(field_delta as i16).map_or_else(
 +                        || {
 +                            Err(general_err!(format!(
 +                                "cannot add {} to {}",
 +                                field_delta, last_field_id
 +                            )))
 +                        },
 +                        Ok,
 +                    )?
 +                } else {
 +                    self.read_i16()?
 +                };
 +
 +                Ok(FieldIdentifier {
 +                    field_type,
 +                    id: field_id,
 +                    bool_val,
 +                })
 +            }
 +        }
 +    }
 +
 +    /// This is a specialized version of [`Self::read_field_begin`], solely for use in parsing
 +    /// simple structs. This function assumes that the delta field will always be less than 0xf,
 +    /// fields will be in order, and no boolean fields will be read.
 +    /// This also skips validation of the field type.
 +    ///
 +    /// Returns a tuple of `(field_type, field_delta)`.
 +    fn read_field_header(&mut self) -> Result<(u8, u8)> {
 +        let field_type = self.read_byte()?;
 +        let field_delta = (field_type & 0xf0) >> 4;
 +        let field_type = field_type & 0xf;
 +        Ok((field_type, field_delta))
 +    }
 +
 +    /// Read a boolean list element. This should not be used for struct fields. For the latter,
 +    /// use the [`FieldIdentifier::bool_val`] field.
 +    fn read_bool(&mut self) -> Result<bool> {
 +        let b = self.read_byte()?;
 +        // Previous versions of the thrift specification said to use 0 and 1 inside collections,
 +        // but that differed from existing implementations.
 +        // The specification was updated in https://github.com/apache/thrift/commit/2c29c5665bc442e703480bb0ee60fe925ffe02e8.
 +        // At least the go implementation seems to have followed the previously documented values.
 +        match b {
 +            0x01 => Ok(true),
 +            0x00 | 0x02 => Ok(false),
 +            unkn => Err(general_err!(format!("cannot convert {unkn} into bool"))),
 +        }
 +    }
 +
 +    /// Read a Thrift [binary] as a UTF-8 encoded string.
 +    ///
 +    /// [binary]: https://github.com/apache/thrift/blob/master/doc/specs/thrift-compact-protocol.md#binary-encoding
 +    fn read_string(&mut self) -> Result<&'a str> {
 +        let slice = self.read_bytes()?;
 +        Ok(std::str::from_utf8(slice)?)
 +    }
 +
 +    /// Read an `i8`.
 +    fn read_i8(&mut self) -> Result<i8> {
 +        Ok(self.read_byte()? as _)
 +    }
 +
 +    /// Read an `i16`.
 +    fn read_i16(&mut self) -> Result<i16> {
 +        Ok(self.read_zig_zag()? as _)
 +    }
 +
 +    /// Read an `i32`.
 +    fn read_i32(&mut self) -> Result<i32> {
 +        Ok(self.read_zig_zag()? as _)
 +    }
 +
 +    /// Read an `i64`.
 +    fn read_i64(&mut self) -> Result<i64> {
 +        self.read_zig_zag()
 +    }
 +
 +    /// Read a Thrift `double` as `f64`.
 +    fn read_double(&mut self) -> Result<f64>;
 +
 +    /// Skip a ULEB128 encoded varint.
 +    fn skip_vlq(&mut self) -> Result<()> {
 +        loop {
 +            let byte = self.read_byte()?;
 +            if byte & 0x80 == 0 {
 +                return Ok(());
 +            }
 +        }
 +    }
 +
 +    /// Skip a thrift [binary].
 +    ///
 +    /// [binary]: https://github.com/apache/thrift/blob/master/doc/specs/thrift-compact-protocol.md#binary-encoding
 +    fn skip_binary(&mut self) -> Result<()> {
 +        let len = self.read_vlq()? as usize;
 +        self.skip_bytes(len)
 +    }
 +
 +    /// Skip a field with type `field_type` recursively until the default
 +    /// maximum skip depth (currently 64) is reached.
 +    fn skip(&mut self, field_type: FieldType) -> Result<()> {
 +        const DEFAULT_SKIP_DEPTH: i8 = 64;
 +        self.skip_till_depth(field_type, DEFAULT_SKIP_DEPTH)
 +    }
 +
 +    /// Empty structs in unions consist of a single byte of 0 for the field stop record.
 +    /// This skips that byte without encuring the cost of processing the [`FieldIdentifier`].
 +    /// Will return an error if the struct is not actually empty.
 +    fn skip_empty_struct(&mut self) -> Result<()> {
 +        let b = self.read_byte()?;
 +        if b != 0 {
 +            Err(general_err!("Empty struct has fields"))
 +        } else {
 +            Ok(())
 +        }
 +    }
 +
 +    /// Skip a field with type `field_type` recursively up to `depth` levels.
 +    fn skip_till_depth(&mut self, field_type: FieldType, depth: i8) -> Result<()> {
 +        if depth == 0 {
 +            return Err(general_err!(format!("cannot parse past {:?}", field_type)));
 +        }
 +
 +        match field_type {
 +            // boolean field has no data
 +            FieldType::BooleanFalse | FieldType::BooleanTrue => Ok(()),
 +            FieldType::Byte => self.read_i8().map(|_| ()),
 +            FieldType::I16 => self.skip_vlq().map(|_| ()),
 +            FieldType::I32 => self.skip_vlq().map(|_| ()),
 +            FieldType::I64 => self.skip_vlq().map(|_| ()),
 +            FieldType::Double => self.skip_bytes(8).map(|_| ()),
 +            FieldType::Binary => self.skip_binary().map(|_| ()),
 +            FieldType::Struct => {
 +                let mut last_field_id = 0i16;
 +                loop {
 +                    let field_ident = self.read_field_begin(last_field_id)?;
 +                    if field_ident.field_type == FieldType::Stop {
 +                        break;
 +                    }
 +                    self.skip_till_depth(field_ident.field_type, depth - 1)?;
 +                    last_field_id = field_ident.id;
 +                }
 +                Ok(())
 +            }
 +            FieldType::List => {
 +                let list_ident = self.read_list_begin()?;
 +                for _ in 0..list_ident.size {
 +                    let element_type = FieldType::try_from(list_ident.element_type)?;
 +                    self.skip_till_depth(element_type, depth - 1)?;
 +                }
 +                Ok(())
 +            }
 +            // no list or map types in parquet format
 +            u => Err(general_err!(format!("cannot skip field type {:?}", &u))),
 +        }
 +    }
 +}
 +
 +/// A high performance Thrift reader that reads from a slice of bytes.
 +pub(crate) struct ThriftSliceInputProtocol<'a> {
 +    buf: &'a [u8],
 +}
 +
 +impl<'a> ThriftSliceInputProtocol<'a> {
 +    /// Create a new `ThriftSliceInputProtocol` using the bytes in `buf`.
 +    pub fn new(buf: &'a [u8]) -> Self {
 +        Self { buf }
 +    }
 +
 +    /// Re-initialize this reader with a new slice.
 +    pub fn reset_buffer(&mut self, buf: &'a [u8]) {
 +        self.buf = buf;
 +    }
 +
 +    /// Return the current buffer as a slice.
 +    pub fn as_slice(&self) -> &'a [u8] {
 +        self.buf
 +    }
 +}
 +
 +impl<'b, 'a: 'b> ThriftCompactInputProtocol<'b> for ThriftSliceInputProtocol<'a> {
 +    #[inline]
 +    fn read_byte(&mut self) -> Result<u8> {
 +        let ret = *self.buf.first().ok_or_else(eof_error)?;
 +        self.buf = &self.buf[1..];
 +        Ok(ret)
 +    }
 +
 +    fn read_bytes(&mut self) -> Result<&'b [u8]> {
 +        let len = self.read_vlq()? as usize;
 +        let ret = self.buf.get(..len).ok_or_else(eof_error)?;
 +        self.buf = &self.buf[len..];
 +        Ok(ret)
 +    }
 +
 +    fn read_bytes_owned(&mut self) -> Result<Vec<u8>> {
 +        Ok(self.read_bytes()?.to_vec())
 +    }
 +
 +    #[inline]
 +    fn skip_bytes(&mut self, n: usize) -> Result<()> {
 +        self.buf.get(..n).ok_or_else(eof_error)?;
 +        self.buf = &self.buf[n..];
 +        Ok(())
 +    }
 +
 +    fn read_double(&mut self) -> Result<f64> {
 +        let slice = self.buf.get(..8).ok_or_else(eof_error)?;
 +        self.buf = &self.buf[8..];
 +        match slice.try_into() {
 +            Ok(slice) => Ok(f64::from_le_bytes(slice)),
 +            Err(_) => Err(general_err!("Unexpected error converting slice")),
 +        }
 +    }
 +}
 +
 +fn eof_error() -> ParquetError {
 +    eof_err!("Unexpected EOF")
 +}
 +
 +/// A Thrift input protocol that wraps a [`Read`] object.
 +///
 +/// Note that this is only intended for use in reading Parquet page headers. This will panic
 +/// if Thrift `binary` data is encountered because a slice of that data cannot be returned.
 +pub(crate) struct ThriftReadInputProtocol<R: Read> {
 +    reader: R,
 +}
 +
 +impl<R: Read> ThriftReadInputProtocol<R> {
 +    pub(crate) fn new(reader: R) -> Self {
 +        Self { reader }
 +    }
 +}
 +
 +impl<'a, R: Read> ThriftCompactInputProtocol<'a> for ThriftReadInputProtocol<R> {
 +    #[inline]
 +    fn read_byte(&mut self) -> Result<u8> {
 +        let mut buf = [0_u8; 1];
 +        self.reader.read_exact(&mut buf)?;
 +        Ok(buf[0])
 +    }
 +
 +    fn read_bytes(&mut self) -> Result<&'a [u8]> {
 +        unimplemented!()
 +    }
 +
 +    fn read_bytes_owned(&mut self) -> Result<Vec<u8>> {
 +        let len = self.read_vlq()? as usize;
 +        let mut v = Vec::with_capacity(len);
 +        std::io::copy(&mut self.reader.by_ref().take(len as u64), &mut v)?;
 +        Ok(v)
 +    }
 +
 +    fn skip_bytes(&mut self, n: usize) -> Result<()> {
 +        std::io::copy(
 +            &mut self.reader.by_ref().take(n as u64),
 +            &mut std::io::sink(),
 +        )?;
 +        Ok(())
 +    }
 +
 +    fn read_double(&mut self) -> Result<f64> {
 +        let mut buf = [0_u8; 8];
 +        self.reader.read_exact(&mut buf)?;
 +        Ok(f64::from_le_bytes(buf))
 +    }
 +}
 +
 +/// Trait implemented for objects that can be deserialized from a Thrift input stream.
 +/// Implementations are provided for Thrift primitive types.
 +pub(crate) trait ReadThrift<'a, R: ThriftCompactInputProtocol<'a>> {
 +    /// Read an object of type `Self` from the input protocol object.
 +    fn read_thrift(prot: &mut R) -> Result<Self>
 +    where
 +        Self: Sized;
 +}
 +
 +impl<'a, R: ThriftCompactInputProtocol<'a>> ReadThrift<'a, R> for bool {
 +    fn read_thrift(prot: &mut R) -> Result<Self> {
 +        prot.read_bool()
 +    }
 +}
 +
 +impl<'a, R: ThriftCompactInputProtocol<'a>> ReadThrift<'a, R> for i8 {
 +    fn read_thrift(prot: &mut R) -> Result<Self> {
 +        prot.read_i8()
 +    }
 +}
 +
 +impl<'a, R: ThriftCompactInputProtocol<'a>> ReadThrift<'a, R> for i16 {
 +    fn read_thrift(prot: &mut R) -> Result<Self> {
 +        prot.read_i16()
 +    }
 +}
 +
 +impl<'a, R: ThriftCompactInputProtocol<'a>> ReadThrift<'a, R> for i32 {
 +    fn read_thrift(prot: &mut R) -> Result<Self> {
 +        prot.read_i32()
 +    }
 +}
 +
 +impl<'a, R: ThriftCompactInputProtocol<'a>> ReadThrift<'a, R> for i64 {
 +    fn read_thrift(prot: &mut R) -> Result<Self> {
 +        prot.read_i64()
 +    }
 +}
 +
 +impl<'a, R: ThriftCompactInputProtocol<'a>> ReadThrift<'a, R> for OrderedF64 {
 +    fn read_thrift(prot: &mut R) -> Result<Self> {
 +        Ok(OrderedF64(prot.read_double()?))
 +    }
 +}
 +
 +impl<'a, R: ThriftCompactInputProtocol<'a>> ReadThrift<'a, R> for &'a str {
 +    fn read_thrift(prot: &mut R) -> Result<Self> {
 +        prot.read_string()
 +    }
 +}
 +
 +impl<'a, R: ThriftCompactInputProtocol<'a>> ReadThrift<'a, R> for String {
 +    fn read_thrift(prot: &mut R) -> Result<Self> {
 +        Ok(String::from_utf8(prot.read_bytes_owned()?)?)
 +    }
 +}
 +
 +impl<'a, R: ThriftCompactInputProtocol<'a>> ReadThrift<'a, R> for &'a [u8] {
 +    fn read_thrift(prot: &mut R) -> Result<Self> {
 +        prot.read_bytes()
 +    }
 +}
 +
 +/// Read a Thrift encoded [list] from the input protocol object.
 +///
 +/// [list]: https://github.com/apache/thrift/blob/master/doc/specs/thrift-compact-protocol.md#list-and-set
 +pub(crate) fn read_thrift_vec<'a, T, R>(prot: &mut R) -> Result<Vec<T>>
 +where
 +    R: ThriftCompactInputProtocol<'a>,
 +    T: ReadThrift<'a, R>,
 +{
 +    let list_ident = prot.read_list_begin()?;
 +    let mut res = Vec::with_capacity(list_ident.size as usize);
 +    for _ in 0..list_ident.size {
 +        let val = T::read_thrift(prot)?;
 +        res.push(val);
 +    }
 +    Ok(res)
 +}
 +
 +/////////////////////////
 +// thrift compact output
 +
 +/// Low-level object used to serialize structs to the Thrift [compact output] protocol.
 +///
 +/// This struct serves as a wrapper around a [`Write`] object, to which thrift encoded data
 +/// will written. The implementation provides functions to write Thrift primitive types, as well
 +/// as functions used in the encoding of lists and structs. This should rarely be used directly,
 +/// but is instead intended for use by implementers of [`WriteThrift`] and [`WriteThriftField`].
 +///
 +/// [compact output]: https://github.com/apache/thrift/blob/master/doc/specs/thrift-compact-protocol.md
 +pub(crate) struct ThriftCompactOutputProtocol<W: Write> {
 +    writer: W,
 +}
 +
 +impl<W: Write> ThriftCompactOutputProtocol<W> {
 +    /// Create a new `ThriftCompactOutputProtocol` wrapping the byte sink `writer`.
 +    pub(crate) fn new(writer: W) -> Self {
 +        Self { writer }
 +    }
 +
 +    /// Return a reference to the underlying `Write`.
 +    pub(crate) fn inner(&self) -> &W {
 +        &self.writer
 +    }
 +
 +    /// Write a single byte to the output stream.
 +    fn write_byte(&mut self, b: u8) -> Result<()> {
 +        self.writer.write_all(&[b])?;
 +        Ok(())
 +    }
 +
 +    /// Write the given `u64` as a ULEB128 encoded varint.
 +    fn write_vlq(&mut self, val: u64) -> Result<()> {
 +        let mut v = val;
 +        while v > 0x7f {
 +            self.write_byte(v as u8 | 0x80)?;
 +            v >>= 7;
 +        }
 +        self.write_byte(v as u8)
 +    }
 +
 +    /// Write the given `i64` as a zig-zag encoded varint.
 +    fn write_zig_zag(&mut self, val: i64) -> Result<()> {
 +        let s = (val < 0) as i64;
 +        self.write_vlq((((val ^ -s) << 1) + s) as u64)
 +    }
 +
 +    /// Used to mark the start of a Thrift struct field of type `field_type`. `last_field_id`
 +    /// is used to compute a delta to the given `field_id` per the compact protocol [spec].
 +    ///
 +    /// [spec]: https://github.com/apache/thrift/blob/master/doc/specs/thrift-compact-protocol.md#struct-encoding
 +    pub(crate) fn write_field_begin(
 +        &mut self,
 +        field_type: FieldType,
 +        field_id: i16,
 +        last_field_id: i16,
 +    ) -> Result<()> {
 +        let delta = field_id.wrapping_sub(last_field_id);
 +        if delta > 0 && delta <= 0xf {
 +            self.write_byte((delta as u8) << 4 | field_type as u8)
 +        } else {
 +            self.write_byte(field_type as u8)?;
 +            self.write_i16(field_id)
 +        }
 +    }
 +
 +    /// Used to indicate the start of a list of `element_type` elements.
 +    pub(crate) fn write_list_begin(&mut self, element_type: ElementType, len: usize) -> Result<()> {
 +        if len < 15 {
 +            self.write_byte((len as u8) << 4 | element_type as u8)
 +        } else {
 +            self.write_byte(0xf0u8 | element_type as u8)?;
 +            self.write_vlq(len as _)
 +        }
 +    }
 +
 +    /// Used to mark the end of a struct. This must be called after all fields of the struct have
 +    /// been written.
 +    pub(crate) fn write_struct_end(&mut self) -> Result<()> {
 +        self.write_byte(0)
 +    }
 +
 +    /// Serialize a slice of `u8`s. This will encode a length, and then write the bytes without
 +    /// further encoding.
 +    pub(crate) fn write_bytes(&mut self, val: &[u8]) -> Result<()> {
 +        self.write_vlq(val.len() as u64)?;
 +        self.writer.write_all(val)?;
 +        Ok(())
 +    }
 +
 +    /// Short-cut method used to encode structs that have no fields (often used in Thrift unions).
 +    /// This simply encodes the field id and then immediately writes the end-of-struct marker.
 +    pub(crate) fn write_empty_struct(&mut self, field_id: i16, last_field_id: i16) -> Result<i16> {
 +        self.write_field_begin(FieldType::Struct, field_id, last_field_id)?;
 +        self.write_struct_end()?;
 +        Ok(last_field_id)
 +    }
 +
 +    /// Write a boolean value.
 +    pub(crate) fn write_bool(&mut self, val: bool) -> Result<()> {
 +        match val {
 +            true => self.write_byte(1),
 +            false => self.write_byte(2),
 +        }
 +    }
 +
 +    /// Write a zig-zag encoded `i8` value.
 +    pub(crate) fn write_i8(&mut self, val: i8) -> Result<()> {
 +        self.write_byte(val as u8)
 +    }
 +
 +    /// Write a zig-zag encoded `i16` value.
 +    pub(crate) fn write_i16(&mut self, val: i16) -> Result<()> {
 +        self.write_zig_zag(val as _)
 +    }
 +
 +    /// Write a zig-zag encoded `i32` value.
 +    pub(crate) fn write_i32(&mut self, val: i32) -> Result<()> {
 +        self.write_zig_zag(val as _)
 +    }
 +
 +    /// Write a zig-zag encoded `i64` value.
 +    pub(crate) fn write_i64(&mut self, val: i64) -> Result<()> {
 +        self.write_zig_zag(val as _)
 +    }
 +
 +    /// Write a double value.
 +    pub(crate) fn write_double(&mut self, val: f64) -> Result<()> {
 +        self.writer.write_all(&val.to_le_bytes())?;
 +        Ok(())
 +    }
 +}
 +
 +/// Trait implemented by objects that are to be serialized to a Thrift [compact output] protocol
 +/// stream. Implementations are also provided for primitive Thrift types.
 +///
 +/// [compact output]: https://github.com/apache/thrift/blob/master/doc/specs/thrift-compact-protocol.md
 +pub(crate) trait WriteThrift {
 +    /// The [`ElementType`] to use when a list of this object is written.
 +    const ELEMENT_TYPE: ElementType;
 +
 +    /// Serialize this object to the given `writer`.
 +    fn write_thrift<W: Write>(&self, writer: &mut ThriftCompactOutputProtocol<W>) -> Result<()>;
 +}
 +
 +/// Implementation for a vector of thrift serializable objects that implement [`WriteThrift`].
 +/// This will write the necessary list header and then serialize the elements one-at-a-time.
 +impl<T> WriteThrift for Vec<T>
 +where
 +    T: WriteThrift,
 +{
 +    const ELEMENT_TYPE: ElementType = ElementType::List;
 +
 +    fn write_thrift<W: Write>(&self, writer: &mut ThriftCompactOutputProtocol<W>) -> Result<()> {
 +        writer.write_list_begin(T::ELEMENT_TYPE, self.len())?;
 +        for item in self {
 +            item.write_thrift(writer)?;
 +        }
 +        Ok(())
 +    }
 +}
 +
 +impl WriteThrift for bool {
 +    const ELEMENT_TYPE: ElementType = ElementType::Bool;
 +
 +    fn write_thrift<W: Write>(&self, writer: &mut ThriftCompactOutputProtocol<W>) -> Result<()> {
 +        writer.write_bool(*self)
 +    }
 +}
 +
 +impl WriteThrift for i8 {
 +    const ELEMENT_TYPE: ElementType = ElementType::Byte;
 +
 +    fn write_thrift<W: Write>(&self, writer: &mut ThriftCompactOutputProtocol<W>) -> Result<()> {
 +        writer.write_i8(*self)
 +    }
 +}
 +
 +impl WriteThrift for i16 {
 +    const ELEMENT_TYPE: ElementType = ElementType::I16;
 +
 +    fn write_thrift<W: Write>(&self, writer: &mut ThriftCompactOutputProtocol<W>) -> Result<()> {
 +        writer.write_i16(*self)
 +    }
 +}
 +
 +impl WriteThrift for i32 {
 +    const ELEMENT_TYPE: ElementType = ElementType::I32;
 +
 +    fn write_thrift<W: Write>(&self, writer: &mut ThriftCompactOutputProtocol<W>) -> Result<()> {
 +        writer.write_i32(*self)
 +    }
 +}
 +
 +impl WriteThrift for i64 {
 +    const ELEMENT_TYPE: ElementType = ElementType::I64;
 +
 +    fn write_thrift<W: Write>(&self, writer: &mut ThriftCompactOutputProtocol<W>) -> Result<()> {
 +        writer.write_i64(*self)
 +    }
 +}
 +
 +impl WriteThrift for OrderedF64 {
 +    const ELEMENT_TYPE: ElementType = ElementType::Double;
 +
 +    fn write_thrift<W: Write>(&self, writer: &mut ThriftCompactOutputProtocol<W>) -> Result<()> {
 +        writer.write_double(self.0)
 +    }
 +}
 +
++impl WriteThrift for f64 {
++    const ELEMENT_TYPE: ElementType = ElementType::Double;
++
++    fn write_thrift<W: Write>(&self, writer: &mut ThriftCompactOutputProtocol<W>) -> Result<()> {
++        writer.write_double(*self)
++    }
++}
++
 +impl WriteThrift for &[u8] {
 +    const ELEMENT_TYPE: ElementType = ElementType::Binary;
 +
 +    fn write_thrift<W: Write>(&self, writer: &mut ThriftCompactOutputProtocol<W>) -> Result<()> {
 +        writer.write_bytes(self)
 +    }
 +}
 +
 +impl WriteThrift for &str {
 +    const ELEMENT_TYPE: ElementType = ElementType::Binary;
 +
 +    fn write_thrift<W: Write>(&self, writer: &mut ThriftCompactOutputProtocol<W>) -> Result<()> {
 +        writer.write_bytes(self.as_bytes())
 +    }
 +}
 +
 +impl WriteThrift for String {
 +    const ELEMENT_TYPE: ElementType = ElementType::Binary;
 +
 +    fn write_thrift<W: Write>(&self, writer: &mut ThriftCompactOutputProtocol<W>) -> Result<()> {
 +        writer.write_bytes(self.as_bytes())
 +    }
 +}
 +
 +/// Trait implemented by objects that are fields of Thrift structs.
 +///
 +/// For example, given the Thrift struct definition
 +/// ```ignore
 +/// struct MyStruct {
 +///   1: required i32 field1
 +///   2: optional bool field2
 +///   3: optional OtherStruct field3
 +/// }
 +/// ```
 +///
 +/// which becomes in Rust
 +/// ```no_run
 +/// # struct OtherStruct {}
 +/// struct MyStruct {
 +///   field1: i32,
 +///   field2: Option<bool>,
 +///   field3: Option<OtherStruct>,
 +/// }
 +/// ```
 +/// the impl of `WriteThrift` for `MyStruct` will use the `WriteThriftField` impls for `i32`,
 +/// `bool`, and `OtherStruct`.
 +///
 +/// ```ignore
 +/// impl WriteThrift for MyStruct {
 +///   fn write_thrift<W: Write>(&self, writer: &mut ThriftCompactOutputProtocol<W>) -> Result<()> {
 +///     let mut last_field_id = 0i16;
 +///     last_field_id = self.field1.write_thrift_field(writer, 1, last_field_id)?;
 +///     if self.field2.is_some() {
 +///       // if field2 is `None` then this assignment won't happen and last_field_id will remain
 +///       // `1` when writing `field3`
 +///       last_field_id = self.field2.write_thrift_field(writer, 2, last_field_id)?;
 +///     }
 +///     if self.field3.is_some() {
 +///       // no need to assign last_field_id since this is the final field.
 +///       self.field3.write_thrift_field(writer, 3, last_field_id)?;
 +///     }
 +///     writer.write_struct_end()
 +///   }
 +/// }
 +/// ```
 +///
 +pub(crate) trait WriteThriftField {
 +    /// Used to write struct fields (which may be primitive or IDL defined types). This will
 +    /// write the field marker for the given `field_id`, using `last_field_id` to compute the
 +    /// field delta used by the Thrift [compact protocol]. On success this will return `field_id`
 +    /// to be used in chaining.
 +    ///
 +    /// [compact protocol]: https://github.com/apache/thrift/blob/master/doc/specs/thrift-compact-protocol.md#struct-encoding
 +    fn write_thrift_field<W: Write>(
 +        &self,
 +        writer: &mut ThriftCompactOutputProtocol<W>,
 +        field_id: i16,
 +        last_field_id: i16,
 +    ) -> Result<i16>;
 +}
 +
 +impl WriteThriftField for bool {
 +    fn write_thrift_field<W: Write>(
 +        &self,
 +        writer: &mut ThriftCompactOutputProtocol<W>,
 +        field_id: i16,
 +        last_field_id: i16,
 +    ) -> Result<i16> {
 +        // boolean only writes the field header
 +        match *self {
 +            true => writer.write_field_begin(FieldType::BooleanTrue, field_id, last_field_id)?,
 +            false => writer.write_field_begin(FieldType::BooleanFalse, field_id, last_field_id)?,
 +        }
 +        Ok(field_id)
 +    }
 +}
 +
 +impl WriteThriftField for i8 {
 +    fn write_thrift_field<W: Write>(
 +        &self,
 +        writer: &mut ThriftCompactOutputProtocol<W>,
 +        field_id: i16,
 +        last_field_id: i16,
 +    ) -> Result<i16> {
 +        writer.write_field_begin(FieldType::Byte, field_id, last_field_id)?;
 +        writer.write_i8(*self)?;
 +        Ok(field_id)
 +    }
 +}
 +
 +impl WriteThriftField for i16 {
 +    fn write_thrift_field<W: Write>(
 +        &self,
 +        writer: &mut ThriftCompactOutputProtocol<W>,
 +        field_id: i16,
 +        last_field_id: i16,
 +    ) -> Result<i16> {
 +        writer.write_field_begin(FieldType::I16, field_id, last_field_id)?;
 +        writer.write_i16(*self)?;
 +        Ok(field_id)
 +    }
 +}
 +
 +impl WriteThriftField for i32 {
 +    fn write_thrift_field<W: Write>(
 +        &self,
 +        writer: &mut ThriftCompactOutputProtocol<W>,
 +        field_id: i16,
 +        last_field_id: i16,
 +    ) -> Result<i16> {
 +        writer.write_field_begin(FieldType::I32, field_id, last_field_id)?;
 +        writer.write_i32(*self)?;
 +        Ok(field_id)
 +    }
 +}
 +
 +impl WriteThriftField for i64 {
 +    fn write_thrift_field<W: Write>(
 +        &self,
 +        writer: &mut ThriftCompactOutputProtocol<W>,
 +        field_id: i16,
 +        last_field_id: i16,
 +    ) -> Result<i16> {
 +        writer.write_field_begin(FieldType::I64, field_id, last_field_id)?;
 +        writer.write_i64(*self)?;
 +        Ok(field_id)
 +    }
 +}
 +
 +impl WriteThriftField for OrderedF64 {
 +    fn write_thrift_field<W: Write>(
 +        &self,
 +        writer: &mut ThriftCompactOutputProtocol<W>,
 +        field_id: i16,
 +        last_field_id: i16,
 +    ) -> Result<i16> {
 +        writer.write_field_begin(FieldType::Double, field_id, last_field_id)?;
 +        writer.write_double(self.0)?;
 +        Ok(field_id)
 +    }
 +}
 +
++impl WriteThriftField for f64 {
++    fn write_thrift_field<W: Write>(
++        &self,
++        writer: &mut ThriftCompactOutputProtocol<W>,
++        field_id: i16,
++        last_field_id: i16,
++    ) -> Result<i16> {
++        writer.write_field_begin(FieldType::Double, field_id, last_field_id)?;
++        writer.write_double(*self)?;
++        Ok(field_id)
++    }
++}
++
 +impl WriteThriftField for &[u8] {
 +    fn write_thrift_field<W: Write>(
 +        &self,
 +        writer: &mut ThriftCompactOutputProtocol<W>,
 +        field_id: i16,
 +        last_field_id: i16,
 +    ) -> Result<i16> {
 +        writer.write_field_begin(FieldType::Binary, field_id, last_field_id)?;
 +        writer.write_bytes(self)?;
 +        Ok(field_id)
 +    }
 +}
 +
 +impl WriteThriftField for &str {
 +    fn write_thrift_field<W: Write>(
 +        &self,
 +        writer: &mut ThriftCompactOutputProtocol<W>,
 +        field_id: i16,
 +        last_field_id: i16,
 +    ) -> Result<i16> {
 +        writer.write_field_begin(FieldType::Binary, field_id, last_field_id)?;
 +        writer.write_bytes(self.as_bytes())?;
 +        Ok(field_id)
 +    }
 +}
 +
 +impl WriteThriftField for String {
 +    fn write_thrift_field<W: Write>(
 +        &self,
 +        writer: &mut ThriftCompactOutputProtocol<W>,
 +        field_id: i16,
 +        last_field_id: i16,
 +    ) -> Result<i16> {
 +        writer.write_field_begin(FieldType::Binary, field_id, last_field_id)?;
 +        writer.write_bytes(self.as_bytes())?;
 +        Ok(field_id)
 +    }
 +}
 +
 +impl<T> WriteThriftField for Vec<T>
 +where
 +    T: WriteThrift,
 +{
 +    fn write_thrift_field<W: Write>(
 +        &self,
 +        writer: &mut ThriftCompactOutputProtocol<W>,
 +        field_id: i16,
 +        last_field_id: i16,
 +    ) -> Result<i16> {
 +        writer.write_field_begin(FieldType::List, field_id, last_field_id)?;
 +        self.write_thrift(writer)?;
 +        Ok(field_id)
 +    }
 +}
 +
 +#[cfg(test)]
 +pub(crate) mod tests {
 +    use crate::basic::{TimeUnit, Type};
 +
 +    use super::*;
 +    use std::fmt::Debug;
 +
 +    pub(crate) fn test_roundtrip<T>(val: T)
 +    where
 +        T: for<'a> ReadThrift<'a, ThriftSliceInputProtocol<'a>> + WriteThrift + PartialEq + Debug,
 +    {
 +        let buf = Vec::<u8>::new();
 +        let mut writer = ThriftCompactOutputProtocol::new(buf);
 +        val.write_thrift(&mut writer).unwrap();
 +
 +        //println!("serialized: {:x?}", writer.inner());
 +
 +        let mut prot = ThriftSliceInputProtocol::new(writer.inner());
 +        let read_val = T::read_thrift(&mut prot).unwrap();
 +        assert_eq!(val, read_val);
 +    }
 +
 +    #[test]
 +    fn test_enum_roundtrip() {
 +        test_roundtrip(Type::BOOLEAN);
 +        test_roundtrip(Type::INT32);
 +        test_roundtrip(Type::INT64);
 +        test_roundtrip(Type::INT96);
 +        test_roundtrip(Type::FLOAT);
 +        test_roundtrip(Type::DOUBLE);
 +        test_roundtrip(Type::BYTE_ARRAY);
 +        test_roundtrip(Type::FIXED_LEN_BYTE_ARRAY);
 +    }
 +
 +    #[test]
 +    fn test_union_all_empty_roundtrip() {
 +        test_roundtrip(TimeUnit::MILLIS);
 +        test_roundtrip(TimeUnit::MICROS);
 +        test_roundtrip(TimeUnit::NANOS);
 +    }
 +}
diff --cc parquet/src/schema/types.rs
index dca0f84179,2f6131571e..66d0621bd9
--- a/parquet/src/schema/types.rs
+++ b/parquet/src/schema/types.rs
@@@ -402,6 -401,8 +402,8 @@@ impl<'a> PrimitiveTypeBuilder<'a> 
                  (LogicalType::String, PhysicalType::BYTE_ARRAY) => {}
                  (LogicalType::Json, PhysicalType::BYTE_ARRAY) => {}
                  (LogicalType::Bson, PhysicalType::BYTE_ARRAY) => {}
 -                (LogicalType::Geometry, PhysicalType::BYTE_ARRAY) => {}
 -                (LogicalType::Geography, PhysicalType::BYTE_ARRAY) => {}
++                (LogicalType::Geometry { .. }, PhysicalType::BYTE_ARRAY) => {}
++                (LogicalType::Geography { .. }, PhysicalType::BYTE_ARRAY) => {}
                  (LogicalType::Uuid, PhysicalType::FIXED_LEN_BYTE_ARRAY) if self.length == 16 => {}
                  (LogicalType::Uuid, PhysicalType::FIXED_LEN_BYTE_ARRAY) => {
                      return Err(general_err!(
diff --cc parquet/src/variant.rs
index 497d1dc6c4,497d1dc6c4..bc52a2b41d
--- a/parquet/src/variant.rs
+++ b/parquet/src/variant.rs
@@@ -202,7 -202,7 +202,9 @@@ mod tests 
          // data should have been written with the Variant logical type
          assert_eq!(
              field.get_basic_info().logical_type(),
--            Some(crate::basic::LogicalType::Variant)
++            Some(crate::basic::LogicalType::Variant {
++                specification_version: None
++            })
          );
      }