Skip to content

Commit 23bf661

Browse files
author
shuxu.li
committed
feat: add table-update api to transaction interface
1 parent 6fe80fe commit 23bf661

File tree

2 files changed

+89
-0
lines changed

2 files changed

+89
-0
lines changed

src/iceberg/transaction.h

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,76 @@ class ICEBERG_EXPORT Transaction {
3939
/// \return this transaction's table
4040
virtual const std::shared_ptr<Table>& table() const = 0;
4141

42+
/// \brief Create a new schema addition operation
43+
///
44+
/// \return a new AddSchema
45+
virtual std::shared_ptr<AddSchema> AddSchema() = 0;
46+
47+
/// \brief Create a new set current schema operation
48+
///
49+
/// \param schema_id the schema id to set as current
50+
/// \return a new SetCurrentSchema
51+
virtual std::shared_ptr<SetCurrentSchema> SetCurrentSchema(int32_t schema_id) = 0;
52+
53+
/// \brief Create a new remove schemas operation
54+
///
55+
/// \param schema_ids the schema ids to remove
56+
/// \return a new RemoveSchemas
57+
virtual std::shared_ptr<RemoveSchemas> RemoveSchemas(
58+
const std::vector<int32_t>& schema_ids) = 0;
59+
60+
/// \brief Create a new partition spec addition operation
61+
///
62+
/// \return a new AddPartitionSpec
63+
virtual std::shared_ptr<AddPartitionSpec> AddPartitionSpec() = 0;
64+
65+
/// \brief Create a new set default partition spec operation
66+
///
67+
/// \param spec_id the partition spec id to set as default
68+
/// \return a new SetDefaultPartitionSpec
69+
virtual std::shared_ptr<SetDefaultPartitionSpec> SetDefaultPartitionSpec(
70+
int32_t spec_id) = 0;
71+
72+
/// \brief Create a new remove partition specs operation
73+
///
74+
/// \param spec_ids the partition spec ids to remove
75+
/// \return a new RemovePartitionSpecs
76+
virtual std::shared_ptr<RemovePartitionSpecs> RemovePartitionSpecs(
77+
const std::vector<int32_t>& spec_ids) = 0;
78+
79+
/// \brief Create a new sort order addition operation
80+
///
81+
/// \return a new AddSortOrder
82+
virtual std::shared_ptr<AddSortOrder> AddSortOrder() = 0;
83+
84+
/// \brief Create a new set default sort order operation
85+
///
86+
/// \param order_id the sort order id to set as default
87+
/// \return a new SetDefaultSortOrder
88+
virtual std::shared_ptr<SetDefaultSortOrder> SetDefaultSortOrder(int32_t order_id) = 0;
89+
90+
/// \brief Create a new remove sort orders operation
91+
///
92+
/// \param order_ids the sort order ids to remove
93+
/// \return a new RemoveSortOrders
94+
virtual std::shared_ptr<RemoveSortOrders> RemoveSortOrders(
95+
const std::vector<int32_t>& order_ids) = 0;
96+
97+
/// \brief Create a new set properties operation
98+
///
99+
/// \return a new SetProperties
100+
virtual std::shared_ptr<SetProperties> SetProperties() = 0;
101+
102+
/// \brief Create a new remove properties operation
103+
///
104+
/// \return a new RemoveProperties
105+
virtual std::shared_ptr<RemoveProperties> RemoveProperties() = 0;
106+
107+
/// \brief Create a new set location operation
108+
///
109+
/// \return a new SetLocation
110+
virtual std::shared_ptr<SetLocation> SetLocation() = 0;
111+
42112
/// \brief Create a new append API to add files to this table
43113
///
44114
/// \return a new AppendFiles

src/iceberg/type_fwd.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,25 @@ class ArrayLike;
149149
class MapLike;
150150

151151
class TableUpdate;
152+
class AssignUUID;
153+
class UpgradeFormatVersion;
154+
class AddSchema;
155+
class SetCurrentSchema;
156+
class RemoveSchemas;
157+
class AddPartitionSpec;
158+
class SetDefaultPartitionSpec;
159+
class RemovePartitionSpecs;
160+
class AddSortOrder;
161+
class SetDefaultSortOrder;
162+
class RemoveSortOrders;
163+
class AddSnapshot;
164+
class RemoveSnapshots;
165+
class RemoveSnapshotRef;
166+
class SetSnapshotRef;
167+
class SetProperties;
168+
class RemoveProperties;
169+
class SetLocation;
170+
152171
class TableRequirement;
153172
class TableMetadataBuilder;
154173
class TableUpdateContext;

0 commit comments

Comments
 (0)