Skip to content
Merged
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
1 change: 1 addition & 0 deletions src/iceberg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ set(ICEBERG_SOURCES
update/merge_append.cc
update/merging_snapshot_update.cc
update/pending_update.cc
update/row_delta.cc
update/set_snapshot.cc
update/snapshot_manager.cc
update/snapshot_update.cc
Expand Down
1 change: 1 addition & 0 deletions src/iceberg/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ iceberg_sources = files(
'update/merge_append.cc',
'update/merging_snapshot_update.cc',
'update/pending_update.cc',
'update/row_delta.cc',
'update/set_snapshot.cc',
'update/snapshot_manager.cc',
'update/snapshot_update.cc',
Expand Down
15 changes: 15 additions & 0 deletions src/iceberg/table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "iceberg/update/expire_snapshots.h"
#include "iceberg/update/fast_append.h"
#include "iceberg/update/merge_append.h"
#include "iceberg/update/row_delta.h"
#include "iceberg/update/set_snapshot.h"
#include "iceberg/update/snapshot_manager.h"
#include "iceberg/update/update_location.h"
Expand Down Expand Up @@ -231,6 +232,12 @@ Result<std::shared_ptr<DeleteFiles>> Table::NewDeleteFiles() {
return DeleteFiles::Make(name().name, std::move(ctx));
}

Result<std::shared_ptr<RowDelta>> Table::NewRowDelta() {
Comment thread
manuzhang marked this conversation as resolved.
ICEBERG_ASSIGN_OR_RAISE(
auto ctx, TransactionContext::Make(shared_from_this(), TransactionKind::kUpdate));
return RowDelta::Make(name().name, std::move(ctx));
}

Result<std::shared_ptr<UpdateStatistics>> Table::NewUpdateStatistics() {
ICEBERG_ASSIGN_OR_RAISE(
auto ctx, TransactionContext::Make(shared_from_this(), TransactionKind::kUpdate));
Expand Down Expand Up @@ -334,6 +341,14 @@ Result<std::shared_ptr<MergeAppend>> StaticTable::NewMergeAppend() {
return NotSupported("Cannot create a merge append for a static table");
}

Result<std::shared_ptr<DeleteFiles>> StaticTable::NewDeleteFiles() {
return NotSupported("Cannot create delete files for a static table");
}

Result<std::shared_ptr<RowDelta>> StaticTable::NewRowDelta() {
return NotSupported("Cannot create a row delta for a static table");
}

Result<std::shared_ptr<SnapshotManager>> StaticTable::NewSnapshotManager() {
return NotSupported("Cannot create a snapshot manager for a static table");
}
Expand Down
7 changes: 7 additions & 0 deletions src/iceberg/table.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ class ICEBERG_EXPORT Table : public std::enable_shared_from_this<Table> {
/// \brief Create a new DeleteFiles to delete data files and commit the changes.
virtual Result<std::shared_ptr<DeleteFiles>> NewDeleteFiles();

/// \brief Create a new RowDelta to add rows and row-level deletes.
virtual Result<std::shared_ptr<RowDelta>> NewRowDelta();

/// \brief Create a new SnapshotManager to manage snapshots and snapshot references.
virtual Result<std::shared_ptr<SnapshotManager>> NewSnapshotManager();

Expand Down Expand Up @@ -251,6 +254,10 @@ class ICEBERG_EXPORT StaticTable : public Table {

Result<std::shared_ptr<MergeAppend>> NewMergeAppend() override;

Result<std::shared_ptr<DeleteFiles>> NewDeleteFiles() override;

Result<std::shared_ptr<RowDelta>> NewRowDelta() override;

Result<std::shared_ptr<SnapshotManager>> NewSnapshotManager() override;

private:
Expand Down
1 change: 1 addition & 0 deletions src/iceberg/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ if(ICEBERG_BUILD_BUNDLE)
merge_append_test.cc
merging_snapshot_update_test.cc
name_mapping_update_test.cc
row_delta_test.cc
snapshot_manager_test.cc
transaction_test.cc
update_location_test.cc
Expand Down
Loading
Loading