JuliaDB.jl
JuliaDB.jl copied to clipboard
eltype not type stable
trafficstars
Currently (Julia 0.6) eltype on table with undefined column names returns a Tuple and eltype for defined column names is NamedTuple. Maybe it could be unified for NamedTuple always. This would then work well with Tables.jl.
eltype(table) is type stable:
julia> @inferred eltype(table((x=1:5,y=1:5)))
NamedTuple{(:x, :y),Tuple{Int64,Int64}}
julia> @inferred eltype(table(1:5, 1:5))
Tuple{Int64,Int64}
That being said, I'm 100% on board for forcing the eltype to be a named tuple.
That being said, I'm 100% on board for forcing the eltype to be a named tuple.
Definitely. Having tuples for rows may be technically difficult with missing data as, given that they are covariant, there is no easy way of having rows be of constant type when iterating.