gsandeep1241 commented on code in PR #614:
URL: https://github.com/apache/iceberg-cpp/pull/614#discussion_r3255496890
##########
src/iceberg/catalog.h:
##########
@@ -26,8 +26,10 @@
#include <unordered_set>
#include <vector>
+#include "iceberg/catalog/rest/types.h"
Review Comment:
Sounds good, I removed the changes to this file and will handle it in a
different PR as discussed below.
##########
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 {
+ std::vector<std::string> plan_tasks;
+ std::vector<FileScanTask> file_scan_tasks;
+ std::vector<DataFile> delete_files;
+ // std::unordered_map<std::string, PartitionSpec> specsById;
+
+ Status Validate() const { return {}; };
+
+ bool operator==(const BaseScanTaskResponse&) const;
+};
+
+/// \brief Response from initiating a scan planning operation, including plan
status and
+/// initial scan tasks.
+struct ICEBERG_REST_EXPORT PlanTableScanResponse : BaseScanTaskResponse {
+ std::string plan_status;
Review Comment:
Makes sense, done.
##########
src/iceberg/catalog.h:
##########
@@ -188,6 +190,44 @@ class ICEBERG_EXPORT Catalog {
/// \return a Table instance or ErrorKind::kAlreadyExists if the table
already exists
virtual Result<std::shared_ptr<Table>> RegisterTable(
const TableIdentifier& identifier, const std::string&
metadata_file_location) = 0;
+
+ /// \brief Initiate a scan planning operation for the given table.
+ ///
+ /// \param table The table to scan.
+ /// \param context The scan context containing snapshot, filter, and other
options.
+ /// \return A PlanTableScanResponse with the plan status and initial scan
tasks.
+ virtual Result<rest::PlanTableScanResponse> PlanTableScan(
Review Comment:
Removed the changes. from this PR.
##########
src/iceberg/catalog.h:
##########
@@ -26,8 +26,10 @@
#include <unordered_set>
#include <vector>
+#include "iceberg/catalog/rest/types.h"
#include "iceberg/result.h"
#include "iceberg/table_identifier.h"
+#include "iceberg/table_scan.h"
Review Comment:
Sounds good, I removed the changes to this file and will handle it in a
different PR as discussed below.
##########
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 {
+ std::vector<std::string> plan_tasks;
+ std::vector<FileScanTask> file_scan_tasks;
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]