in src/table.jl [819:867]
function build(
f::Meta.Field,
L::ListTypes,
batch,
rb,
de,
nodeidx,
bufferidx,
varbufferidx,
convert,
)
@debug "building array: L = $L"
validity = buildbitmap(batch, rb, nodeidx, bufferidx)
bufferidx += 1
buffer = rb.buffers[bufferidx]
ooff = batch.pos + buffer.offset
OT = L isa LargeLists ? Int64 : Int32
bytes, offs = reinterp(OT, batch, buffer, rb.compression)
offsets = Offsets(bytes, offs)
bufferidx += 1
len = rb.nodes[nodeidx].length
nodeidx += 1
meta = buildmetadata(f.custom_metadata)
T = juliaeltype(f, meta, convert)
if L isa Meta.Utf8 ||
L isa Meta.Utf8View ||
L isa Meta.LargeUtf8 ||
L isa Meta.Binary ||
L isa Meta.BinaryView ||
L isa Meta.LargeBinary
buffer = rb.buffers[bufferidx]
bytes, A = reinterp(UInt8, batch, buffer, rb.compression)
bufferidx += 1
else
bytes = UInt8[]
A, nodeidx, bufferidx, varbufferidx =
build(f.children[1], batch, rb, de, nodeidx, bufferidx, varbufferidx, convert)
S = Base.nonmissingtype(T)
if S <: Vector
ST = SubVector{eltype(A),typeof(A)}
T = S == T ? ST : Union{Missing,ST}
end
end
return List{T,OT,typeof(A)}(bytes, validity, offsets, A, len, meta),
nodeidx,
bufferidx,
varbufferidx
end