maleadt commented on issue #506:
URL: https://github.com/apache/arrow-julia/issues/506#issuecomment-2127382038

   Thanks for the quick comments!
   
   > The workaround is to ask DataFrames to copy the columns:
   > 
   > ```julia
   > DataFrame(Arrow.Table("/tmp/test.arrow")); copycols=true)
   > ```
   
   Hmm, I don't see any effect of that here:
   
   ```julia
   julia> typeof(df.foo)
   Vector{Vector{Int64}} (alias for Array{Array{Int64, 1}, 1})
   
   julia> Arrow.write("/tmp/test.arrow", df);
   julia> df2 = DataFrame(Arrow.Table("/tmp/test.arrow"); copycols=true);
   
   julia> typeof(df2.foo)
   Vector{SubArray{Int64, 1, Primitive{Int64, Vector{Int64}}, 
Tuple{UnitRange{Int64}}, true}} (alias for Array{SubArray{Int64, 1, 
Arrow.Primitive{Int64, Array{Int64, 1}}, Tuple{UnitRange{Int64}}, true}, 1})
   ```
   
   The snippet you posted is a little ambiguous, but additionally calling 
`copy` or `DataFrame` with `copycols=true` (which seems like the default for 
`copy` anyway) doesn't help either:
   
   ```julia
   julia> df2 = DataFrame(DataFrame(Arrow.Table("/tmp/test.arrow")); 
copycols=true);
   julia> typeof(df2.foo)
   Vector{SubArray{Int64, 1, Primitive{Int64, Vector{Int64}}, 
Tuple{UnitRange{Int64}}, true}} (alias for Array{SubArray{Int64, 1, 
Arrow.Primitive{Int64, Array{Int64, 1}}, Tuple{UnitRange{Int64}}, true}, 1})
   
   julia> df2 = copy(DataFrame(Arrow.Table("/tmp/test.arrow")); copycols=true);
   julia> typeof(df2.foo)
   Vector{SubArray{Int64, 1, Primitive{Int64, Vector{Int64}}, 
Tuple{UnitRange{Int64}}, true}} (alias for Array{SubArray{Int64, 1, 
Arrow.Primitive{Int64, Array{Int64, 1}}, Tuple{UnitRange{Int64}}, true}, 1})
   ```


-- 
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]

Reply via email to