2323
2424namespace iceberg {
2525
26- bool BlobMetadata::Equals (const BlobMetadata& other) const {
27- return type == other.type && source_snapshot_id == other.source_snapshot_id &&
28- source_snapshot_sequence_number == other.source_snapshot_sequence_number &&
29- fields == other.fields && properties == other.properties ;
30- }
31-
32- std::string BlobMetadata::ToString () const {
26+ std::string ToString (const BlobMetadata& blob_metadata) {
3327 std::string repr = " BlobMetadata[" ;
3428 std::format_to (std::back_inserter (repr),
35- " type='{}',sourceSnapshotId={},sourceSnapshotSequenceNumber={}," , type,
36- source_snapshot_id, source_snapshot_sequence_number);
29+ " type='{}',sourceSnapshotId={},sourceSnapshotSequenceNumber={}," ,
30+ blob_metadata.type , blob_metadata.source_snapshot_id ,
31+ blob_metadata.source_snapshot_sequence_number );
3732 std::format_to (std::back_inserter (repr), " fields=[" );
38- for (auto iter = fields.cbegin (); iter != fields.cend (); ++iter) {
39- if (iter != fields.cbegin ()) {
33+ for (auto iter = blob_metadata.fields .cbegin (); iter != blob_metadata.fields .cend ();
34+ ++iter) {
35+ if (iter != blob_metadata.fields .cbegin ()) {
4036 std::format_to (std::back_inserter (repr), " ,{}" , *iter);
4137 } else {
4238 std::format_to (std::back_inserter (repr), " {}" , *iter);
4339 }
4440 }
4541 std::format_to (std::back_inserter (repr), " ],properties=[" );
46- for (auto iter = properties.cbegin (); iter != properties.cend (); ++iter) {
42+ for (auto iter = blob_metadata.properties .cbegin ();
43+ iter != blob_metadata.properties .cend (); ++iter) {
4744 const auto & [key, value] = *iter;
48- if (iter != properties.cbegin ()) {
45+ if (iter != blob_metadata. properties .cbegin ()) {
4946 std::format_to (std::back_inserter (repr), " ,{}:{}" , key, value);
5047 } else {
5148 std::format_to (std::back_inserter (repr), " {}:{}" , key, value);
@@ -55,28 +52,32 @@ std::string BlobMetadata::ToString() const {
5552 return repr;
5653}
5754
58- bool StatisticsFile::Equals (const StatisticsFile& other) const {
59- return snapshot_id == other.snapshot_id && path == other.path &&
60- file_size_in_bytes == other.file_size_in_bytes &&
61- file_footer_size_in_bytes == other.file_footer_size_in_bytes &&
62- blob_metadata == other.blob_metadata ;
63- }
64-
65- std::string StatisticsFile::ToString () const {
55+ std::string ToString (const StatisticsFile& statistics_file) {
6656 std::string repr = " StatisticsFile[" ;
6757 std::format_to (std::back_inserter (repr),
6858 " snapshotId={},path={},fileSizeInBytes={},fileFooterSizeInBytes={}," ,
69- snapshot_id, path, file_size_in_bytes, file_footer_size_in_bytes);
59+ statistics_file.snapshot_id , statistics_file.path ,
60+ statistics_file.file_size_in_bytes ,
61+ statistics_file.file_footer_size_in_bytes );
7062 std::format_to (std::back_inserter (repr), " blobMetadata=[" );
71- for (auto iter = blob_metadata.cbegin (); iter != blob_metadata.cend (); ++iter) {
72- if (iter != blob_metadata.cbegin ()) {
73- std::format_to (std::back_inserter (repr), " ,{}" , iter->ToString ());
63+ for (auto iter = statistics_file.blob_metadata .cbegin ();
64+ iter != statistics_file.blob_metadata .cend (); ++iter) {
65+ if (iter != statistics_file.blob_metadata .cbegin ()) {
66+ std::format_to (std::back_inserter (repr), " ,{}" , ToString (*iter));
7467 } else {
75- std::format_to (std::back_inserter (repr), " {}" , iter-> ToString ());
68+ std::format_to (std::back_inserter (repr), " {}" , ToString (*iter ));
7669 }
7770 }
7871 repr += " ]]" ;
7972 return repr;
8073}
8174
75+ std::string ToString (const PartitionStatisticsFile& partition_statistics_file) {
76+ std::string repr = " PartitionStatisticsFile[" ;
77+ std::format_to (std::back_inserter (repr), " snapshotId={},path={},fileSizeInBytes={}," ,
78+ partition_statistics_file.snapshot_id , partition_statistics_file.path ,
79+ partition_statistics_file.file_size_in_bytes );
80+ return repr;
81+ }
82+
8283} // namespace iceberg
0 commit comments