Skip to content

Commit efcaab3

Browse files
Sandeep GottimukkalaSandeep Gottimukkala
authored andcommitted
Clang fmt
1 parent 8112bfe commit efcaab3

7 files changed

Lines changed: 32 additions & 22 deletions

File tree

src/iceberg/catalog/rest/endpoint.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,18 @@ class ICEBERG_REST_EXPORT Endpoint {
134134
}
135135

136136
static Endpoint FetchPlanningResult() {
137-
return {HttpMethod::kGet, "/v1/{prefix}/namespaces/{namespace}/tables/{table}/plan/{plan-id}"};
137+
return {HttpMethod::kGet,
138+
"/v1/{prefix}/namespaces/{namespace}/tables/{table}/plan/{plan-id}"};
138139
}
139140

140141
static Endpoint CancelPlanning() {
141-
return {HttpMethod::kDelete, "/v1/{prefix}/namespaces/{namespace}/tables/{table}/plan/{plan-id}"};
142+
return {HttpMethod::kDelete,
143+
"/v1/{prefix}/namespaces/{namespace}/tables/{table}/plan/{plan-id}"};
142144
}
143145

144146
static Endpoint FetchScanTasks() {
145-
return {HttpMethod::kPost, "/v1/{prefix}/namespaces/{namespace}/tables/{table}/tasks"};
147+
return {HttpMethod::kPost,
148+
"/v1/{prefix}/namespaces/{namespace}/tables/{table}/tasks"};
146149
}
147150

148151
private:

src/iceberg/catalog/rest/error_handlers.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,7 @@ Status ViewCommitErrorHandler::Accept(const ErrorResponse& error) const {
187187
}
188188

189189
const std::shared_ptr<ScanPlanErrorHandler>& ScanPlanErrorHandler::Instance() {
190-
static const std::shared_ptr<ScanPlanErrorHandler> instance{
191-
new ScanPlanErrorHandler()};
190+
static const std::shared_ptr<ScanPlanErrorHandler> instance{new ScanPlanErrorHandler()};
192191
return instance;
193192
}
194193

@@ -215,5 +214,4 @@ Status ScanPlanErrorHandler::Accept(const ErrorResponse& error) const {
215214
return DefaultErrorHandler::Accept(error);
216215
}
217216

218-
219217
} // namespace iceberg::rest

src/iceberg/catalog/rest/json_serde_internal.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,21 @@ ICEBERG_DECLARE_JSON_SERDE(OAuthTokenResponse)
6868

6969
ICEBERG_REST_EXPORT Result<PlanTableScanResponse> PlanTableScanResponseFromJson(
7070
const nlohmann::json& json,
71-
const std::unordered_map<int32_t, std::shared_ptr<PartitionSpec>>& partition_specs_by_id,
71+
const std::unordered_map<int32_t, std::shared_ptr<PartitionSpec>>&
72+
partition_specs_by_id,
7273
const Schema& schema);
7374

74-
ICEBERG_REST_EXPORT Result<FetchPlanningResultResponse> FetchPlanningResultResponseFromJson(
75+
ICEBERG_REST_EXPORT Result<FetchPlanningResultResponse>
76+
FetchPlanningResultResponseFromJson(
7577
const nlohmann::json& json,
76-
const std::unordered_map<int32_t, std::shared_ptr<PartitionSpec>>& partition_specs_by_id,
78+
const std::unordered_map<int32_t, std::shared_ptr<PartitionSpec>>&
79+
partition_specs_by_id,
7780
const Schema& schema);
7881

7982
ICEBERG_REST_EXPORT Result<FetchScanTasksResponse> FetchScanTasksResponseFromJson(
8083
const nlohmann::json& json,
81-
const std::unordered_map<int32_t, std::shared_ptr<PartitionSpec>>& partition_specs_by_id,
84+
const std::unordered_map<int32_t, std::shared_ptr<PartitionSpec>>&
85+
partition_specs_by_id,
8286
const Schema& schema);
8387

8488
ICEBERG_REST_EXPORT Result<nlohmann::json> ToJson(const PlanTableScanRequest& request);

src/iceberg/catalog/rest/resource_paths.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ Result<std::string> ResourcePaths::ScanPlan(const TableIdentifier& ident) const
109109
encoded_namespace, encoded_table_name);
110110
}
111111

