This is an automated email from the ASF dual-hosted git repository.
etseidl 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 3df22cd7c6 parquet: Remove deprecated functions (#10565)
3df22cd7c6 is described below
commit 3df22cd7c664e213ab3058d1b98db358467560d4
Author: Ed Seidl <[email protected]>
AuthorDate: Thu Aug 6 12:29:38 2026 -0700
parquet: Remove deprecated functions (#10565)
# Which issue does this PR close?
N/A
# Rationale for this change
Remove deprecated functions from the public API.
# What changes are included in this PR?
Removed functions and tests that used them.
# Are these changes tested?
Covered by existing tests
# Are there any user-facing changes?
Yes, removes functions from the public API
---
parquet/src/arrow/arrow_reader/mod.rs | 45 ++--------
parquet/src/arrow/arrow_reader/read_plan.rs | 11 ---
parquet/src/arrow/arrow_reader/selection/cursor.rs | 4 -
parquet/src/arrow/arrow_writer/mod.rs | 52 +-----------
parquet/src/basic.rs | 14 ----
parquet/src/file/properties.rs | 31 -------
parquet/src/schema/types.rs | 28 -------
parquet/tests/encryption/encryption_async.rs | 96 +---------------------
parquet/tests/encryption/encryption_util.rs | 74 -----------------
9 files changed, 12 insertions(+), 343 deletions(-)
diff --git a/parquet/src/arrow/arrow_reader/mod.rs
b/parquet/src/arrow/arrow_reader/mod.rs
index 1fba869e45..3d84874746 100644
--- a/parquet/src/arrow/arrow_reader/mod.rs
+++ b/parquet/src/arrow/arrow_reader/mod.rs
@@ -261,7 +261,7 @@ impl<T> ArrowReaderBuilder<T> {
///
/// It is recommended to enable writing the page index if using this
/// functionality, to allow more efficient skipping over data pages. See
- /// [`ArrowReaderOptions::with_page_index`].
+ /// [`ArrowReaderOptions::with_page_index_policy`].
///
/// # Example
///
@@ -315,7 +315,7 @@ impl<T> ArrowReaderBuilder<T> {
/// Row filters are applied after row group selection and row selection
///
/// It is recommended to enable reading the page index if using this
functionality, to allow
- /// more efficient skipping over data pages. See
[`ArrowReaderOptions::with_page_index`].
+ /// more efficient skipping over data pages. See
[`ArrowReaderOptions::with_page_index_policy`].
///
/// See the [blog post on late materialization] for a more technical
explanation.
///
@@ -362,7 +362,7 @@ impl<T> ArrowReaderBuilder<T> {
/// allowing it to limit the final set of rows decoded after any pushed
down predicates
///
/// It is recommended to enable reading the page index if using this
functionality, to allow
- /// more efficient skipping over data pages. See
[`ArrowReaderOptions::with_page_index`]
+ /// more efficient skipping over data pages. See
[`ArrowReaderOptions::with_page_index_policy`]
pub fn with_limit(self, limit: usize) -> Self {
Self {
limit: Some(limit),
@@ -376,7 +376,7 @@ impl<T> ArrowReaderBuilder<T> {
/// allowing it to skip rows after any pushed down predicates
///
/// It is recommended to enable reading the page index if using this
functionality, to allow
- /// more efficient skipping over data pages. See
[`ArrowReaderOptions::with_page_index`]
+ /// more efficient skipping over data pages. See
[`ArrowReaderOptions::with_page_index_policy`]
pub fn with_offset(self, offset: usize) -> Self {
Self {
offset: Some(offset),
@@ -615,30 +615,13 @@ impl ArrowReaderOptions {
}
}
- #[deprecated(since = "57.2.0", note = "Use `with_page_index_policy`
instead")]
- /// Enable reading the [`PageIndex`] from the metadata, if present
(defaults to `false`)
+ /// Sets the [`PageIndexPolicy`] for both the column and offset indexes.
///
/// The `PageIndex` can be used to push down predicates to the parquet
scan,
/// potentially eliminating unnecessary IO, by some query engines.
- ///
- /// If this is enabled, [`ParquetMetaData::column_index`] and
- /// [`ParquetMetaData::offset_index`] will be populated if the
corresponding
- /// information is present in the file.
- ///
- /// [`PageIndex`]:
https://github.com/apache/parquet-format/blob/master/PageIndex.md
- /// [`ParquetMetaData::column_index`]:
crate::file::metadata::ParquetMetaData::column_index
- /// [`ParquetMetaData::offset_index`]:
crate::file::metadata::ParquetMetaData::offset_index
- pub fn with_page_index(self, page_index: bool) -> Self {
- self.with_page_index_policy(PageIndexPolicy::from(page_index))
- }
-
- /// Sets the [`PageIndexPolicy`] for both the column and offset indexes.
- ///
/// The `PageIndex` consists of two structures: the `ColumnIndex` and
`OffsetIndex`.
/// This method sets the same policy for both. For fine-grained control,
use
/// [`Self::with_column_index_policy`] and
[`Self::with_offset_index_policy`].
- ///
- /// See [`Self::with_page_index`] for more details on page indexes.
pub fn with_page_index_policy(self, policy: PageIndexPolicy) -> Self {
self.with_column_index_policy(policy)
.with_offset_index_policy(policy)
@@ -800,20 +783,6 @@ impl ArrowReaderOptions {
})
}
- #[deprecated(
- since = "57.2.0",
- note = "Use `column_index_policy` or `offset_index_policy` instead"
- )]
- /// Returns whether page index reading is enabled.
- ///
- /// This returns `true` if both the column index and offset index policies
are not [`PageIndexPolicy::Skip`].
- ///
- /// This can be set via [`with_page_index`][Self::with_page_index] or
- /// [`with_page_index_policy`][Self::with_page_index_policy].
- pub fn page_index(&self) -> bool {
- self.offset_index != PageIndexPolicy::Skip && self.column_index !=
PageIndexPolicy::Skip
- }
-
/// Retrieve the currently set [`PageIndexPolicy`] for the offset index.
///
/// This can be set via
[`with_offset_index_policy`][Self::with_offset_index_policy]
@@ -916,9 +885,11 @@ impl ArrowReaderMetadata {
///
/// # Notes
///
- /// If `options` has [`ArrowReaderOptions::with_page_index`] true, but
+ /// If `options` indicates the page index should be read, but
/// `Self::metadata` is missing the page index, this function will attempt
/// to load the page index by making an object store request.
+ ///
+ /// See [`ArrowReaderOptions::with_page_index_policy`] for more
information on the page index.
pub fn load<T: ChunkReader>(reader: &T, options: ArrowReaderOptions) ->
Result<Self> {
let metadata = ParquetMetaDataReader::new()
.with_column_index_policy(options.column_index)
diff --git a/parquet/src/arrow/arrow_reader/read_plan.rs
b/parquet/src/arrow/arrow_reader/read_plan.rs
index fb39f55d9a..a05024dac0 100644
--- a/parquet/src/arrow/arrow_reader/read_plan.rs
+++ b/parquet/src/arrow/arrow_reader/read_plan.rs
@@ -29,7 +29,6 @@ use crate::errors::{ParquetError, Result};
use arrow_array::{Array, BooleanArray};
use arrow_buffer::{BooleanBuffer, BooleanBufferBuilder};
use arrow_select::filter::prep_null_mask_filter;
-use std::collections::VecDeque;
use std::sync::Arc;
/// Options for [`ReadPlanBuilder::with_predicate_options`].
@@ -447,16 +446,6 @@ pub struct ReadPlan {
}
impl ReadPlan {
- /// Returns a mutable reference to the selection selectors, if any
- #[deprecated(since = "57.1.0", note = "Use `row_selection_cursor_mut`
instead")]
- pub fn selection_mut(&mut self) -> Option<&mut VecDeque<RowSelector>> {
- if let RowSelectionCursor::Selectors(selectors_cursor) = &mut
self.row_selection_cursor {
- Some(selectors_cursor.selectors_mut())
- } else {
- None
- }
- }
-
/// Returns a mutable reference to the row selection cursor
pub fn row_selection_cursor_mut(&mut self) -> &mut RowSelectionCursor {
&mut self.row_selection_cursor
diff --git a/parquet/src/arrow/arrow_reader/selection/cursor.rs
b/parquet/src/arrow/arrow_reader/selection/cursor.rs
index dcb490746c..9a6caad24b 100644
--- a/parquet/src/arrow/arrow_reader/selection/cursor.rs
+++ b/parquet/src/arrow/arrow_reader/selection/cursor.rs
@@ -145,10 +145,6 @@ impl SelectorsCursor {
self.selectors.is_empty()
}
- pub(crate) fn selectors_mut(&mut self) -> &mut VecDeque<RowSelector> {
- &mut self.selectors
- }
-
/// Return the next [`RowSelector`]
pub(crate) fn next_selector(&mut self) -> RowSelector {
let selector = self.selectors.pop_front().unwrap();
diff --git a/parquet/src/arrow/arrow_writer/mod.rs
b/parquet/src/arrow/arrow_writer/mod.rs
index a1fb21ec27..337ec60184 100644
--- a/parquet/src/arrow/arrow_writer/mod.rs
+++ b/parquet/src/arrow/arrow_writer/mod.rs
@@ -506,33 +506,6 @@ impl<W: Write + Send> ArrowWriter<W> {
self.finish()
}
- /// Create a new row group writer and return its column writers.
- #[deprecated(
- since = "56.2.0",
- note = "Use `ArrowRowGroupWriterFactory` instead, see
`ArrowColumnWriter` for an example"
- )]
- pub fn get_column_writers(&mut self) -> Result<Vec<ArrowColumnWriter>> {
- self.flush()?;
- let in_progress = self
- .row_group_writer_factory
- .create_row_group_writer(self.writer.flushed_row_groups().len())?;
- Ok(in_progress.writers)
- }
-
- /// Append the given column chunks to the file as a new row group.
- #[deprecated(
- since = "56.2.0",
- note = "Use `SerializedFileWriter` directly instead, see
`ArrowColumnWriter` for an example"
- )]
- pub fn append_row_group(&mut self, chunks: Vec<ArrowColumnChunk>) ->
Result<()> {
- let mut row_group_writer = self.writer.next_row_group()?;
- for chunk in chunks {
- chunk.append_to_row_group(&mut row_group_writer)?;
- }
- row_group_writer.close()?;
- Ok(())
- }
-
/// Converts this writer into a lower-level [`SerializedFileWriter`] and
[`ArrowRowGroupWriterFactory`].
///
/// Flushes any outstanding data before returning.
@@ -930,8 +903,8 @@ pub struct ArrowLeafColumn(ArrayLevels);
/// Computes the [`ArrowLeafColumn`] for a potentially nested [`ArrayRef`]
///
-/// This function can be used along with [`get_column_writers`] to encode
-/// individual columns in parallel. See example on [`ArrowColumnWriter`]
+/// This function can be used to encode individual columns in parallel.
+/// See example on [`ArrowColumnWriter`]
pub fn compute_leaves(field: &Field, array: &ArrayRef) ->
Result<Vec<ArrowLeafColumn>> {
let levels = calculate_array_levels(array, field)?;
Ok(levels.into_iter().map(ArrowLeafColumn).collect())
@@ -1346,27 +1319,6 @@ impl ArrowRowGroupWriterFactory {
}
}
-/// Returns [`ArrowColumnWriter`]s for each column in a given schema
-#[deprecated(since = "57.0.0", note = "Use `ArrowRowGroupWriterFactory`
instead")]
-pub fn get_column_writers(
- parquet: &SchemaDescriptor,
- props: &WriterPropertiesPtr,
- arrow: &SchemaRef,
-) -> Result<Vec<ArrowColumnWriter>> {
- let mut writers = Vec::with_capacity(arrow.fields.len());
- let mut leaves = parquet.columns().iter();
- let column_factory = ArrowColumnWriterFactory::new();
- for field in &arrow.fields {
- column_factory.get_arrow_column_writer(
- field.data_type(),
- props,
- &mut leaves,
- &mut writers,
- )?;
- }
- Ok(writers)
-}
-
/// Creates [`ArrowColumnWriter`] instances
struct ArrowColumnWriterFactory {
/// Allocates the per-column-chunk [`PageStore`] backing each page writer.
diff --git a/parquet/src/basic.rs b/parquet/src/basic.rs
index 1cb0552660..3208e3c188 100644
--- a/parquet/src/basic.rs
+++ b/parquet/src/basic.rs
@@ -1026,20 +1026,6 @@ pub enum ColumnOrder {
}
impl ColumnOrder {
- /// Returns sort order for a physical/logical type.
- #[deprecated(
- since = "57.1.0",
- note = "use `ColumnOrder::sort_order_for_type` instead"
- )]
- pub fn get_sort_order(
- logical_type: Option<LogicalType>,
- converted_type: ConvertedType,
- physical_type: Type,
- ) -> SortOrder {
- Self::column_order_for_type(logical_type.as_ref(), converted_type,
physical_type)
- .sort_order()
- }
-
/// Returns the `ColumnOrder` for a physical/logical type.
pub fn column_order_for_type(
logical_type: Option<&LogicalType>,
diff --git a/parquet/src/file/properties.rs b/parquet/src/file/properties.rs
index 42b0e124a5..ac6adedd57 100644
--- a/parquet/src/file/properties.rs
+++ b/parquet/src/file/properties.rs
@@ -350,14 +350,6 @@ impl WriterProperties {
self.write_batch_size
}
- /// Returns maximum number of rows in a row group, or `usize::MAX` if
unlimited.
- ///
- /// For more details see
[`WriterPropertiesBuilder::set_max_row_group_size`]
- #[deprecated(since = "58.0.0", note = "Use `max_row_group_row_count`
instead")]
- pub fn max_row_group_size(&self) -> usize {
- self.max_row_group_row_count.unwrap_or(usize::MAX)
- }
-
/// Returns maximum number of rows in a row group, or `None` if unlimited.
///
/// For more details see
[`WriterPropertiesBuilder::set_max_row_group_row_count`]
@@ -733,18 +725,6 @@ impl WriterPropertiesBuilder {
self
}
- /// Sets maximum number of rows in a row group (defaults to `1024 * 1024`
- /// via [`DEFAULT_MAX_ROW_GROUP_ROW_COUNT`]).
- ///
- /// # Panics
- /// If the value is set to 0.
- #[deprecated(since = "58.0.0", note = "Use `set_max_row_group_row_count`
instead")]
- pub fn set_max_row_group_size(mut self, value: usize) -> Self {
- assert!(value > 0, "Cannot have a 0 max row group size");
- self.max_row_group_row_count = Some(value);
- self
- }
-
/// Sets maximum number of rows in a row group, or `None` for unlimited.
///
/// If both `max_row_group_row_count` and `max_row_group_bytes` are set,
@@ -2098,17 +2078,6 @@ mod tests {
);
}
- #[test]
- #[allow(deprecated)]
- fn test_writer_properties_deprecated_max_row_group_size_still_works() {
- let props = WriterProperties::builder()
- .set_max_row_group_size(42)
- .build();
-
- assert_eq!(props.max_row_group_row_count(), Some(42));
- assert_eq!(props.max_row_group_size(), 42);
- }
-
#[test]
#[should_panic(expected = "Cannot have a 0 max row group row count")]
fn test_writer_properties_panic_on_zero_row_group_row_count() {
diff --git a/parquet/src/schema/types.rs b/parquet/src/schema/types.rs
index f81ff64ddc..9934a85d0f 100644
--- a/parquet/src/schema/types.rs
+++ b/parquet/src/schema/types.rs
@@ -714,19 +714,6 @@ impl BasicTypeInfo {
self.converted_type
}
- /// Returns [`LogicalType`] value for the type.
- ///
- /// Note that this function will clone the `LogicalType`. If performance
is a concern,
- /// use [`Self::logical_type_ref`] instead.
- #[deprecated(
- since = "57.1.0",
- note = "use `BasicTypeInfo::logical_type_ref` instead (LogicalType
cloning is non trivial)"
- )]
- pub fn logical_type(&self) -> Option<LogicalType> {
- // Unlike ConvertedType, LogicalType cannot implement Copy, thus we
clone it
- self.logical_type.clone()
- }
-
/// Return a reference to the [`LogicalType`] value for the type.
pub fn logical_type_ref(&self) -> Option<&LogicalType> {
self.logical_type.as_ref()
@@ -957,21 +944,6 @@ impl ColumnDescriptor {
self.primitive_type.get_basic_info().converted_type()
}
- /// Returns [`LogicalType`] for this column.
- ///
- /// Note that this function will clone the `LogicalType`. If performance
is a concern,
- /// use [`Self::logical_type_ref`] instead.
- #[deprecated(
- since = "57.1.0",
- note = "use `ColumnDescriptor::logical_type_ref` instead (LogicalType
cloning is non trivial)"
- )]
- pub fn logical_type(&self) -> Option<LogicalType> {
- self.primitive_type
- .get_basic_info()
- .logical_type_ref()
- .cloned()
- }
-
/// Returns a reference to the [`LogicalType`] for this column.
pub fn logical_type_ref(&self) -> Option<&LogicalType> {
self.primitive_type.get_basic_info().logical_type_ref()
diff --git a/parquet/tests/encryption/encryption_async.rs
b/parquet/tests/encryption/encryption_async.rs
index a2ec2ed297..535ce1e56a 100644
--- a/parquet/tests/encryption/encryption_async.rs
+++ b/parquet/tests/encryption/encryption_async.rs
@@ -23,7 +23,7 @@ use crate::encryption_util::{
AES_128_FOOTER_KEY_NAME, AES_128_KEY_NAME_KEY, AES_256_COLUMN_KEYS,
AES_256_COLUMN_NAME_KEYS,
AES_256_COLUMN_NAMES, AES_256_FOOTER_KEY, AES_256_FOOTER_KEY_NAME,
AES_256_KEY_NAME_KEY,
BAD_AES_128_FOOTER_KEY, BAD_AES_256_FOOTER_KEY, TestKeyRetriever,
read_encrypted_file,
- verify_column_indexes, verify_encryption_double_test_data,
verify_encryption_test_data,
+ verify_column_indexes, verify_encryption_test_data,
};
use arrow_array::RecordBatch;
use arrow_schema::Schema;
@@ -33,9 +33,7 @@ use parquet::arrow::arrow_writer::{
ArrowColumnChunk, ArrowColumnWriter, ArrowLeafColumn,
ArrowRowGroupWriterFactory,
ArrowWriterOptions, compute_leaves,
};
-use parquet::arrow::{
- ArrowSchemaConverter, ArrowWriter, AsyncArrowWriter,
ParquetRecordBatchStreamBuilder,
-};
+use parquet::arrow::{ArrowSchemaConverter, AsyncArrowWriter,
ParquetRecordBatchStreamBuilder};
use parquet::encryption::decrypt::FileDecryptionProperties;
use parquet::encryption::encrypt::FileEncryptionProperties;
use parquet::errors::ParquetError;
@@ -1077,93 +1075,3 @@ async fn test_multi_threaded_encrypted_writing() {
"Parquet error: Parquet file has an encrypted footer but decryption
properties were not provided"
);
}
-
-#[tokio::test]
-async fn test_multi_threaded_encrypted_writing_deprecated() {
- // Read example data and set up encryption/decryption properties
- let testdata = arrow::util::test_util::parquet_test_data();
- let path =
format!("{testdata}/encrypt_columns_and_footer.parquet.encrypted");
- let file = std::fs::File::open(path).unwrap();
-
- let file_encryption_properties =
FileEncryptionProperties::builder(AES_128_FOOTER_KEY.into())
- .with_column_key(AES_128_COLUMN_NAMES[0],
AES_128_COLUMN_KEYS[0].into())
- .with_column_key(AES_128_COLUMN_NAMES[1],
AES_128_COLUMN_KEYS[1].into())
- .build()
- .unwrap();
- let decryption_properties =
FileDecryptionProperties::builder(AES_128_FOOTER_KEY.into())
- .with_column_key(AES_128_COLUMN_NAMES[0],
AES_128_COLUMN_KEYS[0].into())
- .with_column_key(AES_128_COLUMN_NAMES[1],
AES_128_COLUMN_KEYS[1].into())
- .build()
- .unwrap();
-
- let (record_batches, metadata) =
- read_encrypted_file(&file,
Arc::clone(&decryption_properties)).unwrap();
- let to_write: Vec<_> = record_batches
- .iter()
- .flat_map(|rb| rb.columns().to_vec())
- .collect();
- let schema = metadata.schema().clone();
-
- let props = Some(
- WriterPropertiesBuilder::default()
- .with_file_encryption_properties(file_encryption_properties)
- .build(),
- );
-
- // Create a temporary file to write the encrypted data
- let temp_file = tempfile::tempfile().unwrap();
- let mut writer = ArrowWriter::try_new(&temp_file, schema.clone(),
props).unwrap();
-
- // LOW-LEVEL API: Use low level API to write into a file using multiple
threads
-
- // Get column writers
- #[allow(deprecated)]
- let col_writers = writer.get_column_writers().unwrap();
- let num_columns = col_writers.len();
-
- let (col_writer_tasks, mut col_array_channels) =
- spawn_column_parallel_row_group_writer(col_writers, 100).unwrap();
-
- // Send the ArrowLeafColumn data to the respective column writer channels
- let mut worker_iter = col_array_channels.iter_mut();
- for (array, field) in to_write.iter().zip(schema.fields()) {
- for leaves in compute_leaves(field, array).unwrap() {
- worker_iter.next().unwrap().send(leaves).await.unwrap();
- }
- }
- drop(col_array_channels);
-
- // Wait for all column writers to finish writing
- let mut finalized_rg = Vec::with_capacity(num_columns);
- for task in col_writer_tasks.into_iter() {
- finalized_rg.push(task.await.unwrap().unwrap().close().unwrap());
- }
-
- // Append the finalized row group to the SerializedFileWriter
- #[allow(deprecated)]
- writer.append_row_group(finalized_rg).unwrap();
-
- // HIGH-LEVEL API: Write RecordBatches into the file using ArrowWriter
-
- // Write individual RecordBatches into the file
- for rb in record_batches {
- writer.write(&rb).unwrap()
- }
- assert!(writer.flush().is_ok());
-
- // Close the file writer which writes the footer
- let metadata = writer.finish().unwrap();
- assert_eq!(metadata.file_metadata().num_rows(), 100);
-
- // Check that the file was written correctly
- let (read_record_batches, read_metadata) =
- read_encrypted_file(&temp_file, decryption_properties).unwrap();
- verify_encryption_double_test_data(read_record_batches,
read_metadata.metadata());
-
- // Check that file was encrypted
- let result = ArrowReaderMetadata::load(&temp_file,
ArrowReaderOptions::default());
- assert_eq!(
- result.unwrap_err().to_string(),
- "Parquet error: Parquet file has an encrypted footer but decryption
properties were not provided"
- );
-}
diff --git a/parquet/tests/encryption/encryption_util.rs
b/parquet/tests/encryption/encryption_util.rs
index f0fe66651d..daf7e07b7b 100644
--- a/parquet/tests/encryption/encryption_util.rs
+++ b/parquet/tests/encryption/encryption_util.rs
@@ -99,80 +99,6 @@ pub(crate) const AES_256_KEY_NAME_KEY: &[(&str, &[u8]); 9] =
&[
(AES_256_KEY_NAMES[7], AES_256_COLUMN_KEYS[7]),
];
-pub(crate) fn verify_encryption_double_test_data(
- record_batches: Vec<RecordBatch>,
- metadata: &ParquetMetaData,
-) {
- let file_metadata = metadata.file_metadata();
- assert_eq!(file_metadata.num_rows(), 100);
- assert_eq!(file_metadata.schema_descr().num_columns(), 8);
-
- metadata.row_groups().iter().for_each(|rg| {
- assert_eq!(rg.num_columns(), 8);
- assert_eq!(rg.num_rows(), 50);
- });
-
- let mut row_count = 0;
- let wrap_at = 50;
- for batch in record_batches {
- let batch = batch;
- row_count += batch.num_rows();
-
- let bool_col = batch.column(0).as_boolean();
- let time_col = batch
- .column(1)
- .as_primitive::<types::Time32MillisecondType>();
- let list_col = batch.column(2).as_list::<i32>();
- let timestamp_col = batch
- .column(3)
- .as_primitive::<types::TimestampNanosecondType>();
- let f32_col = batch.column(4).as_primitive::<types::Float32Type>();
- let f64_col = batch.column(5).as_primitive::<types::Float64Type>();
- let binary_col = batch.column(6).as_binary::<i32>();
- let fixed_size_binary_col = batch.column(7).as_fixed_size_binary();
-
- for (i, x) in bool_col.iter().enumerate() {
- assert_eq!(x.unwrap(), i % 2 == 0);
- }
- for (i, x) in time_col.iter().enumerate() {
- assert_eq!(x.unwrap(), (i % wrap_at) as i32);
- }
- for (i, list_item) in list_col.iter().enumerate() {
- let list_item = list_item.unwrap();
- let list_item = list_item.as_primitive::<types::Int64Type>();
- assert_eq!(list_item.len(), 2);
- assert_eq!(
- list_item.value(0),
- (((i % wrap_at) * 2) * 1000000000000) as i64
- );
- assert_eq!(
- list_item.value(1),
- (((i % wrap_at) * 2 + 1) * 1000000000000) as i64
- );
- }
- for x in timestamp_col.iter() {
- assert!(x.is_some());
- }
- for (i, x) in f32_col.iter().enumerate() {
- assert_eq!(x.unwrap(), (i % wrap_at) as f32 * 1.1f32);
- }
- for (i, x) in f64_col.iter().enumerate() {
- assert_eq!(x.unwrap(), (i % wrap_at) as f64 * 1.1111111f64);
- }
- for (i, x) in binary_col.iter().enumerate() {
- assert_eq!(x.is_some(), i % 2 == 0);
- if let Some(x) = x {
- assert_eq!(&x[0..7], b"parquet");
- }
- }
- for (i, x) in fixed_size_binary_col.iter().enumerate() {
- assert_eq!(x.unwrap(), &[(i % wrap_at) as u8; 10]);
- }
- }
-
- assert_eq!(row_count, file_metadata.num_rows() as usize);
-}
-
/// Verifies data read from an encrypted file from the parquet-testing
repository
pub(crate) fn verify_encryption_test_data(
record_batches: Vec<RecordBatch>,