WZhuo commented on code in PR #590:
URL: https://github.com/apache/iceberg-cpp/pull/590#discussion_r2964404072
##########
src/iceberg/table_scan.h:
##########
@@ -29,6 +29,7 @@
#include "iceberg/arrow_c_data.h"
#include "iceberg/result.h"
+#include "iceberg/table_metadata.h"
Review Comment:
`IncrementalScan<ScanTaskType>::PlanFiles()` method must implement in header
file, it compiles error in msvc env if implement it in source file. Of course,
It's better not include it, will see how to fix it.
##########
src/iceberg/table_scan.h:
##########
@@ -132,6 +133,17 @@ struct TableScanContext {
// Validate the context parameters to see if they have conflicts.
[[nodiscard]] Status Validate() const;
+
+ /// \brief Returns true if this scan is a current lineage scan, which means
it does not
+ /// specify from/to snapshot IDs.
+ bool IsScanCurrentLineage() const;
Review Comment:
I made these functions members because I don't want to keep writing
context.xxx inside the method bodies
##########
src/iceberg/table_scan.h:
##########
@@ -373,6 +383,26 @@ class ICEBERG_EXPORT IncrementalScan : public TableScan {
using TableScan::TableScan;
};
+// Template method implementation (must be in header for MSVC)
+template <typename ScanTaskType>
+Result<std::vector<std::shared_ptr<ScanTaskType>>>
+IncrementalScan<ScanTaskType>::PlanFiles() const {
+ if (context_.IsScanCurrentLineage()) {
+ ICEBERG_ASSIGN_OR_RAISE(auto current_snapshot, metadata_->Snapshot());
Review Comment:
If `current_snapshot` is nullptr, it indicates that the current table is
empty, so we can simply return an empty task list. Don't need to worry about
the `branch`.
--
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]