Skip to content

Commit 96df225

Browse files
author
shuxu.li
committed
feat: add table-update api to transaction interface
1 parent 2f0955e commit 96df225

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
@@ -38,6 +38,76 @@ class ICEBERG_EXPORT Transaction {
3838
/// \return this transaction's table
3939
virtual const std::shared_ptr<Table>& table() const = 0;
4040

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

src/iceberg/type_fwd.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,25 @@ class StructLike;
155155
class StructLikeAccessor;
156156

157157
class TableUpdate;
158+
class AssignUUID;
159+
class UpgradeFormatVersion;
160+
class AddSchema;
161+
class SetCurrentSchema;
162+
class RemoveSchemas;
163+
class AddPartitionSpec;
164+
class SetDefaultPartitionSpec;
165+
class RemovePartitionSpecs;
166+
class AddSortOrder;
167+
class SetDefaultSortOrder;
168+
class RemoveSortOrders;
169+
class AddSnapshot;
170+
class RemoveSnapshots;
171+
class RemoveSnapshotRef;
172+
class SetSnapshotRef;
173+
class SetProperties;
174+
class RemoveProperties;
175+
class SetLocation;
176+
158177
class TableRequirement;
159178
class TableMetadataBuilder;
160179
class TableUpdateContext;

0 commit comments

Comments
 (0)