Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,15 @@ impl<B: IcebergWriterBuilder> IcebergWriter for FanoutPartitionWriter<B> {

#[cfg(test)]
mod test {
use std::collections::HashMap;
use std::sync::Arc;

use arrow_array::{Int64Array, RecordBatch, StringArray};
use arrow_schema::{DataType, Field, Schema as ArrowSchema};
use arrow_select::concat::concat_batches;
use itertools::Itertools;
use parquet::arrow::arrow_reader::ParquetRecordBatchReaderBuilder;
use parquet::arrow::PARQUET_FIELD_ID_META_KEY;
use parquet::file::properties::WriterProperties;
use tempfile::TempDir;

Expand Down Expand Up @@ -225,8 +227,14 @@ mod test {

// prepare data
let schema = Arc::new(ArrowSchema::new(vec![
Field::new("id", DataType::Int64, true),
Field::new("data", DataType::Utf8, true),
Field::new("id", DataType::Int64, true).with_metadata(HashMap::from([(
PARQUET_FIELD_ID_META_KEY.to_string(),
1.to_string(),
)])),
Field::new("data", DataType::Utf8, true).with_metadata(HashMap::from([(
PARQUET_FIELD_ID_META_KEY.to_string(),
2.to_string(),
)])),
]));
let id_array = Int64Array::from(vec![1, 2, 1, 3, 2, 3, 1]);
let data_array = StringArray::from(vec!["a", "b", "c", "d", "e", "f", "g"]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,15 @@ impl<B: IcebergWriterBuilder> IcebergWriter<(StructArray, RecordBatch)>

#[cfg(test)]
mod test {
use std::collections::HashMap;
use std::sync::Arc;

use arrow_array::{ArrayRef, Int64Array, RecordBatch, StringArray, StructArray};
use arrow_schema::{DataType, Field, Schema as ArrowSchema};
use arrow_select::concat::concat_batches;
use itertools::Itertools;
use parquet::arrow::arrow_reader::ParquetRecordBatchReaderBuilder;
use parquet::arrow::PARQUET_FIELD_ID_META_KEY;
use parquet::file::properties::WriterProperties;
use tempfile::TempDir;

Expand Down Expand Up @@ -219,8 +221,14 @@ mod test {

// prepare data
let schema = Arc::new(ArrowSchema::new(vec![
Field::new("id", DataType::Int64, true),
Field::new("data", DataType::Utf8, true),
Field::new("id", DataType::Int64, true).with_metadata(HashMap::from([(
PARQUET_FIELD_ID_META_KEY.to_string(),
1.to_string(),
)])),
Field::new("data", DataType::Utf8, true).with_metadata(HashMap::from([(
PARQUET_FIELD_ID_META_KEY.to_string(),
2.to_string(),
)])),
]));
let id_array = Int64Array::from(vec![1, 2, 1, 3, 2, 3, 1]);
let data_array = StringArray::from(vec!["a", "b", "c", "d", "e", "f", "g"]);
Expand Down
Loading