laskoviymishka commented on code in PR #762:
URL: https://github.com/apache/iceberg-go/pull/762#discussion_r2885066412
##########
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:
i'm a bit paranoic here :D
##########
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:
i'm a bit paranoic here :D
##########
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:
i'm a bit paranoic here :D
--
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]