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

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


The following commit(s) were added to refs/heads/main by this push:
     new 996ecc098c test(parquet): move reader roundtrip tests (#11103)
996ecc098c is described below

commit 996ecc098c5c6d991ddab0db78507ad4465e961f
Author: Phoenix <[email protected]>
AuthorDate: Fri Sep 18 01:07:22 2026 +0800

    test(parquet): move reader roundtrip tests (#11103)
    
    # Which issue does this PR close?
    
    <!--
    We generally require a GitHub issue to be filed for all bug fixes and
    enhancements and this helps us generate change logs for our releases.
    You can link an issue to this PR using the GitHub syntax.
    -->
    
    Part of #10540
    
    
    # Rationale for this change
    
    <!--
    Why are you proposing this change? If this is already explained clearly
    in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand
    your changes and offer better suggestions for fixes.
    -->
    
    Parquet roundtrip tests are spread across the reader and writer modules,
    making their coverage hard to find and extend. The tests moved here
    write Arrow data with `ArrowWriter`, read it back, and verify the
    results.
    
    Moving this reader suite into `parquet/tests/arrow_writer/roundtrip.rs`
    follows the organization proposed in #10540 and groups these E2E tests
    in a dedicated integration-test moudle.
    
    # What changes are included in this PR?
    
    <!--
    There is no need to duplicate the description in the issue here but it
    is sometimes worth providing a summary of the individual changes in this
    PR.
    -->
    
    - Move 12 tests and their 3 helper functions from
    `parquet/src/arrow/arrow_reader/tests/roundtrip.rs` to
    `parquet/tests/arrow_writer/roundtrip.rs`.
    - Update module registrations and imports. All test and helper function
    bodies remain unchanged.
    
    # Are these changes tested?
    
    <!--
    We typically require tests for all PRs in order to:
    1. Prevent the code from being accidentally broken by subsequent changes
    2. Serve as another way to document the expected behavior of the code
    
    If tests are not included in your PR, please explain why (for example,
    are they covered by existing tests)?
    
    If this PR claims a performance improvement, please include evidence
    such as benchmark results.
    -->
    
    Only tests
    
    # Are there any user-facing changes?
    
    <!--
    If there are user-facing changes then we may require documentation to be
    updated before approving the PR.
    
    If there are any breaking changes to public APIs, please call them out.
    -->
    
    No
---
 parquet/src/arrow/arrow_reader/tests/mod.rs        | 14 +++-------
 parquet/tests/arrow_writer/mod.rs                  |  1 +
 .../tests => tests/arrow_writer}/roundtrip.rs      | 30 +++++++++++++++++++---
 3 files changed, 32 insertions(+), 13 deletions(-)

diff --git a/parquet/src/arrow/arrow_reader/tests/mod.rs 
b/parquet/src/arrow/arrow_reader/tests/mod.rs
index d1ffc20b2b..bd944f89c9 100644
--- a/parquet/src/arrow/arrow_reader/tests/mod.rs
+++ b/parquet/src/arrow/arrow_reader/tests/mod.rs
@@ -22,13 +22,12 @@
 mod column_reader;
 mod fixtures;
 mod options;
-mod roundtrip;
 mod row_selection;
 mod schema;
 mod virtual_columns;
 
 use std::cmp::min;
-use std::collections::{HashMap, VecDeque};
+use std::collections::VecDeque;
 use std::fmt::Formatter;
 use std::fs::File;
 use std::io::Seek;
@@ -64,19 +63,14 @@ use crate::schema::types::{Type, TypePtr};
 use crate::util::test_common::rand_gen::RandGen;
 use arrow_array::builder::*;
 use arrow_array::cast::AsArray;
-use arrow_array::types::{
-    Date32Type, Date64Type, Decimal32Type, Decimal64Type, Decimal128Type, 
Decimal256Type,
-    DecimalType, Float16Type, Float32Type, Float64Type, Time32MillisecondType,
-    Time64MicrosecondType,
-};
+use arrow_array::types::{Decimal128Type, Float16Type, Float32Type, 
Float64Type};
 use arrow_array::*;
-use arrow_buffer::{ArrowNativeType, BooleanBuffer, Buffer, IntervalDayTime, 
NullBuffer, i256};
-use arrow_data::{ArrayData, ArrayDataBuilder};
+use arrow_buffer::{BooleanBuffer, IntervalDayTime};
+use arrow_data::ArrayData;
 use arrow_schema::{DataType as ArrowDataType, Field, Fields, Schema, 
SchemaRef, TimeUnit};
 use arrow_select::concat::concat_batches;
 use bytes::Bytes;
 use half::f16;
-use num_traits::PrimInt;
 
 fn row_selection(rows: usize) -> RowSelection {
     RowSelection::from(vec![RowSelector::select(rows)])
diff --git a/parquet/tests/arrow_writer/mod.rs 
b/parquet/tests/arrow_writer/mod.rs
index 80d4d0da56..a6e243eb0d 100644
--- a/parquet/tests/arrow_writer/mod.rs
+++ b/parquet/tests/arrow_writer/mod.rs
@@ -18,6 +18,7 @@
 //! Tests for [`ArrowWriter`]
 
 mod layout;
+mod roundtrip;
 
 use std::alloc::{GlobalAlloc, Layout, System};
 use std::cell::Cell;
diff --git a/parquet/src/arrow/arrow_reader/tests/roundtrip.rs 
b/parquet/tests/arrow_writer/roundtrip.rs
similarity index 94%
rename from parquet/src/arrow/arrow_reader/tests/roundtrip.rs
rename to parquet/tests/arrow_writer/roundtrip.rs
index 06bd813608..dd4b9ec4d4 100644
--- a/parquet/src/arrow/arrow_reader/tests/roundtrip.rs
+++ b/parquet/tests/arrow_writer/roundtrip.rs
@@ -15,9 +15,33 @@
 // specific language governing permissions and limitations
 // under the License.
 
-//! Reader data-type handling when reading back ArrowWriter output.
-
-use super::*;
+//! Round-trip tests for Arrow data written to Parquet.
+
+use std::collections::HashMap;
+use std::sync::Arc;
+
+use arrow_array::cast::AsArray;
+use arrow_array::types::{
+    Date32Type, Date64Type, Decimal32Type, Decimal64Type, Decimal128Type, 
Decimal256Type,
+    DecimalType, Float16Type, Time32MillisecondType, Time64MicrosecondType,
+};
+use arrow_array::{
+    Array, ArrayRef, Decimal128Array, Decimal256Array, DictionaryArray, 
FixedSizeBinaryArray,
+    Float16Array, Int32Array, ListArray, PrimitiveArray, RecordBatch, 
RecordBatchReader,
+    StringArray, StructArray, Time32MillisecondArray, Time64MicrosecondArray, 
UInt8Array,
+    UInt8DictionaryArray, UInt32Array, UInt64Array,
+};
+use arrow_buffer::{ArrowNativeType, Buffer, NullBuffer, i256};
+use arrow_data::ArrayDataBuilder;
+use arrow_schema::{DataType as ArrowDataType, Field, Fields, Schema, TimeUnit};
+use bytes::Bytes;
+use half::f16;
+use num_traits::PrimInt;
+use parquet::arrow::ArrowWriter;
+use parquet::arrow::arrow_reader::{ParquetRecordBatchReader, 
ParquetRecordBatchReaderBuilder};
+use parquet::basic::Type as PhysicalType;
+use parquet::errors::Result;
+use parquet::file::properties::WriterProperties;
 
 #[test]
 fn test_unsigned_roundtrip() {

Reply via email to