Skip to content

Commit a95f341

Browse files
Sandeep GottimukkalaSandeep Gottimukkala
authored andcommitted
Fixes
1 parent a8d5ee9 commit a95f341

3 files changed

Lines changed: 34 additions & 13 deletions

File tree

src/iceberg/catalog/rest/types.cc

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,21 +128,38 @@ bool PlanTableScanRequest::operator==(const PlanTableScanRequest& other) const {
128128
}
129129

130130
bool BaseScanTaskResponse::operator==(const BaseScanTaskResponse& other) const {
131-
if (plan_tasks != other.plan_tasks) return false;
132-
if (delete_files != other.delete_files) return false;
133-
if (file_scan_tasks.size() != other.file_scan_tasks.size()) return false;
131+
if (plan_tasks != other.plan_tasks) {
132+
return false;
133+
}
134+
if (delete_files != other.delete_files) {
135+
return false;
136+
}
137+
if (file_scan_tasks.size() != other.file_scan_tasks.size()) {
138+
return false;
139+
}
134140
for (size_t i = 0; i < file_scan_tasks.size(); ++i) {
135141
const auto& a = file_scan_tasks[i];
136142
const auto& b = other.file_scan_tasks[i];
137-
if (!a.data_file() != !b.data_file()) return false;
138-
if (a.data_file() && *a.data_file() != *b.data_file()) return false;
139-
if (a.delete_files().size() != b.delete_files().size()) return false;
143+
if (!a.data_file() != !b.data_file()) {
144+
return false;
145+
}
146+
if (a.data_file() && *a.data_file() != *b.data_file()) {
147+
return false;
148+
}
149+
if (a.delete_files().size() != b.delete_files().size()) {
150+
return false;
151+
}
140152
for (size_t j = 0; j < a.delete_files().size(); ++j) {
141-
if (!a.delete_files()[j] != !b.delete_files()[j]) return false;
142-
if (a.delete_files()[j] && *a.delete_files()[j] != *b.delete_files()[j])
153+
if (!a.delete_files()[j] != !b.delete_files()[j]) {
143154
return false;
155+
}
156+
if (a.delete_files()[j] && *a.delete_files()[j] != *b.delete_files()[j]) {
157+
return false;
158+
}
159+
}
160+
if (a.residual_filter() != b.residual_filter()) {
161+
return false;
144162
}
145-
if (a.residual_filter() != b.residual_filter()) return false;
146163
}
147164
return true;
148165
}

src/iceberg/catalog/rest/types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ struct ICEBERG_REST_EXPORT BaseScanTaskResponse {
333333
struct ICEBERG_REST_EXPORT PlanTableScanResponse : BaseScanTaskResponse {
334334
std::string plan_status;
335335
std::string plan_id;
336-
// TODO: Add credentials.
336+
// TODO(sandeepg): Add credentials.
337337

338338
Status Validate() const;
339339

@@ -344,7 +344,7 @@ struct ICEBERG_REST_EXPORT PlanTableScanResponse : BaseScanTaskResponse {
344344
/// available scan tasks.
345345
struct ICEBERG_REST_EXPORT FetchPlanningResultResponse : BaseScanTaskResponse {
346346
std::string plan_status;
347-
// TODO: Add credentials.
347+
// TODO(sandeepg): Add credentials.
348348

349349
Status Validate() const;
350350

src/iceberg/json_serde.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1814,7 +1814,9 @@ Result<DataFile> DataFileFromJson(
18141814
// Parse CountMap: {"keys": [int, ...], "values": [long, ...]}
18151815
auto parse_int_map = [&](std::string_view key,
18161816
std::map<int32_t, int64_t>& target) -> Status {
1817-
if (!json.contains(key) || json.at(key).is_null()) return {};
1817+
if (!json.contains(key) || json.at(key).is_null()) {
1818+
return {};
1819+
}
18181820
ICEBERG_ASSIGN_OR_RAISE(auto map_json, GetJsonValue<nlohmann::json>(json, key));
18191821
ICEBERG_ASSIGN_OR_RAISE(auto keys,
18201822
GetTypedJsonValue<std::vector<int32_t>>(map_json.at("keys")));
@@ -1837,7 +1839,9 @@ Result<DataFile> DataFileFromJson(
18371839
// Parse BinaryMap: {"keys": [int, ...], "values": [...]}
18381840
auto parse_binary_map = [&](std::string_view key,
18391841
std::map<int32_t, std::vector<uint8_t>>& target) -> Status {
1840-
if (!json.contains(key) || json.at(key).is_null()) return {};
1842+
if (!json.contains(key) || json.at(key).is_null()) {
1843+
return {};
1844+
}
18411845
ICEBERG_ASSIGN_OR_RAISE(auto map_json, GetJsonValue<nlohmann::json>(json, key));
18421846
ICEBERG_ASSIGN_OR_RAISE(auto keys,
18431847
GetJsonValue<std::vector<int32_t>>(map_json, "keys"));

0 commit comments

Comments
 (0)