zeroshade commented on code in PR #1229:
URL: https://github.com/apache/iceberg-go/pull/1229#discussion_r3461958297
##########
table/arrow_scanner.go:
##########
@@ -277,29 +430,8 @@ func readDeletes(ctx context.Context, fs iceio.IO,
dataFile iceberg.DataFile) (_
filePathCol :=
tbl.Column(tbl.Schema().FieldIndices("file_path")[0]).Data()
posCol := tbl.Column(tbl.Schema().FieldIndices("pos")[0]).Data()
- dict :=
filePathCol.Chunk(0).(*array.Dictionary).Dictionary().(*array.String)
Review Comment:
Ah, I was misreading the uniqueFinalizeDictionary and missing that it only
returns the dictionary if the input was a dictionary. (ironic since i'm the one
who wrote the whole thing....)
We should definitely simplify using `ArrayDatum` and then do the type switch
so that if it's a dictionary, create the NewDictWrapper so it looks something
like:
```go
var values array.StringLike
switch v := arr.(type) {
case *array.Dictionary:
values = array.NewDictWrapper[string](v)
default:
values = arr.(array.StringLike)
}
// do stuff....
```
which would still simplify the code a lot and avoid needing the whole scalar
handling you're doing
--
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]