Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/iceberg/table_scan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,9 @@ const std::shared_ptr<TableMetadata>& TableScan::metadata() const { return metad
Result<std::shared_ptr<Snapshot>> TableScan::snapshot() const {
auto snapshot_id = context_.snapshot_id ? context_.snapshot_id.value()
: metadata_->current_snapshot_id;
if (snapshot_id == kInvalidSnapshotId) {
return std::shared_ptr<Snapshot>{nullptr};
}
return metadata_->SnapshotById(snapshot_id);
}

Expand Down
2 changes: 1 addition & 1 deletion src/iceberg/table_scan.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ class ICEBERG_EXPORT TableScan {
/// \brief Returns the table metadata being scanned.
const std::shared_ptr<TableMetadata>& metadata() const;

/// \brief Returns the snapshot to scan.
/// \brief Returns the snapshot to scan. If there is no snapshot, returns nullptr.
Result<std::shared_ptr<Snapshot>> snapshot() const;

/// \brief Returns the projected schema for the scan.
Expand Down
6 changes: 5 additions & 1 deletion src/iceberg/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,11 @@ if(ICEBERG_BUILD_BUNDLE)
parquet_schema_test.cc
parquet_test.cc)

add_iceberg_test(scan_test USE_BUNDLE SOURCES file_scan_task_test.cc)
add_iceberg_test(scan_test
USE_BUNDLE
SOURCES
file_scan_task_test.cc
table_scan_test.cc)

add_iceberg_test(table_update_test
USE_BUNDLE
Expand Down
Loading
Loading