Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with ChainedVector with non-Vector storage #107

Closed
mtsch opened this issue Oct 29, 2024 · 1 comment · Fixed by #108
Closed

Error with ChainedVector with non-Vector storage #107

mtsch opened this issue Oct 29, 2024 · 1 comment · Fixed by #108

Comments

@mtsch
Copy link

mtsch commented Oct 29, 2024

Hi,
Since #106, ChainedVectors can't be indexed when their storage is any type other than Vector, as unsafe_copyto! is not defined on them (see MWE below). I ran into this when using Arrow.jl with chunked tables, which store the columns as ChainedVector{Arrow.Primitive}.

julia> using SentinelArrays
julia> x = ChainedVector([1:2, 3:4])
julia> x[1:2]
ERROR: MethodError: no method matching unsafe_copyto!(::Vector{Int64}, ::Int64, ::UnitRange{Int64}, ::Int64, ::Int64)
The function `unsafe_copyto!` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  unsafe_copyto!(::Array, ::Any, ::Array, ::Any, ::Any)
   @ Base array.jl:282
  unsafe_copyto!(::BitArray, ::Integer, ::Union{BitArray, Array}, ::Integer, ::Integer)
   @ Base bitarray.jl:456
  unsafe_copyto!(::Memory{T}, ::Any, ::Memory{T}, ::Any, ::Any) where T
   @ Base genericmemory.jl:128
  ...

Stacktrace:
 [1] getindex(x::ChainedVector{Int64, UnitRange{Int64}}, inds::UnitRange{Int64})
   @ SentinelArrays ~/.julia/packages/SentinelArrays/v0rcL/src/chainedvector.jl:202
@devmotion devmotion mentioned this issue Nov 1, 2024
@devmotion
Copy link
Contributor

I opened #108.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants