JuliaData / Feather.jl

Read and write feather files in pure Julia
https://juliadata.github.io/Feather.jl/stable
Other
109 stars 27 forks source link

`Arrow.BitPrimitive` is indexed wrongly, should probably be casted to BitArray #127

Open davidavdav opened 4 years ago

davidavdav commented 4 years ago

Hello,

I found that boolean columns index strangely when they are of type Arrow.BitPrimitive. A minimum working error:

y = DataFrame(ok=rand(Bool, 100))
@assert length(y.ok[trues(100)]) == 100 ## true
Feather.write("test.feather", y)
y = Feather.read("test.feather")
@assert length(y.ok[trues(100)]) == 100 ## false

a fix for me would be

y.ok = BitArray(y.ok)
@assert length(y.ok[trues(100)]) == 100 ## true

I don't know what the Arrow types are, but the BitPrimitive type should probably be converted to BitArray