You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by qu...@apache.org on 2023/06/08 15:39:39 UTC

[arrow-julia] branch main updated: Fix case of recursively nested lists (#459)

This is an automated email from the ASF dual-hosted git repository.

quinnj pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-julia.git


The following commit(s) were added to refs/heads/main by this push:
     new 074c7a7  Fix case of recursively nested lists (#459)
074c7a7 is described below

commit 074c7a77b821b608ab085c498ef328f4f455375e
Author: Jacob Quinn <qu...@gmail.com>
AuthorDate: Thu Jun 8 09:39:31 2023 -0600

    Fix case of recursively nested lists (#459)
    
    Fixes issue reported by @Moelf in #458.
    
    The issue is we need to get the eltype from the recursively built child
    array instead of as a top-level translation of the current field type.
---
 src/table.jl     | 2 +-
 test/runtests.jl | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/table.jl b/src/table.jl
index ada392d..e61445c 100644
--- a/src/table.jl
+++ b/src/table.jl
@@ -650,7 +650,7 @@ function build(f::Meta.Field, L::ListTypes, batch, rb, de, nodeidx, bufferidx, c
         # juliaeltype returns Vector for List, translate to SubArray
         S = Base.nonmissingtype(T)
         if S <: Vector
-            ST = SubVector{eltype(S), typeof(A)}
+            ST = SubVector{eltype(A), typeof(A)}
             T = S == T ? ST : Union{Missing, ST}
         end
     end
diff --git a/test/runtests.jl b/test/runtests.jl
index 4f84e7c..e0e974b 100644
--- a/test/runtests.jl
+++ b/test/runtests.jl
@@ -698,6 +698,15 @@ t = Arrow.Table(joinpath(dirname(pathof(Arrow)), "../test/java_compressed_zero_l
 
 end
 
+@testset "# 458" begin
+
+x = (; a=[[[[1]]]])
+buf = Arrow.tobuffer(x)
+t = Arrow.Table(buf)
+@test t.a[1][1][1][1] == 1
+
+end
+
 end # @testset "misc"
 
 end