zeroshade commented on code in PR #762:
URL: https://github.com/apache/iceberg-go/pull/762#discussion_r2885045756
##########
table/arrow_scanner.go:
##########
@@ -219,20 +222,29 @@ func enrichRecordsWithPosDeleteFields(ctx
context.Context, filePath iceberg.Data
return nil, err
}
- filePathBuilder := array.NewStringBuilder(mem)
- defer filePathBuilder.Release()
- posBuilder := array.NewInt64Builder(mem)
- defer posBuilder.Release()
+ rb := array.NewRecordBuilder(mem, newColsSchema)
+ defer rb.Release()
startPos := nextIdx
nextIdx += inData.NumRows()
+ filePathBuilder, ok := rb.Field(0).(*array.StringBuilder)
+ if !ok {
+ return nil, errors.New("file path field is not a
string")
+ }
+ posBuilder, ok := rb.Field(1).(*array.Int64Builder)
+ if !ok {
+ return nil, errors.New("pos field is not a int64")
+ }
Review Comment:
Since we control the schema, and are making the builder, we don't need the
type checks here, we should be able to just assume they are correct (unit tests
can validate that the output schema is correct) and just do `filePathBuilder,
posBuilder := rb.Field(0).(*array.StringBuilder),
rb.Field(1).(*array.Int64Builder)`
--
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]