@@ -37,10 +37,16 @@ namespace iceberg {
3737// /
3838// / This matches the Java Iceberg pattern where BaseTransaction stores a
3939// / List<PendingUpdate> without type parameters.
40- class ICEBERG_EXPORT PendingUpdate {
40+ class ICEBERG_EXPORT PendingUpdate : public ErrorCollector {
4141 public:
4242 virtual ~PendingUpdate () = default ;
4343
44+ // / \brief Verify that the changes are valid and apply them.
45+ // / \return Status::OK if the changes are valid, or an error:
46+ // / - ValidationFailed: if pending changes cannot be applied
47+ // / - InvalidArgument: if pending changes are conflicting
48+ virtual Status Apply () = 0;
49+
4450 // / \brief Apply and commit the pending changes to the table
4551 // /
4652 // / Changes are committed by calling the underlying table's commit operation.
@@ -63,33 +69,4 @@ class ICEBERG_EXPORT PendingUpdate {
6369 PendingUpdate () = default ;
6470};
6571
66- // / \brief Template class for type-safe table metadata changes using builder pattern
67- // /
68- // / PendingUpdateTyped extends PendingUpdate with a type-safe Apply() method that
69- // / returns the specific result type for each operation. Subclasses implement
70- // / specific types of table updates such as schema changes, property updates, or
71- // / snapshot-producing operations like appends and deletes.
72- // /
73- // / Apply() can be used to validate and inspect the uncommitted changes before
74- // / committing. Commit() applies the changes and commits them to the table.
75- // /
76- // / \tparam T The type of result returned by Apply()
77- template <typename T>
78- class ICEBERG_EXPORT PendingUpdateTyped : public PendingUpdate, public ErrorCollector {
79- public:
80- ~PendingUpdateTyped () override = default ;
81-
82- // / \brief Apply the pending changes and return the uncommitted result
83- // /
84- // / This does not result in a permanent update.
85- // /
86- // / \return the uncommitted changes that would be committed, or an error:
87- // / - ValidationFailed: if pending changes cannot be applied
88- // / - InvalidArgument: if pending changes are conflicting
89- virtual Result<T> Apply () = 0;
90-
91- protected:
92- PendingUpdateTyped () = default ;
93- };
94-
9572} // namespace iceberg
0 commit comments