gsandeep1241 commented on code in PR #614:
URL: https://github.com/apache/iceberg-cpp/pull/614#discussion_r3353659816
##########
src/iceberg/catalog/rest/resource_paths.cc:
##########
@@ -102,4 +102,27 @@ Result<std::string> ResourcePaths::CommitTransaction()
const {
return std::format("{}/v1/{}transactions/commit", base_uri_, prefix_);
}
+Result<std::string> ResourcePaths::ScanPlan(const TableIdentifier& ident)
const {
+ ICEBERG_ASSIGN_OR_RAISE(std::string encoded_namespace,
EncodeNamespace(ident.ns));
Review Comment:
Done!
##########
src/iceberg/catalog/rest/types.h:
##########
@@ -295,4 +298,73 @@ struct ICEBERG_REST_EXPORT OAuthTokenResponse {
bool operator==(const OAuthTokenResponse&) const = default;
};
+/// \brief Request to initiate a server-side scan planning operation.
+struct ICEBERG_REST_EXPORT PlanTableScanRequest {
+ std::optional<int64_t> snapshot_id;
+ std::vector<std::string> select;
+ std::shared_ptr<Expression> filter;
+ bool case_sensitive = true;
+ bool use_snapshot_schema = false;
+ std::optional<int64_t> start_snapshot_id;
+ std::optional<int64_t> end_snapshot_id;
+ std::vector<std::string> statsFields;
+ std::optional<int64_t> min_rows_required;
+
+ Status Validate() const;
+
+ bool operator==(const PlanTableScanRequest&) const;
+};
+
+/// \brief Base response containing scan tasks and delete files returned by
scan plan
+/// endpoints.
+struct ICEBERG_REST_EXPORT BaseScanTaskResponse {
Review Comment:
Good point on the virtual/non-virtual issue! But instead I'd propose
flattening into three independent structs rather than have the variant.
The variant pushes complexity onto every caller. Each response type has its
own dedicated fromJson method, so we already know the type there and variant
would force a runtime check.
Wdyt?
##########
src/iceberg/test/rest_json_serde_test.cc:
##########
@@ -1380,4 +1381,139 @@ INSTANTIATE_TEST_SUITE_P(
return info.param.test_name;
});
+// Helper: empty schema and specs for scan response tests that don't need
partition
+// parsing.
+static Schema EmptySchema() { return Schema({}, 0); }
+static std::unordered_map<int32_t, std::shared_ptr<PartitionSpec>>
EmptySpecs() {
+ return {};
+}
+
+// --- PlanTableScanResponse ---
+
+TEST(PlanTableScanResponseFromJsonTest, SubmittedStatusMissingOptionalFields) {
Review Comment:
Done!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]