alexandre-normand commented on code in PR #718:
URL: https://github.com/apache/iceberg-go/pull/718#discussion_r2790894682
##########
table/table_test.go:
##########
@@ -1663,6 +1664,55 @@ func (t *TableWritingTestSuite) TestOverwriteRecord() {
t.Equal(table.OpAppend, snapshot.Summary.Operation) // Empty table
overwrite becomes append
}
+// TestDelete verifies that Table.Delete properly delegates to
Transaction.Delete
+func (t *TableWritingTestSuite) TestDelete() {
+ testCases := []struct {
+ name string
+ table *table.Table
+ expectedErr error
+ }{
+ {
+ name: "success with copy-on-write",
+ table: t.createTable(
+ table.Identifier{"default",
"overwrite_record_wrapper_v" + strconv.Itoa(t.formatVersion)},
+ t.formatVersion,
+ *iceberg.UnpartitionedSpec,
+ t.tableSchema,
+ ),
+ expectedErr: nil,
+ },
+ {
+ name: "abort on merge-on-read",
+ table: t.createTableWithProps(
+ table.Identifier{"default",
"overwrite_record_wrapper_v" + strconv.Itoa(t.formatVersion)},
+ map[string]string{
+ table.PropertyFormatVersion:
strconv.Itoa(t.formatVersion),
+ table.WriteDeleteModeKey:
table.WriteModeMergeOnRead,
+ },
+ t.tableSchema,
+ ),
+ expectedErr: errors.New("only 'copy-on-write' is
currently supported"),
+ },
+ }
+
+ for _, tc := range testCases {
+ t.Run(tc.name, func() {
+ resultTbl, err := tc.table.Delete(t.ctx,
iceberg.EqualTo(iceberg.Reference("foo"), "bar"), nil)
Review Comment:
Thanks, that's a great idea. I added this in
6ff00fb003dce8a9ac68b48b1a444f580f2ca668.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]