diff --git a/crates/iceberg/src/writer/file_writer/parquet_writer.rs b/crates/iceberg/src/writer/file_writer/parquet_writer.rs index 73381be8a..c113e89c2 100644 --- a/crates/iceberg/src/writer/file_writer/parquet_writer.rs +++ b/crates/iceberg/src/writer/file_writer/parquet_writer.rs @@ -389,7 +389,7 @@ mod tests { async fn test_parquet_writer_with_complex_schema() -> Result<()> { let temp_dir = TempDir::new().unwrap(); let file_io = FileIOBuilder::new_fs_io().build().unwrap(); - let loccation_gen = + let location_gen = MockLocationGenerator::new(temp_dir.path().to_str().unwrap().to_string()); let file_name_gen = DefaultFileNameGenerator::new("test".to_string(), None, DataFileFormat::Parquet); @@ -410,7 +410,11 @@ mod tests { "sub_col", arrow_schema::DataType::Int64, true, - )] + ) + .with_metadata(HashMap::from([( + PARQUET_FIELD_ID_META_KEY.to_string(), + "-1".to_string(), + )]))] .into(), ), true, @@ -424,11 +428,13 @@ mod tests { ), arrow_schema::Field::new( "col3", - arrow_schema::DataType::List(Arc::new(arrow_schema::Field::new( - "item", - arrow_schema::DataType::Int64, - true, - ))), + arrow_schema::DataType::List(Arc::new( + arrow_schema::Field::new("item", arrow_schema::DataType::Int64, true) + .with_metadata(HashMap::from([( + PARQUET_FIELD_ID_META_KEY.to_string(), + "-1".to_string(), + )])), + )), true, ) .with_metadata(HashMap::from([( @@ -445,11 +451,19 @@ mod tests { "sub_sub_col", arrow_schema::DataType::Int64, true, - )] + ) + .with_metadata(HashMap::from([( + PARQUET_FIELD_ID_META_KEY.to_string(), + "-1".to_string(), + )]))] .into(), ), true, - )] + ) + .with_metadata(HashMap::from([( + PARQUET_FIELD_ID_META_KEY.to_string(), + "-1".to_string(), + )]))] .into(), ), true, @@ -519,7 +533,7 @@ mod tests { WriterProperties::builder().build(), to_write.schema(), file_io.clone(), - loccation_gen, + location_gen, file_name_gen, ) .build()