@@ -26,7 +26,7 @@ use futures::{AsyncReadExt, AsyncWriteExt};
26
26
27
27
use self :: {
28
28
_const_schema:: { MANIFEST_LIST_AVRO_SCHEMA_V1 , MANIFEST_LIST_AVRO_SCHEMA_V2 } ,
29
- _serde:: { ManifestListEntryV1 , ManifestListEntryV2 } ,
29
+ _serde:: { ManifestFileV1 , ManifestFileV2 } ,
30
30
} ;
31
31
32
32
use super :: { FormatVersion , Manifest , StructType } ;
@@ -51,7 +51,7 @@ pub const UNASSIGNED_SEQUENCE_NUMBER: i64 = -1;
51
51
#[ derive( Debug , Clone , PartialEq ) ]
52
52
pub struct ManifestList {
53
53
/// Entries in a manifest list.
54
- entries : Vec < ManifestListEntry > ,
54
+ entries : Vec < ManifestFile > ,
55
55
}
56
56
57
57
impl ManifestList {
@@ -76,7 +76,7 @@ impl ManifestList {
76
76
}
77
77
78
78
/// Get the entries in the manifest list.
79
- pub fn entries ( & self ) -> & [ ManifestListEntry ] {
79
+ pub fn entries ( & self ) -> & [ ManifestFile ] {
80
80
& self . entries
81
81
}
82
82
}
@@ -168,12 +168,12 @@ impl ManifestListWriter {
168
168
/// Append manifest entries to be written.
169
169
pub fn add_manifest_entries (
170
170
& mut self ,
171
- manifest_entries : impl Iterator < Item = ManifestListEntry > ,
171
+ manifest_entries : impl Iterator < Item = ManifestFile > ,
172
172
) -> Result < ( ) > {
173
173
match self . format_version {
174
174
FormatVersion :: V1 => {
175
175
for manifest_entry in manifest_entries {
176
- let manifest_entry: ManifestListEntryV1 = manifest_entry. try_into ( ) ?;
176
+ let manifest_entry: ManifestFileV1 = manifest_entry. try_into ( ) ?;
177
177
self . avro_writer . append_ser ( manifest_entry) ?;
178
178
}
179
179
}
@@ -203,7 +203,7 @@ impl ManifestListWriter {
203
203
}
204
204
manifest_entry. min_sequence_number = self . sequence_number ;
205
205
}
206
- let manifest_entry: ManifestListEntryV2 = manifest_entry. try_into ( ) ?;
206
+ let manifest_entry: ManifestFileV2 = manifest_entry. try_into ( ) ?;
207
207
self . avro_writer . append_ser ( manifest_entry) ?;
208
208
}
209
209
}
@@ -503,7 +503,7 @@ mod _const_schema {
503
503
504
504
/// Entry in a manifest list.
505
505
#[ derive( Debug , PartialEq , Clone ) ]
506
- pub struct ManifestListEntry {
506
+ pub struct ManifestFile {
507
507
/// field: 500
508
508
///
509
509
/// Location of the manifest file
@@ -630,7 +630,7 @@ impl TryFrom<i32> for ManifestContentType {
630
630
}
631
631
}
632
632
633
- impl ManifestListEntry {
633
+ impl ManifestFile {
634
634
/// Load [`Manifest`].
635
635
///
636
636
/// This method will also initialize inherited values of [`ManifestEntry`], such as `sequence_number`.
@@ -679,9 +679,9 @@ pub struct FieldSummary {
679
679
}
680
680
681
681
/// This is a helper module that defines types to help with serialization/deserialization.
682
- /// For deserialization the input first gets read into either the [ManifestListEntryV1 ] or [ManifestListEntryV2 ] struct
683
- /// and then converted into the [ManifestListEntry ] struct. Serialization works the other way around.
684
- /// [ManifestListEntryV1 ] and [ManifestListEntryV2 ] are internal struct that are only used for serialization and deserialization.
682
+ /// For deserialization the input first gets read into either the [ManifestFileV1 ] or [ManifestFileV2 ] struct
683
+ /// and then converted into the [ManifestFile ] struct. Serialization works the other way around.
684
+ /// [ManifestFileV1 ] and [ManifestFileV2 ] are internal struct that are only used for serialization and deserialization.
685
685
pub ( super ) mod _serde {
686
686
use crate :: {
687
687
spec:: { Literal , StructType , Type } ,
@@ -690,19 +690,19 @@ pub(super) mod _serde {
690
690
pub use serde_bytes:: ByteBuf ;
691
691
use serde_derive:: { Deserialize , Serialize } ;
692
692
693
- use super :: ManifestListEntry ;
693
+ use super :: ManifestFile ;
694
694
use crate :: error:: Result ;
695
695
696
696
#[ derive( Debug , Serialize , Deserialize , PartialEq , Eq ) ]
697
697
#[ serde( transparent) ]
698
698
pub ( crate ) struct ManifestListV2 {
699
- entries : Vec < ManifestListEntryV2 > ,
699
+ entries : Vec < ManifestFileV2 > ,
700
700
}
701
701
702
702
#[ derive( Debug , Serialize , Deserialize , PartialEq , Eq ) ]
703
703
#[ serde( transparent) ]
704
704
pub ( crate ) struct ManifestListV1 {
705
- entries : Vec < ManifestListEntryV1 > ,
705
+ entries : Vec < ManifestFileV1 > ,
706
706
}
707
707
708
708
impl ManifestListV2 {
@@ -790,7 +790,7 @@ pub(super) mod _serde {
790
790
}
791
791
792
792
#[ derive( Debug , Serialize , Deserialize , PartialEq , Eq ) ]
793
- pub ( super ) struct ManifestListEntryV1 {
793
+ pub ( super ) struct ManifestFileV1 {
794
794
pub manifest_path : String ,
795
795
pub manifest_length : i64 ,
796
796
pub partition_spec_id : i32 ,
@@ -806,7 +806,7 @@ pub(super) mod _serde {
806
806
}
807
807
808
808
#[ derive( Debug , Serialize , Deserialize , PartialEq , Eq ) ]
809
- pub ( super ) struct ManifestListEntryV2 {
809
+ pub ( super ) struct ManifestFileV2 {
810
810
pub manifest_path : String ,
811
811
pub manifest_length : i64 ,
812
812
pub partition_spec_id : i32 ,
@@ -885,12 +885,12 @@ pub(super) mod _serde {
885
885
}
886
886
}
887
887
888
- impl ManifestListEntryV2 {
889
- /// Converts the [ManifestListEntryV2 ] into a [ManifestListEntry ].
888
+ impl ManifestFileV2 {
889
+ /// Converts the [ManifestFileV2 ] into a [ManifestFile ].
890
890
/// The convert of [partitions] need the partition_type info so use this function instead of [std::TryFrom] trait.
891
- pub fn try_into ( self , partition_type : Option < & StructType > ) -> Result < ManifestListEntry > {
891
+ pub fn try_into ( self , partition_type : Option < & StructType > ) -> Result < ManifestFile > {
892
892
let partitions = try_convert_to_field_summary ( self . partitions , partition_type) ?;
893
- Ok ( ManifestListEntry {
893
+ Ok ( ManifestFile {
894
894
manifest_path : self . manifest_path ,
895
895
manifest_length : self . manifest_length ,
896
896
partition_spec_id : self . partition_spec_id ,
@@ -910,12 +910,12 @@ pub(super) mod _serde {
910
910
}
911
911
}
912
912
913
- impl ManifestListEntryV1 {
914
- /// Converts the [ManifestListEntryV1 ] into a [ManifestListEntry ].
913
+ impl ManifestFileV1 {
914
+ /// Converts the [MManifestFileV1 ] into a [ManifestFile ].
915
915
/// The convert of [partitions] need the partition_type info so use this function instead of [std::TryFrom] trait.
916
- pub fn try_into ( self , partition_type : Option < & StructType > ) -> Result < ManifestListEntry > {
916
+ pub fn try_into ( self , partition_type : Option < & StructType > ) -> Result < ManifestFile > {
917
917
let partitions = try_convert_to_field_summary ( self . partitions , partition_type) ?;
918
- Ok ( ManifestListEntry {
918
+ Ok ( ManifestFile {
919
919
manifest_path : self . manifest_path ,
920
920
manifest_length : self . manifest_length ,
921
921
partition_spec_id : self . partition_spec_id ,
@@ -977,10 +977,10 @@ pub(super) mod _serde {
977
977
}
978
978
}
979
979
980
- impl TryFrom < ManifestListEntry > for ManifestListEntryV2 {
980
+ impl TryFrom < ManifestFile > for ManifestFileV2 {
981
981
type Error = Error ;
982
982
983
- fn try_from ( value : ManifestListEntry ) -> std:: result:: Result < Self , Self :: Error > {
983
+ fn try_from ( value : ManifestFile ) -> std:: result:: Result < Self , Self :: Error > {
984
984
let partitions = convert_to_serde_field_summary ( value. partitions ) ;
985
985
let key_metadata = convert_to_serde_key_metadata ( value. key_metadata ) ;
986
986
Ok ( Self {
@@ -996,7 +996,7 @@ pub(super) mod _serde {
996
996
. ok_or_else ( || {
997
997
Error :: new (
998
998
crate :: ErrorKind :: DataInvalid ,
999
- "added_data_files_count in ManifestListEntryV2 should be require" ,
999
+ "added_data_files_count in ManifestFileV2 should be require" ,
1000
1000
)
1001
1001
} ) ?
1002
1002
. try_into ( ) ?,
@@ -1005,7 +1005,7 @@ pub(super) mod _serde {
1005
1005
. ok_or_else ( || {
1006
1006
Error :: new (
1007
1007
crate :: ErrorKind :: DataInvalid ,
1008
- "existing_data_files_count in ManifestListEntryV2 should be require" ,
1008
+ "existing_data_files_count in ManifestFileV2 should be require" ,
1009
1009
)
1010
1010
} ) ?
1011
1011
. try_into ( ) ?,
@@ -1014,7 +1014,7 @@ pub(super) mod _serde {
1014
1014
. ok_or_else ( || {
1015
1015
Error :: new (
1016
1016
crate :: ErrorKind :: DataInvalid ,
1017
- "deleted_data_files_count in ManifestListEntryV2 should be require" ,
1017
+ "deleted_data_files_count in ManifestFileV2 should be require" ,
1018
1018
)
1019
1019
} ) ?
1020
1020
. try_into ( ) ?,
@@ -1023,7 +1023,7 @@ pub(super) mod _serde {
1023
1023
. ok_or_else ( || {
1024
1024
Error :: new (
1025
1025
crate :: ErrorKind :: DataInvalid ,
1026
- "added_rows_count in ManifestListEntryV2 should be require" ,
1026
+ "added_rows_count in ManifestFileV2 should be require" ,
1027
1027
)
1028
1028
} ) ?
1029
1029
. try_into ( ) ?,
@@ -1032,7 +1032,7 @@ pub(super) mod _serde {
1032
1032
. ok_or_else ( || {
1033
1033
Error :: new (
1034
1034
crate :: ErrorKind :: DataInvalid ,
1035
- "existing_rows_count in ManifestListEntryV2 should be require" ,
1035
+ "existing_rows_count in ManifestFileV2 should be require" ,
1036
1036
)
1037
1037
} ) ?
1038
1038
. try_into ( ) ?,
@@ -1041,7 +1041,7 @@ pub(super) mod _serde {
1041
1041
. ok_or_else ( || {
1042
1042
Error :: new (
1043
1043
crate :: ErrorKind :: DataInvalid ,
1044
- "deleted_rows_count in ManifestListEntryV2 should be require" ,
1044
+ "deleted_rows_count in ManifestFileV2 should be require" ,
1045
1045
)
1046
1046
} ) ?
1047
1047
. try_into ( ) ?,
@@ -1051,10 +1051,10 @@ pub(super) mod _serde {
1051
1051
}
1052
1052
}
1053
1053
1054
- impl TryFrom < ManifestListEntry > for ManifestListEntryV1 {
1054
+ impl TryFrom < ManifestFile > for ManifestFileV1 {
1055
1055
type Error = Error ;
1056
1056
1057
- fn try_from ( value : ManifestListEntry ) -> std:: result:: Result < Self , Self :: Error > {
1057
+ fn try_from ( value : ManifestFile ) -> std:: result:: Result < Self , Self :: Error > {
1058
1058
let partitions = convert_to_serde_field_summary ( value. partitions ) ;
1059
1059
let key_metadata = convert_to_serde_key_metadata ( value. key_metadata ) ;
1060
1060
Ok ( Self {
@@ -1100,7 +1100,7 @@ mod test {
1100
1100
io:: FileIOBuilder ,
1101
1101
spec:: {
1102
1102
manifest_list:: { _serde:: ManifestListV1 , UNASSIGNED_SEQUENCE_NUMBER } ,
1103
- FieldSummary , Literal , ManifestContentType , ManifestList , ManifestListEntry ,
1103
+ FieldSummary , Literal , ManifestContentType , ManifestFile , ManifestList ,
1104
1104
ManifestListWriter , NestedField , PrimitiveType , StructType , Type ,
1105
1105
} ,
1106
1106
} ;
@@ -1111,7 +1111,7 @@ mod test {
1111
1111
async fn test_parse_manifest_list_v1 ( ) {
1112
1112
let manifest_list = ManifestList {
1113
1113
entries : vec ! [
1114
- ManifestListEntry {
1114
+ ManifestFile {
1115
1115
manifest_path: "/opt/bitnami/spark/warehouse/db/table/metadata/10d28031-9739-484c-92db-cdf2975cead4-m0.avro" . to_string( ) ,
1116
1116
manifest_length: 5806 ,
1117
1117
partition_spec_id: 0 ,
@@ -1161,7 +1161,7 @@ mod test {
1161
1161
async fn test_parse_manifest_list_v2 ( ) {
1162
1162
let manifest_list = ManifestList {
1163
1163
entries : vec ! [
1164
- ManifestListEntry {
1164
+ ManifestFile {
1165
1165
manifest_path: "s3a://icebergdata/demo/s1/t1/metadata/05ffe08b-810f-49b3-a8f4-e88fc99b254a-m0.avro" . to_string( ) ,
1166
1166
manifest_length: 6926 ,
1167
1167
partition_spec_id: 1 ,
@@ -1178,7 +1178,7 @@ mod test {
1178
1178
partitions: vec![ FieldSummary { contains_null: false , contains_nan: Some ( false ) , lower_bound: Some ( Literal :: long( 1 ) ) , upper_bound: Some ( Literal :: long( 1 ) ) } ] ,
1179
1179
key_metadata: vec![ ] ,
1180
1180
} ,
1181
- ManifestListEntry {
1181
+ ManifestFile {
1182
1182
manifest_path: "s3a://icebergdata/demo/s1/t1/metadata/05ffe08b-810f-49b3-a8f4-e88fc99b254a-m1.avro" . to_string( ) ,
1183
1183
manifest_length: 6926 ,
1184
1184
partition_spec_id: 2 ,
@@ -1249,7 +1249,7 @@ mod test {
1249
1249
#[ test]
1250
1250
fn test_serialize_manifest_list_v1 ( ) {
1251
1251
let manifest_list: ManifestListV1 = ManifestList {
1252
- entries : vec ! [ ManifestListEntry {
1252
+ entries : vec ! [ ManifestFile {
1253
1253
manifest_path: "/opt/bitnami/spark/warehouse/db/table/metadata/10d28031-9739-484c-92db-cdf2975cead4-m0.avro" . to_string( ) ,
1254
1254
manifest_length: 5806 ,
1255
1255
partition_spec_id: 0 ,
@@ -1277,7 +1277,7 @@ mod test {
1277
1277
#[ test]
1278
1278
fn test_serialize_manifest_list_v2 ( ) {
1279
1279
let manifest_list: ManifestListV2 = ManifestList {
1280
- entries : vec ! [ ManifestListEntry {
1280
+ entries : vec ! [ ManifestFile {
1281
1281
manifest_path: "s3a://icebergdata/demo/s1/t1/metadata/05ffe08b-810f-49b3-a8f4-e88fc99b254a-m0.avro" . to_string( ) ,
1282
1282
manifest_length: 6926 ,
1283
1283
partition_spec_id: 1 ,
@@ -1305,7 +1305,7 @@ mod test {
1305
1305
#[ tokio:: test]
1306
1306
async fn test_manifest_list_writer_v1 ( ) {
1307
1307
let expected_manifest_list = ManifestList {
1308
- entries : vec ! [ ManifestListEntry {
1308
+ entries : vec ! [ ManifestFile {
1309
1309
manifest_path: "/opt/bitnami/spark/warehouse/db/table/metadata/10d28031-9739-484c-92db-cdf2975cead4-m0.avro" . to_string( ) ,
1310
1310
manifest_length: 5806 ,
1311
1311
partition_spec_id: 1 ,
@@ -1361,7 +1361,7 @@ mod test {
1361
1361
let snapshot_id = 377075049360453639 ;
1362
1362
let seq_num = 1 ;
1363
1363
let mut expected_manifest_list = ManifestList {
1364
- entries : vec ! [ ManifestListEntry {
1364
+ entries : vec ! [ ManifestFile {
1365
1365
manifest_path: "s3a://icebergdata/demo/s1/t1/metadata/05ffe08b-810f-49b3-a8f4-e88fc99b254a-m0.avro" . to_string( ) ,
1366
1366
manifest_length: 6926 ,
1367
1367
partition_spec_id: 1 ,
@@ -1415,7 +1415,7 @@ mod test {
1415
1415
#[ tokio:: test]
1416
1416
async fn test_manifest_list_writer_v1_as_v2 ( ) {
1417
1417
let expected_manifest_list = ManifestList {
1418
- entries : vec ! [ ManifestListEntry {
1418
+ entries : vec ! [ ManifestFile {
1419
1419
manifest_path: "/opt/bitnami/spark/warehouse/db/table/metadata/10d28031-9739-484c-92db-cdf2975cead4-m0.avro" . to_string( ) ,
1420
1420
manifest_length: 5806 ,
1421
1421
partition_spec_id: 1 ,
0 commit comments