Skip to content

Commit 6edd361

Browse files
Sandeep GottimukkalaSandeep Gottimukkala
authored andcommitted
refactor: rename partitionSpecById to partition_spec_by_id
1 parent c115c0a commit 6edd361

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/iceberg/json_serde.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1753,7 +1753,7 @@ Result<std::unique_ptr<TableRequirement>> TableRequirementFromJson(
17531753

17541754
Result<DataFile> DataFileFromJson(
17551755
const nlohmann::json& json,
1756-
const std::unordered_map<int32_t, std::shared_ptr<PartitionSpec>>& partitionSpecById,
1756+
const std::unordered_map<int32_t, std::shared_ptr<PartitionSpec>>& partition_spec_by_id,
17571757
const Schema& schema) {
17581758
if (!json.is_object()) {
17591759
return JsonParseError("DataFile must be a JSON object: {}", SafeDumpJson(json));
@@ -1788,8 +1788,8 @@ Result<DataFile> DataFileFromJson(
17881788
SafeDumpJson(partition_vals));
17891789
}
17901790
std::vector<Literal> literals;
1791-
auto it = partitionSpecById.find(df.partition_spec_id.value_or(-1));
1792-
if (it == partitionSpecById.end()) {
1791+
auto it = partition_spec_by_id.find(df.partition_spec_id.value_or(-1));
1792+
if (it == partition_spec_by_id.end()) {
17931793
return JsonParseError("Invalid partition spec id: {}",
17941794
df.partition_spec_id.value_or(-1));
17951795
}
@@ -1897,7 +1897,7 @@ Result<DataFile> DataFileFromJson(
18971897
Result<std::vector<std::shared_ptr<FileScanTask>>> FileScanTasksFromJson(
18981898
const nlohmann::json& json,
18991899
const std::vector<std::shared_ptr<DataFile>>& delete_files,
1900-
const std::unordered_map<int32_t, std::shared_ptr<PartitionSpec>>& partitionSpecById,
1900+
const std::unordered_map<int32_t, std::shared_ptr<PartitionSpec>>& partition_spec_by_id,
19011901
const Schema& schema) {
19021902
if (!json.is_array()) {
19031903
return JsonParseError("Cannot parse file scan tasks from non-array: {}",
@@ -1913,7 +1913,7 @@ Result<std::vector<std::shared_ptr<FileScanTask>>> FileScanTasksFromJson(
19131913
ICEBERG_ASSIGN_OR_RAISE(auto data_file_json,
19141914
GetJsonValue<nlohmann::json>(task_json, kDataFile));
19151915
ICEBERG_ASSIGN_OR_RAISE(auto data_file,
1916-
DataFileFromJson(data_file_json, partitionSpecById, schema));
1916+
DataFileFromJson(data_file_json, partition_spec_by_id, schema));
19171917

19181918
std::vector<std::shared_ptr<DataFile>> task_delete_files;
19191919
if (task_json.contains(kDeleteFileReferences) &&

src/iceberg/json_serde_internal.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -424,16 +424,16 @@ ICEBERG_EXPORT Result<std::unique_ptr<TableRequirement>> TableRequirementFromJso
424424
/// Binary fields (lower-bounds, upper-bounds, key-metadata) are base64-encoded.
425425
///
426426
/// \param json The JSON object representing a `DataFile`.
427-
/// \param partitionSpecById Map from spec ID to PartitionSpec for type-aware partition
427+
/// \param partition_spec_by_id Map from spec ID to PartitionSpec for type-aware partition
428428
/// parsing.
429-
/// \param schema The table schema, used with partitionSpecById to resolve partition
429+
/// \param schema The table schema, used with partition_spec_by_id to resolve partition
430430
/// types.
431431
/// \return A `DataFile` object or an error if the conversion fails.
432432
ICEBERG_EXPORT Result<DataFile> DataFileFromJson(const nlohmann::json& json);
433433

434434
ICEBERG_EXPORT Result<DataFile> DataFileFromJson(
435435
const nlohmann::json& json,
436-
const std::unordered_map<int32_t, std::shared_ptr<PartitionSpec>>& partitionSpecById,
436+
const std::unordered_map<int32_t, std::shared_ptr<PartitionSpec>>& partition_spec_by_id,
437437
const Schema& schema);
438438

439439
/// \brief Deserializes a JSON array of file scan tasks.
@@ -442,15 +442,15 @@ ICEBERG_EXPORT Result<DataFile> DataFileFromJson(
442442
///
443443
/// \param json The JSON array of file scan task objects.
444444
/// \param delete_files Delete files indexed by the tasks' delete-file-references.
445-
/// \param partitionSpecById Map from spec ID to PartitionSpec for type-aware partition
445+
/// \param partition_spec_by_id Map from spec ID to PartitionSpec for type-aware partition
446446
/// parsing.
447-
/// \param schema The table schema, used with partitionSpecById to resolve partition
447+
/// \param schema The table schema, used with partition_spec_by_id to resolve partition
448448
/// types.
449449
/// \return A vector of `FileScanTask` objects or an error if the conversion fails.
450450
ICEBERG_EXPORT Result<std::vector<std::shared_ptr<FileScanTask>>> FileScanTasksFromJson(
451451
const nlohmann::json& json,
452452
const std::vector<std::shared_ptr<DataFile>>& delete_files,
453-
const std::unordered_map<int32_t, std::shared_ptr<PartitionSpec>>& partitionSpecById,
453+
const std::unordered_map<int32_t, std::shared_ptr<PartitionSpec>>& partition_spec_by_id,
454454
const Schema& schema);
455455

456456
} // namespace iceberg

0 commit comments

Comments
 (0)