Repository: apache/arrow-rs
Pull request #6371 (2024-09-09 13:36:05)

Update chrono-tz requirement from 0.9 to 0.10
Updates the requirements on [chrono-tz](https://github.com/chronotope/chrono-tz) to permit the latest version.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/chronotope/chrono-tz/releases">chrono-tz's releases</a>.</em></p>
<blockquote>
<h2>chrono-tz v0.10.0: 2024b</h2>
<p><strong>TZDB</strong> version 2024b (2024-09-05).</p>
<h2>Changes</h2>
<ul>
<li>Make <code>OffsetName::abbreviation</code> return an <code>Option</code>.
This reflects that numeric values such as <code>+11</code> are no longer encoded in the upstream TZDB as abbreviations (<a href="https://redirect.github.com/chronotope/chrono-tz/issues/185">#185</a>).</li>
</ul>
<h2>TZDB 2024b</h2>
<blockquote>
<p>The 2024b release of the tz code and data is available.</p>
<p>This release is prompted by the accumulated weight of many non-urgent changes to both code and data. It changes one timestamp abbreviation, for the long-obsolete System V setting TZ='MET'; see below. Otherwise, the timestamps affected by this release all predate April 2008, so you can skip this release if your application uses only tzdata and does not use older timestamps.</p>
<p>This release contains the following changes:</p>
<h3>Briefly:</h3>
<p>Improve historical data for Mexico, Mongolia, and Portugal.
System V names are now obsolescent.
The main data form now uses %z.
The code now conforms to RFC 8536 for early timestamps.
Support POSIX.1-2024, which removes asctime_r and ctime_r.
Assume POSIX.2-1992 or later for shell scripts.
SUPPORT_C89 now defaults to 1.</p>
<h3>Changes to past timestamps</h3>
<p>Asia/Choibalsan is now an alias for Asia/Ulaanbaatar rather than being a separate Zone with differing behavior before April 2008. This seems better given our wildly conflicting information about Mongolia's time zone history. (Thanks to Heitor David Pinto.)</p>
<p>Historical transitions for Mexico have been updated based on official Mexican decrees.  The affected timestamps occur during the years 1921-1927, 1931, 1945, 1949-1970, and 1981-1997. The affected zones are America/Bahia_Banderas, America/Cancun, America/Chihuahua, America/Ciudad_Juarez, America/Hermosillo, America/Mazatlan, America/Merida, America/Mexico_City, America/Monterrey, America/Ojinaga, and America/Tijuana. (Thanks to Heitor David Pinto.)</p>
<p>Historical transitions for Portugal, represented by Europe/Lisbon, Atlantic/Azores, and Atlantic/Madeira, have been updated based on a close reading of old Portuguese legislation, replacing previous data mainly originating from Whitman and Shanks &amp; Pottenger. These changes affect a few transitions in 1917-1921, 1924, and 1940 throughout these regions by a few hours or days, and various timestamps between 1977 and 1993 depending on the region. In particular, the Azores and Madeira did not observe DST from 1977 to 1981. Additionally, the adoption of standard zonal time in former Portuguese colonies have been adjusted: Africa/Maputo in 1909, and Asia/Dili by 22 minutes at the start of 1912. (Thanks to Tim Parenti.)</p>
<h3>Changes to past tm_isdst flags</h3>
<p>The period from 1966-04-03 through 1966-10-02 in Portugal is now modeled as DST, to more closely reflect how contemporaneous changes in law entered into force.</p>
<h3>Changes to data</h3>
<p>Names present only for compatibility with UNIX System V (last released in the 1990s) have been moved to 'backward'. These names, which for post-1970 timestamps mostly just duplicate data of geographical names, were confusing downstream uses. Names moved to 'backward' are now links to geographical names. This affects behavior for TZ='EET' for some pre-1981 timestamps, for TZ='CET' for some pre-1947 timestamps, and for TZ='WET' for some pre-1996 timestamps.  Also, TZ='MET' now behaves like TZ='CET' and so uses the abbreviation &quot;CET&quot; rather than &quot;MET&quot;. Those needing the previous TZDB behavior, which does not match any real-world clocks, can find the old entries in 'backzone'. (Problem reported by Justin Grant.)</p>
<p>The main source files' time zone abbreviations now use %z, supported by zic since release 2015f and used in vanguard form since release 2022b. For example, America/Sao_Paulo now contains the zone continuation line &quot;-3:00 Brazil %z&quot;, which is less error prone than the old &quot;-3:00 Brazil -03/-02&quot;. This does not change the represented data: the generated TZif files are unchanged. Rearguard form still avoids %z, to support obsolescent parsers.</p>
<p>Asia/Almaty has been removed from zonenow.tab as it now agrees with Asia/Tashkent for future timestamps, due to Kazakhstan's 2024-02-29 time zone change. Similarly, America/Scoresbysund has been removed, as it now agrees with America/Nuuk due to its 2024-03-31 time zone change.</p>
</blockquote>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/chronotope/chrono-tz/commit/8450e59393b79e5d6062e6bc6f4477903219f489"><code>8450e59</code></a> Bump chrono-tz-build to 0.4.0</li>
<li><a href="https://github.com/chronotope/chrono-tz/commit/6154fd2513cea759143641b7e5f563529a9d2d57"><code>6154fd2</code></a> Bump version number to 0.10.0</li>
<li><a href="https://github.com/chronotope/chrono-tz/commit/2d0c48978163d3a00ace75bd34f61da664335a23"><code>2d0c489</code></a> Update tz submodule to 2024b</li>
<li><a href="https://github.com/chronotope/chrono-tz/commit/0acd431a547f87446cd9338eb492ec8d758f59c2"><code>0acd431</code></a> Make timezone name optional</li>
<li><a href="https://github.com/chronotope/chrono-tz/commit/2e955104a8a951b5c1f90a47fac34eca386a48aa"><code>2e95510</code></a> Test numeric time zone names</li>
<li><a href="https://github.com/chronotope/chrono-tz/commit/2a675e2f845de476b5cb15fd3b6daf2e9c5c8106"><code>2a675e2</code></a> chrono-tz-build: resolve fixme</li>
<li><a href="https://github.com/chronotope/chrono-tz/commit/ca52db80b5d54d70a75f591066b220ee63ceb7a2"><code>ca52db8</code></a> chrono-tz-build: make phf gated by case-insensitive feature</li>
<li><a href="https://github.com/chronotope/chrono-tz/commit/e2f421513991659484c694266098851c584f5da9"><code>e2f4215</code></a> Prepare parse-zoneinfo v0.3.1</li>
<li><a href="https://github.com/chronotope/chrono-tz/commit/e6f87e20cca4584e87e62dc69ed88c144e39dc26"><code>e6f87e2</code></a> Symlink LICENSE in parse-zoneinfo</li>
<li><a href="https://github.com/chronotope/chrono-tz/commit/6e58ce21caabee5bc74b2e513c2764d864ee407e"><code>6e58ce2</code></a> Remove <code>AsciiExt</code> import</li>
<li>Additional commits viewable in <a href="https://github.com/chronotope/chrono-tz/compare/v0.9.0...v0.10.0">compare view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>


Patch:
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index a1644ee49..1b65c5057 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -100,6 +100,13 @@ jobs:
         run: rustup component add rustfmt
       - name: Format arrow
         run: cargo fmt --all -- --check
+      - name: Format parquet
+        # Many modules in parquet are skipped, so check parquet separately. If this check fails, run:
+        #   cargo fmt -p parquet -- --config skip_children=true `find ./parquet -name "*.rs" \! -name format.rs`
+        # from the top level arrow-rs directory and check in the result.
+        # https://github.com/apache/arrow-rs/issues/6179
+        working-directory: parquet
+        run: cargo fmt -p parquet -- --check --config skip_children=true `find . -name "*.rs" \! -name format.rs`
       - name: Format object_store
         working-directory: object_store
         run: cargo fmt --all -- --check
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index a53604d0f..e0adc18a9 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -160,6 +160,13 @@ PR be sure to run the following and check for lint issues:
 cargo +stable fmt --all -- --check
 ```
 
+Note that currently the above will not check all source files in the parquet crate. To check all
+parquet files run the following from the top-level `arrow-rs` directory:
+
+```bash
+cargo fmt -p parquet -- --check --config skip_children=true `find . -name "*.rs" \! -name format.rs`
+```
+
 ## Breaking Changes
 
 Our [release schedule] allows breaking API changes only in major releases.
diff --git a/arrow-array/Cargo.toml b/arrow-array/Cargo.toml
index 6170db85d..57b86c192 100644
--- a/arrow-array/Cargo.toml
+++ b/arrow-array/Cargo.toml
@@ -45,7 +45,7 @@ arrow-buffer = { workspace = true }
 arrow-schema = { workspace = true }
 arrow-data = { workspace = true }
 chrono = { workspace = true }
-chrono-tz = { version = "0.9", optional = true }
+chrono-tz = { version = "0.10", optional = true }
 num = { version = "0.4.1", default-features = false, features = ["std"] }
 half = { version = "2.1", default-features = false, features = ["num-traits"] }
 hashbrown = { version = "0.14.2", default-features = false }
diff --git a/parquet/src/arrow/array_reader/empty_array.rs b/parquet/src/arrow/array_reader/empty_array.rs
index 51673f2f8..9aba08b4e 100644
--- a/parquet/src/arrow/array_reader/empty_array.rs
+++ b/parquet/src/arrow/array_reader/empty_array.rs
@@ -17,9 +17,9 @@
 
 use crate::arrow::array_reader::ArrayReader;
 use crate::errors::Result;
-use arrow_schema::{DataType as ArrowType, Fields};
 use arrow_array::{ArrayRef, StructArray};
 use arrow_data::ArrayDataBuilder;
+use arrow_schema::{DataType as ArrowType, Fields};
 use std::any::Any;
 use std::sync::Arc;
 
diff --git a/parquet/src/arrow/array_reader/fixed_size_list_array.rs b/parquet/src/arrow/array_reader/fixed_size_list_array.rs
index 4cf68a066..75099d018 100644
--- a/parquet/src/arrow/array_reader/fixed_size_list_array.rs
+++ b/parquet/src/arrow/array_reader/fixed_size_list_array.rs
@@ -138,7 +138,7 @@ impl ArrayReader for FixedSizeListArrayReader {
                             "Encountered misaligned row with length {} (expected length {})",
                             row_len,
                             self.fixed_size
-                        ))
+                        ));
                     }
                     row_len = 0;
 
@@ -226,9 +226,7 @@ mod tests {
     use super::*;
     use crate::arrow::{
         array_reader::{test_util::InMemoryArrayReader, ListArrayReader},
-        arrow_reader::{
-            ArrowReaderBuilder, ArrowReaderOptions, ParquetRecordBatchReader,
-        },
+        arrow_reader::{ArrowReaderBuilder, ArrowReaderOptions, ParquetRecordBatchReader},
         ArrowWriter,
     };
     use arrow::datatypes::{Field, Int32Type};
@@ -279,10 +277,7 @@ mod tests {
         let mut list_array_reader = FixedSizeListArrayReader::new(
             Box::new(item_array_reader),
             3,
-            ArrowType::FixedSizeList(
-                Arc::new(Field::new("item", ArrowType::Int32, true)),
-                3,
-            ),
+            ArrowType::FixedSizeList(Arc::new(Field::new("item", ArrowType::Int32, true)), 3),
             2,
             1,
             true,
@@ -328,10 +323,7 @@ mod tests {
         let mut list_array_reader = FixedSizeListArrayReader::new(
             Box::new(item_array_reader),
             2,
-            ArrowType::FixedSizeList(
-                Arc::new(Field::new("item", ArrowType::Int32, true)),
-                2,
-            ),
+            ArrowType::FixedSizeList(Arc::new(Field::new("item", ArrowType::Int32, true)), 2),
             1,
             1,
             false,
@@ -354,14 +346,10 @@ mod tests {
         //   [[4, 5]],
         //   [[null, null]],
         // ]
-        let l2_type = ArrowType::FixedSizeList(
-            Arc::new(Field::new("item", ArrowType::Int32, true)),
-            2,
-        );
-        let l1_type = ArrowType::FixedSizeList(
-            Arc::new(Field::new("item", l2_type.clone(), false)),
-            1,
-        );
+        let l2_type =
+            ArrowType::FixedSizeList(Arc::new(Field::new("item", ArrowType::Int32, true)), 2);
+        let l1_type =
+            ArrowType::FixedSizeList(Arc::new(Field::new("item", l2_type.clone(), false)), 1);
 
         let array = PrimitiveArray::<Int32Type>::from(vec![
             None,
@@ -413,14 +401,8 @@ mod tests {
             Some(vec![0, 0, 2, 0, 2, 0, 0, 2, 0, 2]),
         );
 
-        let l2 = FixedSizeListArrayReader::new(
-            Box::new(item_array_reader),
-            2,
-            l2_type,
-            4,
-            2,
-            false,
-        );
+        let l2 =
+            FixedSizeListArrayReader::new(Box::new(item_array_reader), 2, l2_type, 4, 2, false);
         let mut l1 = FixedSizeListArrayReader::new(Box::new(l2), 1, l1_type, 3, 1, true);
 
         let expected_1 = expected.slice(0, 2);
@@ -454,10 +436,7 @@ mod tests {
         let mut list_array_reader = FixedSizeListArrayReader::new(
             Box::new(item_array_reader),
             0,
-            ArrowType::FixedSizeList(
-                Arc::new(Field::new("item", ArrowType::Int32, true)),
-                0,
-            ),
+            ArrowType::FixedSizeList(Arc::new(Field::new("item", ArrowType::Int32, true)), 0),
             2,
             1,
             true,
@@ -473,8 +452,7 @@ mod tests {
     #[test]
     fn test_nested_var_list() {
         // [[[1, null, 3], null], [[4], []], [[5, 6], [null, null]], null]
-        let mut builder =
-            FixedSizeListBuilder::new(ListBuilder::new(Int32Builder::new()), 2);
+        let mut builder = FixedSizeListBuilder::new(ListBuilder::new(Int32Builder::new()), 2);
         builder.values().append_value([Some(1), None, Some(3)]);
         builder.values().append_null();
         builder.append(true);
@@ -503,12 +481,9 @@ mod tests {
             None,
         ]));
 
-        let inner_type =
-            ArrowType::List(Arc::new(Field::new("item", ArrowType::Int32, true)));
-        let list_type = ArrowType::FixedSizeList(
-            Arc::new(Field::new("item", inner_type.clone(), true)),
-            2,
-        );
+        let inner_type = ArrowType::List(Arc::new(Field::new("item", ArrowType::Int32, true)));
+        let list_type =
+            ArrowType::FixedSizeList(Arc::new(Field::new("item", inner_type.clone(), true)), 2);
 
         let item_array_reader = InMemoryArrayReader::new(
             ArrowType::Int32,
@@ -517,22 +492,11 @@ mod tests {
             Some(vec![0, 2, 2, 1, 0, 1, 0, 2, 1, 2, 0]),
         );
 
-        let inner_array_reader = ListArrayReader::<i32>::new(
-            Box::new(item_array_reader),
-            inner_type,
-            4,
-            2,
-            true,
-        );
+        let inner_array_reader =
+            ListArrayReader::<i32>::new(Box::new(item_array_reader), inner_type, 4, 2, true);
 
-        let mut list_array_reader = FixedSizeListArrayReader::new(
-            Box::new(inner_array_reader),
-            2,
-            list_type,
-            2,
-            1,
-            true,
-        );
+        let mut list_array_reader =
+            FixedSizeListArrayReader::new(Box::new(inner_array_reader), 2, list_type, 2, 1, true);
         let actual = list_array_reader.next_batch(1024).unwrap();
         let actual = actual
             .as_any()
@@ -564,21 +528,13 @@ mod tests {
         );
 
         // [null, 2, 3, null, 5]
-        let primitive = PrimitiveArray::<Int32Type>::from_iter(vec![
-            None,
-            Some(2),
-            Some(3),
-            None,
-            Some(5),
-        ]);
+        let primitive =
+            PrimitiveArray::<Int32Type>::from_iter(vec![None, Some(2), Some(3), None, Some(5)]);
 
         let schema = Arc::new(Schema::new(vec![
             Field::new(
                 "list",
-                ArrowType::FixedSizeList(
-                    Arc::new(Field::new("item", ArrowType::Int32, true)),
-                    4,
-                ),
+                ArrowType::FixedSizeList(Arc::new(Field::new("item", ArrowType::Int32, true)), 4),
                 true,
             ),
             Field::new("primitive", ArrowType::Int32, true),
@@ -643,10 +599,7 @@ mod tests {
 
         let schema = Arc::new(Schema::new(vec![Field::new(
             "list",
-            ArrowType::FixedSizeList(
-                Arc::new(Field::new("item", ArrowType::Int32, true)),
-                4,
-            ),
+            ArrowType::FixedSizeList(Arc::new(Field::new("item", ArrowType::Int32, true)), 4),
             true,
         )]));
 
diff --git a/parquet/src/arrow/array_reader/list_array.rs b/parquet/src/arrow/array_reader/list_array.rs
index e1752f30c..ebff3286b 100644
--- a/parquet/src/arrow/array_reader/list_array.rs
+++ b/parquet/src/arrow/array_reader/list_array.rs
@@ -125,8 +125,7 @@ impl<OffsetSize: OffsetSizeTrait> ArrayReader for ListArrayReader<OffsetSize> {
         // lists, and for consistency we do the same for nulls.
 
         // The output offsets for the computed ListArray
-        let mut list_offsets: Vec<OffsetSize> =
-            Vec::with_capacity(next_batch_array.len() + 1);
+        let mut list_offsets: Vec<OffsetSize> = Vec::with_capacity(next_batch_array.len() + 1);
 
         // The validity mask of the computed ListArray if nullable
         let mut validity = self
@@ -270,9 +269,7 @@ mod tests {
         GenericListArray::<OffsetSize>::DATA_TYPE_CONSTRUCTOR(field)
     }
 
-    fn downcast<OffsetSize: OffsetSizeTrait>(
-        array: &ArrayRef,
-    ) -> &'_ GenericListArray<OffsetSize> {
+    fn downcast<OffsetSize: OffsetSizeTrait>(array: &ArrayRef) -> &'_ GenericListArray<OffsetSize> {
         array
             .as_any()
             .downcast_ref::<GenericListArray<OffsetSize>>()
@@ -383,18 +380,12 @@ mod tests {
             Some(vec![0, 3, 2, 2, 2, 1, 1, 1, 1, 3, 3, 2, 3, 3, 2, 0, 0, 0]),
         );
 
-        let l3 = ListArrayReader::<OffsetSize>::new(
-            Box::new(item_array_reader),
-            l3_type,
-            5,
-            3,
-            true,
-        );
+        let l3 =
+            ListArrayReader::<OffsetSize>::new(Box::new(item_array_reader), l3_type, 5, 3, true);
 
         let l2 = ListArrayReader::<OffsetSize>::new(Box::new(l3), l2_type, 3, 2, false);
 
-        let mut l1 =
-            ListArrayReader::<OffsetSize>::new(Box::new(l2), l1_type, 2, 1, true);
+        let mut l1 = ListArrayReader::<OffsetSize>::new(Box::new(l2), l1_type, 2, 1, true);
 
         let expected_1 = expected.slice(0, 2);
         let expected_2 = expected.slice(2, 2);
@@ -560,8 +551,7 @@ mod tests {
         .unwrap();
         writer.close().unwrap();
 
-        let file_reader: Arc<dyn FileReader> =
-            Arc::new(SerializedFileReader::new(file).unwrap());
+        let file_reader: Arc<dyn FileReader> = Arc::new(SerializedFileReader::new(file).unwrap());
 
         let file_metadata = file_reader.metadata().file_metadata();
         let schema = file_metadata.schema_descr();
@@ -573,8 +563,7 @@ mod tests {
         )
         .unwrap();
 
-        let mut array_reader =
-            build_array_reader(fields.as_ref(), &mask, &file_reader).unwrap();
+        let mut array_reader = build_array_reader(fields.as_ref(), &mask, &file_reader).unwrap();
 
         let batch = array_reader.next_batch(100).unwrap();
         assert_eq!(batch.data_type(), array_reader.get_data_type());
@@ -584,9 +573,7 @@ mod tests {
                 "table_info",
                 ArrowType::List(Arc::new(Field::new(
                     "table_info",
-                    ArrowType::Struct(
-                        vec![Field::new("name", ArrowType::Binary, false)].into()
-                    ),
+                    ArrowType::Struct(vec![Field::new("name", ArrowType::Binary, false)].into()),
                     false
                 ))),
                 false
diff --git a/parquet/src/arrow/array_reader/map_array.rs b/parquet/src/arrow/array_reader/map_array.rs
index 9bfc04732..4bdec602b 100644
--- a/parquet/src/arrow/array_reader/map_array.rs
+++ b/parquet/src/arrow/array_reader/map_array.rs
@@ -184,21 +184,19 @@ mod tests {
         map_builder.append(true).expect("adding map entry");
 
         // Create record batch
-        let batch =
-            RecordBatch::try_new(Arc::new(schema), vec![Arc::new(map_builder.finish())])
-                .expect("create record batch");
+        let batch = RecordBatch::try_new(Arc::new(schema), vec![Arc::new(map_builder.finish())])
+            .expect("create record batch");
 
         // Write record batch to file
         let mut buffer = Vec::with_capacity(1024);
-        let mut writer = ArrowWriter::try_new(&mut buffer, batch.schema(), None)
-            .expect("creat file writer");
+        let mut writer =
+            ArrowWriter::try_new(&mut buffer, batch.schema(), None).expect("creat file writer");
         writer.write(&batch).expect("writing file");
         writer.close().expect("close writer");
 
         // Read file
         let reader = Bytes::from(buffer);
-        let record_batch_reader =
-            ParquetRecordBatchReader::try_new(reader, 1024).unwrap();
+        let record_batch_reader = ParquetRecordBatchReader::try_new(reader, 1024).unwrap();
         for maybe_record_batch in record_batch_reader {
             let record_batch = maybe_record_batch.expect("Getting current batch");
             let col = record_batch.column(0);
diff --git a/parquet/src/arrow/array_reader/struct_array.rs b/parquet/src/arrow/array_reader/struct_array.rs
index 4af194774..fb2f2f892 100644
--- a/parquet/src/arrow/array_reader/struct_array.rs
+++ b/parquet/src/arrow/array_reader/struct_array.rs
@@ -112,10 +112,10 @@ impl ArrayReader for StructArrayReader {
             .collect::<Result<Vec<_>>>()?;
 
         // check that array child data has same size
-        let children_array_len =
-            children_array.first().map(|arr| arr.len()).ok_or_else(|| {
-                general_err!("Struct array reader should have at least one child!")
-            })?;
+        let children_array_len = children_array
+            .first()
+            .map(|arr| arr.len())
+            .ok_or_else(|| general_err!("Struct array reader should have at least one child!"))?;
 
         let all_children_len_eq = children_array
             .iter()
@@ -169,8 +169,7 @@ impl ArrayReader for StructArrayReader {
                 return Err(general_err!("Failed to decode level data for struct array"));
             }
 
-            array_data_builder =
-                array_data_builder.null_bit_buffer(Some(bitmap_builder.into()));
+            array_data_builder = array_data_builder.null_bit_buffer(Some(bitmap_builder.into()));
         }
 
         let array_data = unsafe { array_data_builder.build_unchecked() };
@@ -282,13 +281,12 @@ mod tests {
         //    null,
         // ]
 
-        let expected_l =
-            Arc::new(ListArray::from_iter_primitive::<Int32Type, _, _>(vec![
-                Some(vec![Some(1), Some(2), None]),
-                Some(vec![]),
-                None,
-                None,
-            ]));
+        let expected_l = Arc::new(ListArray::from_iter_primitive::<Int32Type, _, _>(vec![
+            Some(vec![Some(1), Some(2), None]),
+            Some(vec![]),
+            None,
+            None,
+        ]));
 
         let validity = Buffer::from([0b00000111]);
         let struct_fields = vec![(
diff --git a/parquet/src/arrow/schema/complex.rs b/parquet/src/arrow/schema/complex.rs
index a5f6d242e..e487feabb 100644
--- a/parquet/src/arrow/schema/complex.rs
+++ b/parquet/src/arrow/schema/complex.rs
@@ -41,7 +41,7 @@ pub struct ParquetField {
     /// i.e. guaranteed to be > 0 for an element of list type
     pub rep_level: i16,
     /// The level at which this field is fully defined,
-    /// i.e. guaranteed to be > 0 for a nullable type or child of a 
+    /// i.e. guaranteed to be > 0 for a nullable type or child of a
     /// nullable type
     pub def_level: i16,
     /// Whether this field is nullable
@@ -64,11 +64,7 @@ impl ParquetField {
             rep_level: self.rep_level,
             def_level: self.def_level,
             nullable: false,
-            arrow_type: DataType::List(Arc::new(Field::new(
-                name,
-                self.arrow_type.clone(),
-                false,
-            ))),
+            arrow_type: DataType::List(Arc::new(Field::new(name, self.arrow_type.clone(), false))),
             field_type: ParquetFieldType::Group {
                 children: vec![self],
             },
@@ -289,7 +285,7 @@ impl Visitor {
 
         match map_key.get_basic_info().repetition() {
             Repetition::REPEATED => {
-            return Err(arrow_err!("Map keys cannot be repeated"));
+                return Err(arrow_err!("Map keys cannot be repeated"));
             }
             Repetition::REQUIRED | Repetition::OPTIONAL => {
                 // Relaxed check for having repetition REQUIRED as there exists
@@ -317,10 +313,7 @@ impl Visitor {
                     (Some(field), Some(&*fields[0]), Some(&*fields[1]), *sorted)
                 }
                 d => {
-                    return Err(arrow_err!(
-                        "Map data type should contain struct got {}",
-                        d
-                    ));
+                    return Err(arrow_err!("Map data type should contain struct got {}", d));
                 }
             },
             Some(d) => {
@@ -416,9 +409,7 @@ impl Visitor {
         let (def_level, nullable) = match list_type.get_basic_info().repetition() {
             Repetition::REQUIRED => (context.def_level, false),
             Repetition::OPTIONAL => (context.def_level + 1, true),
-            Repetition::REPEATED => {
-                return Err(arrow_err!("List type cannot be repeated"))
-            }
+            Repetition::REPEATED => return Err(arrow_err!("List type cannot be repeated")),
         };
 
         let arrow_field = match &context.data_type {
@@ -542,11 +533,7 @@ impl Visitor {
 ///
 /// The resulting [`Field`] will have the type dictated by `field`, a name
 /// dictated by the `parquet_type`, and any metadata from `arrow_hint`
-fn convert_field(
-    parquet_type: &Type,
-    field: &ParquetField,
-    arrow_hint: Option<&Field>,
-) -> Field {
+fn convert_field(parquet_type: &Type, field: &ParquetField, arrow_hint: Option<&Field>) -> Field {
     let name = parquet_type.name();
     let data_type = field.arrow_type.clone();
     let nullable = field.nullable;
@@ -568,11 +555,14 @@ fn convert_field(
             let basic_info = parquet_type.get_basic_info();
             if basic_info.has_id() {
                 let mut meta = HashMap::with_capacity(1);
-                meta.insert(PARQUET_FIELD_ID_META_KEY.to_string(), basic_info.id().to_string());
+                meta.insert(
+                    PARQUET_FIELD_ID_META_KEY.to_string(),
+                    basic_info.id().to_string(),
+                );
                 ret.set_metadata(meta);
             }
             ret
-        },
+        }
     }
 }
 
diff --git a/parquet/src/arrow/schema/mod.rs b/parquet/src/arrow/schema/mod.rs
index a3528b6c8..fab896695 100644
--- a/parquet/src/arrow/schema/mod.rs
+++ b/parquet/src/arrow/schema/mod.rs
@@ -1483,11 +1483,25 @@ mod tests {
             ),
             Field::new("date", DataType::Date32, true),
             Field::new("time_milli", DataType::Time32(TimeUnit::Millisecond), true),
-            Field::new("time_milli_utc", DataType::Time32(TimeUnit::Millisecond), true)
-                .with_metadata(HashMap::from_iter(vec![("adjusted_to_utc".to_string(), "".to_string())])),
+            Field::new(
+                "time_milli_utc",
+                DataType::Time32(TimeUnit::Millisecond),
+                true,
+            )
+            .with_metadata(HashMap::from_iter(vec![(
+                "adjusted_to_utc".to_string(),
+                "".to_string(),
+            )])),
             Field::new("time_micro", DataType::Time64(TimeUnit::Microsecond), true),
-            Field::new("time_micro_utc", DataType::Time64(TimeUnit::Microsecond), true)
-                .with_metadata(HashMap::from_iter(vec![("adjusted_to_utc".to_string(), "".to_string())])),
+            Field::new(
+                "time_micro_utc",
+                DataType::Time64(TimeUnit::Microsecond),
+                true,
+            )
+            .with_metadata(HashMap::from_iter(vec![(
+                "adjusted_to_utc".to_string(),
+                "".to_string(),
+            )])),
             Field::new(
                 "ts_milli",
                 DataType::Timestamp(TimeUnit::Millisecond, None),
diff --git a/parquet/src/compression.rs b/parquet/src/compression.rs
index 10560210e..edf675f13 100644
--- a/parquet/src/compression.rs
+++ b/parquet/src/compression.rs
@@ -150,35 +150,47 @@ pub fn create_codec(codec: CodecType, _options: &CodecOptions) -> Result<Option<
         CodecType::BROTLI(level) => {
             #[cfg(any(feature = "brotli", test))]
             return Ok(Some(Box::new(BrotliCodec::new(level))));
-            Err(ParquetError::General("Disabled feature at compile time: brotli".into()))
-        },
+            Err(ParquetError::General(
+                "Disabled feature at compile time: brotli".into(),
+            ))
+        }
         CodecType::GZIP(level) => {
             #[cfg(any(feature = "flate2", test))]
             return Ok(Some(Box::new(GZipCodec::new(level))));
-            Err(ParquetError::General("Disabled feature at compile time: flate2".into()))
-        },
+            Err(ParquetError::General(
+                "Disabled feature at compile time: flate2".into(),
+            ))
+        }
         CodecType::SNAPPY => {
             #[cfg(any(feature = "snap", test))]
             return Ok(Some(Box::new(SnappyCodec::new())));
-            Err(ParquetError::General("Disabled feature at compile time: snap".into()))
-        },
+            Err(ParquetError::General(
+                "Disabled feature at compile time: snap".into(),
+            ))
+        }
         CodecType::LZ4 => {
             #[cfg(any(feature = "lz4", test))]
             return Ok(Some(Box::new(LZ4HadoopCodec::new(
                 _options.backward_compatible_lz4,
             ))));
-            Err(ParquetError::General("Disabled feature at compile time: lz4".into()))
-        },
+            Err(ParquetError::General(
+                "Disabled feature at compile time: lz4".into(),
+            ))
+        }
         CodecType::ZSTD(level) => {
             #[cfg(any(feature = "zstd", test))]
             return Ok(Some(Box::new(ZSTDCodec::new(level))));
-            Err(ParquetError::General("Disabled feature at compile time: zstd".into()))
-        },
+            Err(ParquetError::General(
+                "Disabled feature at compile time: zstd".into(),
+            ))
+        }
         CodecType::LZ4_RAW => {
             #[cfg(any(feature = "lz4", test))]
             return Ok(Some(Box::new(LZ4RawCodec::new())));
-            Err(ParquetError::General("Disabled feature at compile time: lz4".into()))
-        },
+            Err(ParquetError::General(
+                "Disabled feature at compile time: lz4".into(),
+            ))
+        }
         CodecType::UNCOMPRESSED => Ok(None),
         _ => Err(nyi_err!("The codec type {} is not supported yet", codec)),
     }
diff --git a/parquet/src/encodings/encoding/dict_encoder.rs b/parquet/src/encodings/encoding/dict_encoder.rs
index 98283b574..8efb84521 100644
--- a/parquet/src/encodings/encoding/dict_encoder.rs
+++ b/parquet/src/encodings/encoding/dict_encoder.rs
@@ -148,7 +148,6 @@ impl<T: DataType> DictEncoder<T> {
     fn bit_width(&self) -> u8 {
         num_required_bits(self.num_entries().saturating_sub(1) as u64)
     }
-
 }
 
 impl<T: DataType> Encoder<T> for DictEncoder<T> {
diff --git a/parquet/src/encodings/levels.rs b/parquet/src/encodings/levels.rs
index 8d4e48ba1..6f662b614 100644
--- a/parquet/src/encodings/levels.rs
+++ b/parquet/src/encodings/levels.rs
@@ -27,11 +27,7 @@ use crate::util::bit_util::{ceil, num_required_bits, BitWriter};
 /// repetition/definition level and number of total buffered values (includes null
 /// values).
 #[inline]
-pub fn max_buffer_size(
-    encoding: Encoding,
-    max_level: i16,
-    num_buffered_values: usize,
-) -> usize {
+pub fn max_buffer_size(encoding: Encoding, max_level: i16, num_buffered_values: usize) -> usize {
     let bit_width = num_required_bits(max_level as u64);
     match encoding {
         Encoding::RLE => RleEncoder::max_buffer_size(bit_width, num_buffered_values),
diff --git a/parquet/src/encodings/rle.rs b/parquet/src/encodings/rle.rs
index 97a122941..e1ca8cd74 100644
--- a/parquet/src/encodings/rle.rs
+++ b/parquet/src/encodings/rle.rs
@@ -199,13 +199,9 @@ impl RleEncoder {
     /// internal writer.
     #[inline]
     pub fn flush(&mut self) {
-        if self.bit_packed_count > 0
-            || self.repeat_count > 0
-            || self.num_buffered_values > 0
-        {
+        if self.bit_packed_count > 0 || self.repeat_count > 0 || self.num_buffered_values > 0 {
             let all_repeat = self.bit_packed_count == 0
-                && (self.repeat_count == self.num_buffered_values
-                    || self.num_buffered_values == 0);
+                && (self.repeat_count == self.num_buffered_values || self.num_buffered_values == 0);
             if self.repeat_count > 0 && all_repeat {
                 self.flush_rle_run();
             } else {
@@ -250,11 +246,8 @@ impl RleEncoder {
             // Write the indicator byte to the reserved position in `bit_writer`
             let num_groups = self.bit_packed_count / 8;
             let indicator_byte = ((num_groups << 1) | 1) as u8;
-            self.bit_writer.put_aligned_offset(
-                indicator_byte,
-                1,
-                self.indicator_byte_pos as usize,
-            );
+            self.bit_writer
+                .put_aligned_offset(indicator_byte, 1, self.indicator_byte_pos as usize);
             self.indicator_byte_pos = -1;
             self.bit_packed_count = 0;
         }
@@ -288,9 +281,7 @@ impl RleEncoder {
 
     /// return the estimated memory size of this encoder.
     pub(crate) fn estimated_memory_size(&self) -> usize {
-        self.bit_writer.estimated_memory_size()
-        + std::mem::size_of::<Self>()
-
+        self.bit_writer.estimated_memory_size() + std::mem::size_of::<Self>()
     }
 }
 
@@ -384,12 +375,10 @@ impl RleDecoder {
         let mut values_read = 0;
         while values_read < buffer.len() {
             if self.rle_left > 0 {
-                let num_values =
-                    cmp::min(buffer.len() - values_read, self.rle_left as usize);
+                let num_values = cmp::min(buffer.len() - values_read, self.rle_left as usize);
                 for i in 0..num_values {
-                    let repeated_value = T::try_from_le_slice(
-                        &self.current_value.as_mut().unwrap().to_ne_bytes(),
-                    )?;
+                    let repeated_value =
+                        T::try_from_le_slice(&self.current_value.as_mut().unwrap().to_ne_bytes())?;
                     buffer[values_read + i] = repeated_value;
                 }
                 self.rle_left -= num_values as u32;
@@ -397,8 +386,7 @@ impl RleDecoder {
             } else if self.bit_packed_left > 0 {
                 let mut num_values =
                     cmp::min(buffer.len() - values_read, self.bit_packed_left as usize);
-                let bit_reader =
-                    self.bit_reader.as_mut().expect("bit_reader should be set");
+                let bit_reader = self.bit_reader.as_mut().expect("bit_reader should be set");
 
                 num_values = bit_reader.get_batch::<T>(
                     &mut buffer[values_read..values_read + num_values],
@@ -424,15 +412,13 @@ impl RleDecoder {
         let mut values_skipped = 0;
         while values_skipped < num_values {
             if self.rle_left > 0 {
-                let num_values =
-                    cmp::min(num_values - values_skipped, self.rle_left as usize);
+                let num_values = cmp::min(num_values - values_skipped, self.rle_left as usize);
                 self.rle_left -= num_values as u32;
                 values_skipped += num_values;
             } else if self.bit_packed_left > 0 {
                 let mut num_values =
                     cmp::min(num_values - values_skipped, self.bit_packed_left as usize);
-                let bit_reader =
-                    self.bit_reader.as_mut().expect("bit_reader should be set");
+                let bit_reader = self.bit_reader.as_mut().expect("bit_reader should be set");
 
                 num_values = bit_reader.skip(num_values, self.bit_width as usize);
                 if num_values == 0 {
@@ -467,8 +453,7 @@ impl RleDecoder {
             let index_buf = self.index_buf.get_or_insert_with(|| Box::new([0; 1024]));
 
             if self.rle_left > 0 {
-                let num_values =
-                    cmp::min(max_values - values_read, self.rle_left as usize);
+                let num_values = cmp::min(max_values - values_read, self.rle_left as usize);
                 let dict_idx = self.current_value.unwrap() as usize;
                 for i in 0..num_values {
                     buffer[values_read + i].clone_from(&dict[dict_idx]);
@@ -476,8 +461,7 @@ impl RleDecoder {
                 self.rle_left -= num_values as u32;
                 values_read += num_values;
             } else if self.bit_packed_left > 0 {
-                let bit_reader =
-                    self.bit_reader.as_mut().expect("bit_reader should be set");
+                let bit_reader = self.bit_reader.as_mut().expect("bit_reader should be set");
 
                 loop {
                     let to_read = index_buf
@@ -489,10 +473,8 @@ impl RleDecoder {
                         break;
                     }
 
-                    let num_values = bit_reader.get_batch::<i32>(
-                        &mut index_buf[..to_read],
-                        self.bit_width as usize,
-                    );
+                    let num_values = bit_reader
+                        .get_batch::<i32>(&mut index_buf[..to_read], self.bit_width as usize);
                     if num_values == 0 {
                         // Handle writers which truncate the final block
                         self.bit_packed_left = 0;
@@ -708,14 +690,10 @@ mod tests {
         decoder.set_data(data.into());
         let mut buffer = vec![""; 12];
         let expected = vec![
-            "ddd", "eee", "fff", "ddd", "eee", "fff", "ddd", "eee", "fff", "eee", "fff",
-            "fff",
+            "ddd", "eee", "fff", "ddd", "eee", "fff", "ddd", "eee", "fff", "eee", "fff", "fff",
         ];
-        let result = decoder.get_batch_with_dict::<&str>(
-            dict.as_slice(),
-            buffer.as_mut_slice(),
-            12,
-        );
+        let result =
+            decoder.get_batch_with_dict::<&str>(dict.as_slice(), buffer.as_mut_slice(), 12);
         assert!(result.is_ok());
         assert_eq!(buffer, expected);
     }
@@ -1042,8 +1020,7 @@ mod tests {
         for _ in 0..niters {
             values.clear();
             let rng = thread_rng();
-            let seed_vec: Vec<u8> =
-                rng.sample_iter::<u8, _>(&Standard).take(seed_len).collect();
+            let seed_vec: Vec<u8> = rng.sample_iter::<u8, _>(&Standard).take(seed_len).collect();
             let mut seed = [0u8; 32];
             seed.copy_from_slice(&seed_vec[0..seed_len]);
             let mut gen = rand::rngs::StdRng::from_seed(seed);
diff --git a/parquet/src/util/bit_util.rs b/parquet/src/util/bit_util.rs
index a17202254..062f93270 100644
--- a/parquet/src/util/bit_util.rs
+++ b/parquet/src/util/bit_util.rs
@@ -1027,7 +1027,10 @@ mod tests {
             .collect();
 
         // Generic values used to check against actual values read from `get_batch`.
-        let expected_values: Vec<T> = values.iter().map(|v| T::try_from_le_slice(v.as_bytes()).unwrap()).collect();
+        let expected_values: Vec<T> = values
+            .iter()
+            .map(|v| T::try_from_le_slice(v.as_bytes()).unwrap())
+            .collect();
 
         (0..total).for_each(|i| writer.put_value(values[i], num_bits));
 
diff --git a/parquet/src/util/interner.rs b/parquet/src/util/interner.rs
index f57fc3a71..a804419b5 100644
--- a/parquet/src/util/interner.rs
+++ b/parquet/src/util/interner.rs
@@ -35,7 +35,7 @@ pub trait Storage {
 
     /// Return an estimate of the memory used in this storage, in bytes
     #[allow(dead_code)] // not used in parquet_derive, so is dead there
-   fn estimated_memory_size(&self) -> usize;
+    fn estimated_memory_size(&self) -> usize;
 }
 
 /// A generic value interner supporting various different [`Storage`]


Test patch:
diff --git a/parquet/src/util/test_common/file_util.rs b/parquet/src/util/test_common/file_util.rs
index c2dcd6773..6c031358e 100644
--- a/parquet/src/util/test_common/file_util.rs
+++ b/parquet/src/util/test_common/file_util.rs
@@ -19,8 +19,7 @@ use std::{fs, path::PathBuf, str::FromStr};
 
 /// Returns path to the test parquet file in 'data' directory
 pub fn get_test_path(file_name: &str) -> PathBuf {
-    let mut pathbuf =
-        PathBuf::from_str(&arrow::util::test_util::parquet_test_data()).unwrap();
+    let mut pathbuf = PathBuf::from_str(&arrow::util::test_util::parquet_test_data()).unwrap();
     pathbuf.push(file_name);
     pathbuf
 }
diff --git a/parquet/src/util/test_common/mod.rs b/parquet/src/util/test_common/mod.rs
index 504219eca..8cfc1e6dd 100644
--- a/parquet/src/util/test_common/mod.rs
+++ b/parquet/src/util/test_common/mod.rs
@@ -21,4 +21,4 @@ pub mod page_util;
 pub mod file_util;
 
 #[cfg(test)]
-pub mod rand_gen;
\ No newline at end of file
+pub mod rand_gen;
diff --git a/parquet/src/util/test_common/rand_gen.rs b/parquet/src/util/test_common/rand_gen.rs
index a267c3484..ec80d3a59 100644
--- a/parquet/src/util/test_common/rand_gen.rs
+++ b/parquet/src/util/test_common/rand_gen.rs
@@ -173,8 +173,7 @@ pub fn make_pages<T: DataType>(
 
         // Generate the current page
 
-        let mut pb =
-            DataPageBuilderImpl::new(desc.clone(), num_values_cur_page as u32, use_v2);
+        let mut pb = DataPageBuilderImpl::new(desc.clone(), num_values_cur_page as u32, use_v2);
         if max_rep_level > 0 {
             pb.add_rep_levels(max_rep_level, &rep_levels[level_range.clone()]);
         }