112-
Result<std::string> ResourcePaths::ScanPlan(const TableIdentifier& ident, const std::string& plan_id) const {
112+
Result<std::string> ResourcePaths::ScanPlan(const TableIdentifier& ident,
113+
const std::string& plan_id) const {
113114
ICEBERG_ASSIGN_OR_RAISE(std::string encoded_namespace, EncodeNamespace(ident.ns));
114115
ICEBERG_ASSIGN_OR_RAISE(std::string encoded_table_name, EncodeString(ident.name));
115116
return std::format("{}/v1/{}namespaces/{}/tables/{}/plan/{}", base_uri_, prefix_,

src/iceberg/catalog/rest/rest_catalog.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ class ICEBERG_REST_EXPORT RestCatalog : public Catalog,
109109
Result<FetchPlanningResultResponse> FetchPlanningResult(
110110
const Table& table, const std::string& plan_id) override;
111111
Status CancelPlanning(const Table& table, const std::string& plan_id) override;
112-
Result<FetchScanTasksResponse> FetchScanTasks(
113-
const Table& table, const std::string& plan_task) override;
112+
Result<FetchScanTasksResponse> FetchScanTasks(const Table& table,
113+
const std::string& plan_task) override;
114114

115115
private:
116116
RestCatalog(RestCatalogProperties config, std::shared_ptr<FileIO> file_io,

src/iceberg/json_serde_internal.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,10 @@ 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 parsing.
428-
/// \param schema The table schema, used with partitionSpecById to resolve partition types.
427+
/// \param partitionSpecById Map from spec ID to PartitionSpec for type-aware partition
428+
/// parsing.
429+
/// \param schema The table schema, used with partitionSpecById to resolve partition
430+
/// types.
429431
/// \return A `DataFile` object or an error if the conversion fails.
430432
ICEBERG_EXPORT Result<DataFile> DataFileFromJson(const nlohmann::json& json);
431433

@@ -440,8 +442,10 @@ ICEBERG_EXPORT Result<DataFile> DataFileFromJson(
440442
///
441443
/// \param json The JSON array of file scan task objects.
442444
/// \param delete_files Delete files indexed by the tasks' delete-file-references.
443-
/// \param partitionSpecById Map from spec ID to PartitionSpec for type-aware partition parsing.
444-
/// \param schema The table schema, used with partitionSpecById to resolve partition types.
445+
/// \param partitionSpecById Map from spec ID to PartitionSpec for type-aware partition
446+
/// parsing.
447+
/// \param schema The table schema, used with partitionSpecById to resolve partition
448+
/// types.
445449
/// \return A vector of `FileScanTask` objects or an error if the conversion fails.
446450
ICEBERG_EXPORT Result<std::vector<FileScanTask>> FileScanTasksFromJson(
447451
const nlohmann::json& json, const std::vector<DataFile>& delete_files,

src/iceberg/test/endpoint_test.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,11 @@ TEST(EndpointTest, FromStringInvalid) {
264264
TEST(EndpointTest, StringRoundTrip) {
265265
// Create various endpoints and verify they survive string round-trip
266266
std::vector<Endpoint> endpoints = {
267-
Endpoint::ListNamespaces(), Endpoint::GetNamespaceProperties(),
268-
Endpoint::CreateNamespace(), Endpoint::LoadTable(),
269-
Endpoint::CreateTable(), Endpoint::DeleteTable(),
270-
Endpoint::PlanTableScan(), Endpoint::FetchPlanningResult(),
271-
Endpoint::CancelPlanning(), Endpoint::FetchScanTasks(),
267+
Endpoint::ListNamespaces(), Endpoint::GetNamespaceProperties(),
268+
Endpoint::CreateNamespace(), Endpoint::LoadTable(),
269+
Endpoint::CreateTable(), Endpoint::DeleteTable(),
270+
Endpoint::PlanTableScan(), Endpoint::FetchPlanningResult(),
271+
Endpoint::CancelPlanning(), Endpoint::FetchScanTasks(),
272272
};
273273

274274
for (const auto& original : endpoints) {

0 commit comments

Comments
 (0)