Skip to content

Commit eaa00d4

Browse files
author
xiao.dong
committed
fix comments
1 parent 26ca646 commit eaa00d4

File tree

6 files changed

+12
-13
lines changed

6 files changed

+12
-13
lines changed

src/iceberg/expression/literal.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,7 @@ std::strong_ordering CompareFloat(T lhs, T rhs) {
179179
return lhs_is_negative <=> rhs_is_negative;
180180
}
181181

182-
bool Literal::operator==(const iceberg::Literal& other) const {
183-
return (*this <=> other) == 0;
184-
}
182+
bool Literal::operator==(const Literal& other) const { return (*this <=> other) == 0; }
185183

186184
// Three-way comparison operator
187185
std::partial_ordering Literal::operator<=>(const Literal& other) const {

src/iceberg/file_format.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ enum class ICEBERG_EXPORT FileFormatType {
3636
kAvro,
3737
kOrc,
3838
kPuffin,
39-
kUnknown = 99
4039
};
4140

4241
/// \brief Convert a FileFormatType to a string

src/iceberg/manifest_entry.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
namespace iceberg {
2929

30-
bool ManifestEntry::operator==(const iceberg::ManifestEntry& other) const {
30+
bool ManifestEntry::operator==(const ManifestEntry& other) const {
3131
return status == other.status && snapshot_id == other.snapshot_id &&
3232
sequence_number == other.sequence_number &&
3333
file_sequence_number == other.file_sequence_number &&

src/iceberg/manifest_entry.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ struct ICEBERG_EXPORT DataFile {
7474
std::string file_path;
7575
/// Field id: 101
7676
/// File format type, avro, orc, parquet, or puffin
77-
FileFormatType file_format = FileFormatType::kUnknown;
77+
FileFormatType file_format = FileFormatType::kParquet;
7878
/// Field id: 102
7979
/// Partition data tuple, schema based on the partition spec output using partition
8080
/// field ids

src/iceberg/manifest_list.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
#include "iceberg/iceberg_export.h"
3131
#include "iceberg/result.h"
3232
#include "iceberg/schema_field.h"
33+
#include "iceberg/snapshot.h"
34+
#include "iceberg/table_metadata.h"
3335
#include "iceberg/type.h"
3436

3537
namespace iceberg {
@@ -40,7 +42,7 @@ namespace iceberg {
4042
struct ICEBERG_EXPORT PartitionFieldSummary {
4143
/// Field id: 509
4244
/// Whether the manifest contains at least one partition with a null value for the field
43-
bool contains_null = false;
45+
bool contains_null = true;
4446
/// Field id: 518
4547
/// Whether the manifest contains at least one partition with a NaN value for the field
4648
std::optional<bool> contains_nan;
@@ -97,14 +99,14 @@ struct ICEBERG_EXPORT ManifestFile {
9799
/// Field id: 515
98100
/// The sequence number when the manifest was added to the table; use 0 when reading v1
99101
/// manifest lists
100-
int64_t sequence_number = 0;
102+
int64_t sequence_number = TableMetadata::kInitialSequenceNumber;
101103
/// Field id: 516
102104
/// The minimum data sequence number of all live data or delete files in the manifest;
103105
/// use 0 when reading v1 manifest lists
104-
int64_t min_sequence_number = 0;
106+
int64_t min_sequence_number = TableMetadata::kInitialSequenceNumber;
105107
/// Field id: 503
106108
/// ID of the snapshot where the manifest file was added
107-
int64_t added_snapshot_id = 0;
109+
int64_t added_snapshot_id = Snapshot::kInvalidSnapshotId;
108110
/// Field id: 504
109111
/// Number of entries in the manifest that have status ADDED (1), when null this is
110112
/// assumed to be non-zero
@@ -139,7 +141,7 @@ struct ICEBERG_EXPORT ManifestFile {
139141
std::vector<uint8_t> key_metadata;
140142
/// Field id: 520
141143
/// The starting _row_id to assign to rows added by ADDED data files
142-
int64_t first_row_id = 0;
144+
std::optional<int64_t> first_row_id;
143145

144146
/// \brief Checks if this manifest file contains entries with ADDED status.
145147
bool has_added_files() const { return added_files_count.value_or(1) > 0; }

test/manifest_list_reader_test.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class ManifestListReaderTest : public TempFileTestBase {
4242
file_io_ = std::make_shared<iceberg::arrow::ArrowFileSystemFileIO>(local_fs_);
4343
}
4444

45-
std::vector<ManifestFile> prepare_test_manifest_list() {
45+
std::vector<ManifestFile> PrepareTestManifestList() {
4646
std::vector<ManifestFile> manifest_files;
4747
std::string test_dir_prefix = "/tmp/db/db/iceberg_test/metadata/";
4848
std::vector<std::string> paths = {"2bccd69e-d642-4816-bba0-261cd9bd0d93-m0.avro",
@@ -96,7 +96,7 @@ TEST_F(ManifestListReaderTest, BasicTest) {
9696
ASSERT_EQ(read_result.has_value(), true);
9797
ASSERT_EQ(read_result.value().size(), 4);
9898

99-
auto expected_manifest_list = prepare_test_manifest_list();
99+
auto expected_manifest_list = PrepareTestManifestList();
100100
ASSERT_EQ(read_result.value(), expected_manifest_list);
101101
}
102102

0 commit comments

Comments
 (0)