Skip to content
Merged
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
6 changes: 5 additions & 1 deletion crates/iceberg/src/arrow/record_batch_partition_spliter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use parquet::arrow::PARQUET_FIELD_ID_META_KEY;

use super::record_batch_projector::RecordBatchProjector;
use crate::arrow::{arrow_struct_to_literal, type_to_arrow_type};
use crate::spec::{Literal, PartitionSpecRef, SchemaRef, Struct, StructType, Type};
use crate::spec::{Literal, PartitionSpec, PartitionSpecRef, SchemaRef, Struct, StructType, Type};
use crate::transform::{create_transform_function, BoxedTransformFunction};
use crate::{Error, ErrorKind, Result};

Expand Down Expand Up @@ -186,6 +186,10 @@ impl RecordBatchPartitionSpliter {
})
}

pub(crate) fn partition_spec(&self) -> &PartitionSpec {
self.partition_spec.as_ref()
}

/// Split the record batch into multiple record batches by the partition spec.
pub(crate) fn split(&self, batch: &RecordBatch) -> Result<Vec<(OwnedRow, RecordBatch)>> {
// get array using partition spec
Expand Down
2 changes: 2 additions & 0 deletions crates/iceberg/src/expr/visitors/expression_evaluator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ mod tests {
split_offsets: vec![],
equality_ids: vec![],
sort_order_id: None,
partition_spec_id: 0,
}
}

Expand All @@ -369,6 +370,7 @@ mod tests {
split_offsets: vec![],
equality_ids: vec![],
sort_order_id: None,
partition_spec_id: 0,
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1996,6 +1996,7 @@ mod test {
split_offsets: vec![],
equality_ids: vec![],
sort_order_id: None,
partition_spec_id: 0,
}
}

Expand All @@ -2017,6 +2018,7 @@ mod test {
split_offsets: vec![],
equality_ids: vec![],
sort_order_id: None,
partition_spec_id: 0,
}
}

Expand Down Expand Up @@ -2074,6 +2076,7 @@ mod test {
split_offsets: vec![],
equality_ids: vec![],
sort_order_id: None,
partition_spec_id: 0,
}
}
fn get_test_file_2() -> DataFile {
Expand All @@ -2100,6 +2103,7 @@ mod test {
split_offsets: vec![],
equality_ids: vec![],
sort_order_id: None,
partition_spec_id: 0,
}
}

Expand Down Expand Up @@ -2127,6 +2131,7 @@ mod test {
split_offsets: vec![],
equality_ids: vec![],
sort_order_id: None,
partition_spec_id: 0,
}
}

Expand Down Expand Up @@ -2154,6 +2159,7 @@ mod test {
split_offsets: vec![],
equality_ids: vec![],
sort_order_id: None,
partition_spec_id: 0,
}
}
}
4 changes: 4 additions & 0 deletions crates/iceberg/src/expr/visitors/strict_metrics_evaluator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@ mod test {
split_offsets: vec![],
equality_ids: vec![],
sort_order_id: None,
partition_spec_id: 0,
}
}

Expand All @@ -602,6 +603,7 @@ mod test {
split_offsets: vec![],
equality_ids: vec![],
sort_order_id: None,
partition_spec_id: 0,
}
}

Expand All @@ -623,6 +625,7 @@ mod test {
split_offsets: vec![],
equality_ids: vec![],
sort_order_id: None,
partition_spec_id: 0,
}
}

Expand All @@ -645,6 +648,7 @@ mod test {
split_offsets: vec![],
equality_ids: vec![],
sort_order_id: None,
partition_spec_id: 0,
}
}

Expand Down
1 change: 1 addition & 0 deletions crates/iceberg/src/io/object_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ mod tests {
.status(ManifestStatus::Added)
.data_file(
DataFileBuilder::default()
.partition_spec_id(0)
.content(DataContentType::Data)
.file_path(format!("{}/1.parquet", &self.table_location))
.file_format(DataFileFormat::Parquet)
Expand Down
6 changes: 6 additions & 0 deletions crates/iceberg/src/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1308,6 +1308,7 @@ pub mod tests {
.status(ManifestStatus::Added)
.data_file(
DataFileBuilder::default()
.partition_spec_id(0)
.content(DataContentType::Data)
.file_path(format!("{}/1.parquet", &self.table_location))
.file_format(DataFileFormat::Parquet)
Expand All @@ -1330,6 +1331,7 @@ pub mod tests {
.file_sequence_number(parent_snapshot.sequence_number())
.data_file(
DataFileBuilder::default()
.partition_spec_id(0)
.content(DataContentType::Data)
.file_path(format!("{}/2.parquet", &self.table_location))
.file_format(DataFileFormat::Parquet)
Expand All @@ -1351,6 +1353,7 @@ pub mod tests {
.file_sequence_number(parent_snapshot.sequence_number())
.data_file(
DataFileBuilder::default()
.partition_spec_id(0)
.content(DataContentType::Data)
.file_path(format!("{}/3.parquet", &self.table_location))
.file_format(DataFileFormat::Parquet)
Expand Down Expand Up @@ -1521,6 +1524,7 @@ pub mod tests {
.status(ManifestStatus::Added)
.data_file(
DataFileBuilder::default()
.partition_spec_id(0)
.content(DataContentType::Data)
.file_path(format!("{}/1.parquet", &self.table_location))
.file_format(DataFileFormat::Parquet)
Expand All @@ -1544,6 +1548,7 @@ pub mod tests {
.file_sequence_number(parent_snapshot.sequence_number())
.data_file(
DataFileBuilder::default()
.partition_spec_id(0)
.content(DataContentType::Data)
.file_path(format!("{}/2.parquet", &self.table_location))
.file_format(DataFileFormat::Parquet)
Expand All @@ -1566,6 +1571,7 @@ pub mod tests {
.file_sequence_number(parent_snapshot.sequence_number())
.data_file(
DataFileBuilder::default()
.partition_spec_id(0)
.content(DataContentType::Data)
.file_path(format!("{}/3.parquet", &self.table_location))
.file_format(DataFileFormat::Parquet)
Expand Down
Loading
Loading