Skip to content

Commit 3f556cf

Browse files
committed
improve comments
1 parent 8b7036b commit 3f556cf

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

crates/iceberg/src/spec/manifest/data_file.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ use serde_derive::{Deserialize, Serialize};
2424
use serde_with::{DeserializeFromStr, SerializeDisplay};
2525

2626
use super::_serde::DataFileSerde;
27-
use super::{Datum, FormatVersion, Schema, data_file_schema_v1, data_file_schema_v2};
27+
use super::{
28+
Datum, FormatVersion, Schema, data_file_schema_v1, data_file_schema_v2, data_file_schema_v3,
29+
};
2830
use crate::error::Result;
29-
use crate::spec::manifest::data_file_schema_v3;
3031
use crate::spec::{Struct, StructType};
3132
use crate::{Error, ErrorKind};
3233

@@ -294,7 +295,6 @@ pub fn write_data_files_to_avro<W: Write>(
294295
let avro_schema = match version {
295296
FormatVersion::V1 => data_file_schema_v1(partition_type).unwrap(),
296297
FormatVersion::V2 => data_file_schema_v2(partition_type).unwrap(),
297-
// Todo: Why unwrap here and not return the error?
298298
FormatVersion::V3 => data_file_schema_v3(partition_type).unwrap(),
299299
};
300300
let mut writer = AvroWriter::new(&avro_schema, writer);
@@ -323,7 +323,6 @@ pub fn read_data_files_from_avro<R: Read>(
323323
let avro_schema = match version {
324324
FormatVersion::V1 => data_file_schema_v1(partition_type).unwrap(),
325325
FormatVersion::V2 => data_file_schema_v2(partition_type).unwrap(),
326-
// Todo: Why unwrap here and not return the error?
327326
FormatVersion::V3 => data_file_schema_v3(partition_type).unwrap(),
328327
};
329328

crates/iceberg/src/spec/manifest/entry.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,8 +568,9 @@ fn data_file_fields_v2(partition_type: &StructType) -> Vec<NestedFieldRef> {
568568
EQUALITY_IDS.clone(),
569569
SORT_ORDER_ID.clone(),
570570
FIRST_ROW_ID.clone(),
571-
// Why are these three here - shouldn't they be v3 only?
572571
REFERENCE_DATA_FILE.clone(),
572+
// Why are the following two fields here in the existing v2 schema?
573+
// In the spec, they are not even listed as optional for v2.
573574
CONTENT_OFFSET.clone(),
574575
CONTENT_SIZE_IN_BYTES.clone(),
575576
]

0 commit comments

Comments
 (0)