Skip to content

Loosen type constraints for ArrayPartition copy?  #275

@DrChainsaw

Description

@DrChainsaw

I tried to make use of an ArrayPartition to prevent Arrow.jl arrays from being loaded into ram when concatenating tables.

The problem is that as soon as you want to actually materialise an array to do some operation the type constraints of copy are violated since a copied arrow array becomes a normal array (which I guess is due to the original array being a special type which is mmaped to disk).

I understand this is not the intended use case of this package, but I wonder if something like

function Base.copy(A::ArrayPartition{T}) where T
  newx = copy.(A.x)
  ArrayPartition{T, typeof(newx)}(newx)
end

would work instead of current implementation? This is still type stable (as long as copy.(A.x) is type stable) so it should not have any performance disadvantages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions