JuliaData / IndexedTables.jl

Flexible tables with ordered indices
https://juliadb.org
MIT License
121 stars 37 forks source link

Indexes can't be Int128 #271

Open HBreddam opened 4 years ago

HBreddam commented 4 years ago

The code below gives a Method error, but works if I remove the Int128 from the key array.

vals = [i for i in 1:10]

keys = [Int128(i) for i in 1:10]

testsparse = ndsparse((a=keys,),(c=vals,))

julia> testsparse[1]

ERROR: MethodError: no method matching get(::IndexedTables.var"#146#147"{Tuple{Int64}}, ::NDSparse{NamedTuple{(:c,),Tuple{Int64}},Tuple{Int128},StructArrays.StructArray{NamedTuple{(:a,),Tuple{Int128}},1,NamedTuple{(:a,),Tuple{Array{Int128,1}}},Int64},StructArrays.StructArray{NamedTuple{(:c,),Tuple{Int64}},1,NamedTuple{(:c,),Tuple{Array{Int64,1}}},Int64}}, ::Tuple{Int64})
Closest candidates are:
  get(::REPL.Terminals.TTYTerminal, ::Any, ::Any) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\REPL\src\Terminals.jl:176
  get(::IdDict{K,V}, ::Any, ::Any) where {K, V} at abstractdict.jl:596
  get(::Union{Function, Type}, ::IdDict{K,V}, ::Any) where {K, V} at abstractdict.jl:651
  ...
Stacktrace:
 [1] _getindex_scalar(::NDSparse{NamedTuple{(:c,),Tuple{Int64}},Tuple{Int128},StructArrays.StructArray{NamedTuple{(:a,),Tuple{Int128}},1,NamedTuple{(:a,),Tuple{Array{Int128,1}}},Int64},StructArrays.StructArray{NamedTuple{(:c,),Tuple{Int64}},1,NamedTuple{(:c,),Tuple{Array{Int64,1}}},Int64}}, ::Tuple{Int64}) at C:\Users\hebb\.julia\packages\IndexedTables\5U0Ap\src\indexing.jl:21
 [2] _getindex(::NDSparse{NamedTuple{(:c,),Tuple{Int64}},Tuple{Int128},StructArrays.StructArray{NamedTuple{(:a,),Tuple{Int128}},1,NamedTuple{(:a,),Tuple{Array{Int128,1}}},Int64},StructArrays.StructArray{NamedTuple{(:c,),Tuple{Int64}},1,NamedTuple{(:c,),Tuple{Array{Int64,1}}},Int64}}, ::Tuple{Int64}) at C:\Users\hebb\.julia\packages\IndexedTables\5U0Ap\src\indexing.jl:18
 [3] getindex(::NDSparse{NamedTuple{(:c,),Tuple{Int64}},Tuple{Int128},StructArrays.StructArray{NamedTuple{(:a,),Tuple{Int128}},1,NamedTuple{(:a,),Tuple{Array{Int128,1}}},Int64},StructArrays.StructArray{NamedTuple{(:c,),Tuple{Int64}},1,NamedTuple{(:c,),Tuple{Array{Int64,1}}},Int64}}, ::Int64) at C:\Users\hebb\.julia\packages\IndexedTables\5U0Ap\src\indexing.jl:15
 [4] top-level scope at none:0