apache / arrow-julia

Official Julia implementation of Apache Arrow
https://arrow.apache.org/julia/
Other
283 stars 60 forks source link

`getindex` broken with `SVector{3, UInt}` in the presence of missing data #486

Closed adienes closed 9 months ago

adienes commented 9 months ago

MWE:

julia> df = DataFrame(:a => [1, 2, 3, missing]);

julia> Arrow.write("mwe.arrow", df);

julia> at = Arrow.Table("mwe.arrow");

julia> idxs = @SVector UInt[1,2,3];

julia> at.a[idxs]
ERROR: setindex!() with non-isbitstype eltype is not supported by StaticArrays. Consider using SizedArray.

versioninfo:

julia> versioninfo()
Julia Version 1.9.3
Commit bed2cd540a1 (2023-08-24 14:43 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 10 × Apple M1 Max
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, apple-m1)
  Threads: 1 on 8 virtual cores

(@v1.9) pkg> st Arrow
Status `~/.julia/environments/v1.9/Project.toml`
  [69666777] Arrow v2.6.2
adienes commented 9 months ago

update: I believe this is (mostly) caused by StaticArrays.jl having a bug in its implementation of similar, which did not return a mutable container when eltype is not isbitstype, which is true of Union{Int, Missing}

however, I am still confused about why the above MWE works when idxs = @SVector [1,2,3] (aka, without the UInt)

adienes commented 9 months ago

should be fixed in https://github.com/JuliaArrays/StaticArrays.jl/releases/tag/v1.6.4