You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "tanmayrauth (via GitHub)" <gi...@apache.org> on 2026/06/02 08:09:54 UTC

[PR] feat(table): write deletion vectors for partitioned v3 tables [iceberg-go]

tanmayrauth opened a new pull request, #1151:
URL: https://github.com/apache/iceberg-go/pull/1151

   Lifts the IsUnpartitioned() gate in positionDeleteRecordsToDataFiles so all v3+ writes go through the DV path, and threads partitionContextByFilePath into positionDeleteRecordsToDataFilesDV: each row's (specID, partitionData) is looked up per data file and passed to DVWriter.Add (groundwork: #1136), so output DataFile manifest entries carry the source data file's partition record.
   
   A missing partition context is treated as a programming error rather than silently producing a default-partition entry, matching Java's BaseDVFileWriter contract.
   
   The now-unreachable v3 "prefer deletion vectors" slog.Warn is removed.
   
   Closes #1135.


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] feat(table): write deletion vectors for partitioned v3 tables [iceberg-go]

Posted by "laskoviymishka (via GitHub)" <gi...@apache.org>.
laskoviymishka commented on code in PR #1151:
URL: https://github.com/apache/iceberg-go/pull/1151#discussion_r3395427657


##########
table/arrow_utils.go:
##########
@@ -1753,13 +1750,14 @@ func positionDeleteRecordsToDataFilesDV(ctx context.Context, rootLocation string
 			positions := batch.Column(1).(*array.Int64)
 
 			for i := range batch.NumRows() {
-				// PR (1) of #1135 reshaped DVWriter.Add to take (specID,
-				// partitionData) so the partitioned path can pass through
-				// partitionContext directly. This site is still
-				// unpartitioned-only (the gate above routes partitioned
-				// writes elsewhere), so specID=0 + nil partition. PR (2)
-				// drops the gate and threads partitionContext through here.
-				writer.Add(filePaths.Value(int(i)), []int64{positions.Value(int(i))}, 0, nil)
+				filePath := filePaths.Value(int(i))
+				pCtx, ok := partitionContextByFilePath[filePath]
+				if !ok {
+					yield(nil, fmt.Errorf("unexpected missing partition context for path %s", filePath))

Review Comment:
   this change makes a nil `partitionContextByFilePath` invalid for any v3 row, but `TestDVWritePathCancelledContext` still passes `nil` (it's unchanged in this diff, around line 262 of the test file).
   
   It passes today only because the cancelled iterator yields `(nil, ctx.Err())` before this loop runs — so the lookup never happens. The three other unpartitioned v3 tests in this PR were converted to `unpartitionedContexts(...)`; this one was missed. If anyone later adds a valid row before the cancellation, the failure mode silently flips from "propagates context.Canceled" to "missing partition context." I'd switch it to `unpartitionedContexts()` (or `map[string]partitionContext{}`) to match. Fix that and this lands.



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] feat(table): write deletion vectors for partitioned v3 tables [iceberg-go]

Posted by "laskoviymishka (via GitHub)" <gi...@apache.org>.
laskoviymishka merged PR #1151:
URL: https://github.com/apache/iceberg-go/pull/1151


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] feat(table): write deletion vectors for partitioned v3 tables [iceberg-go]

Posted by "tanmayrauth (via GitHub)" <gi...@apache.org>.
tanmayrauth commented on code in PR #1151:
URL: https://github.com/apache/iceberg-go/pull/1151#discussion_r3397276546


##########
table/arrow_utils.go:
##########
@@ -1753,13 +1750,14 @@ func positionDeleteRecordsToDataFilesDV(ctx context.Context, rootLocation string
 			positions := batch.Column(1).(*array.Int64)
 
 			for i := range batch.NumRows() {
-				// PR (1) of #1135 reshaped DVWriter.Add to take (specID,
-				// partitionData) so the partitioned path can pass through
-				// partitionContext directly. This site is still
-				// unpartitioned-only (the gate above routes partitioned
-				// writes elsewhere), so specID=0 + nil partition. PR (2)
-				// drops the gate and threads partitionContext through here.
-				writer.Add(filePaths.Value(int(i)), []int64{positions.Value(int(i))}, 0, nil)
+				filePath := filePaths.Value(int(i))
+				pCtx, ok := partitionContextByFilePath[filePath]
+				if !ok {
+					yield(nil, fmt.Errorf("unexpected missing partition context for path %s", filePath))

Review Comment:
   Good catch, I've switched TestDVWritePathCancelledContext to pass unpartitionedContexts() instead of nil so it matches the other v3 tests and won't silently flip failure modes if a valid row gets added  before the  cancellation. Test still passes.



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] feat(table): write deletion vectors for partitioned v3 tables [iceberg-go]

Posted by "tanmayrauth (via GitHub)" <gi...@apache.org>.
tanmayrauth commented on PR #1151:
URL: https://github.com/apache/iceberg-go/pull/1151#issuecomment-4676648502

   @laskoviymishka  can you please review this PR?


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] feat(table): write deletion vectors for partitioned v3 tables [iceberg-go]

Posted by "tanmayrauth (via GitHub)" <gi...@apache.org>.
tanmayrauth commented on PR #1151:
URL: https://github.com/apache/iceberg-go/pull/1151#issuecomment-4600081101

   @laskoviymishka @zeroshade  can you please review this PR when you have a moment.


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org