JuliaDB.jl icon indicating copy to clipboard operation
JuliaDB.jl copied to clipboard

Error Saving with DataValues instead of Missing

Open pmarg opened this issue 6 years ago • 3 comments
trafficstars

I have a data set with a number of Union{Missing,[]} columns and I would like to convert it to DataValues since any computation using Missing is extremely slow making the data set unusable.

However, I cannot save the new data set since I get the following error:

ERROR: ArgumentError: unsafe_wrap: pointer 00000000026BC4D5 is not properly aligned to 8 bytes

pmarg avatar Mar 05 '19 08:03 pmarg

Can you share the stacktrace as well?

joshday avatar Mar 05 '19 13:03 joshday

Yes sure:

Stacktrace:
 [1] #systemerror#43(::Nothing, ::Function, ::String, ::Bool) at .\error.jl:134
 [2] systemerror at .\error.jl:134 [inlined]
 [3] #open#309(::Nothing, ::Nothing, ::Nothing, ::Bool, ::Nothing, ::Function, ::String) at .\iostream.jl:283
 [4] #open at .\none:0 [inlined]
 [5] open(::String, ::String) at .\iostream.jl:339
 [6] #open#310(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::getfield(JuliaDB, Symbol("##202#203")){IndexedTable{StructArrays.StructArray{NamedTuple{(:rectype, :year, :caseid, :hh_size, :famincome, :poverty130, :poverty185, :povertylevel, :foodstamp, :hh_numadults, :pernum, :lineno, :lfproxy_cps8, :wt06, :age, :sex, :race, :marst, :genhealth, :height, :weight, :bmi, :educ, :educyrs, :empstat, :occ, :ind2, :ind, :retired, :fullpart, :uhrsworkt, :uhrswork1, :earnweek, :hourwage, :hrsatrate, :earnweek_cps8, :hourwage_cps8, :hrsatrate_cps8, :diffany, :diffcare, :diffeye, :diffhear, :diffmob, :diffphys, :diffrem, :actline, :activity, :duration, :metvalue),Tuple{Int64,Int64,Int64,DataValue{Union{}},DataValue{Union{}},DataValue{Union{}},DataValue{Union{}},DataValue{Union{}},DataValue{Union{}},DataValue{Union{}},Int64,Int64,Int64,Float64,Int64,Int64,Int64,Int64,DataValue{Any},DataValue{Any},DataValue{Any},DataValue{Float64},Int64,Int64,Int64,Int64,Int64,Int64,Int64,Int64,Int64,Int64,Float64,Float64,Int64,Float64,Float64,Int64,DataValue{Any},DataValue{Any},DataValue{Any},DataValue{Any},DataValue{Any},DataValue{Any},DataValue{Any},DataValue{Union{}},DataValue{Union{}},DataValue{Union{}},DataValue{Union{}}}},1,NamedTuple{(:rectype, :year, :caseid, :hh_size, :famincome, :poverty130, :poverty185, :povertylevel, :foodstamp, :hh_numadults, :pernum, :lineno, :lfproxy_cps8, :wt06, :age, :sex, :race, :marst, :genhealth, :height, :weight, :bmi, :educ, :educyrs, :empstat, :occ, :ind2, :ind, :retired, :fullpart, :uhrsworkt, :uhrswork1, :earnweek, :hourwage, :hrsatrate, :earnweek_cps8, :hourwage_cps8, :hrsatrate_cps8, :diffany, :diffcare, :diffeye, :diffhear, :diffmob, :diffphys, :diffrem, :actline, :activity, :duration, :metvalue),Tuple{Array{Int64,1},Array{Int64,1},Array{Int64,1},DataValueArray{Union{},1},DataValueArray{Union{},1},DataValueArray{Union{},1},DataValueArray{Union{},1},DataValueArray{Union{},1},DataValueArray{Union{},1},DataValueArray{Union{},1},Array{Int64,1},Array{Int64,1},Array{Int64,1},Array{Float64,1},Array{Int64,1},Array{Int64,1},Array{Int64,1},Array{Int64,1},DataValueArray{Any,1},DataValueArray{Any,1},DataValueArray{Any,1},DataValueArray{Float64,1},Array{Int64,1},Array{Int64,1},Array{Int64,1},Array{Int64,1},Array{Int64,1},Array{Int64,1},Array{Int64,1},Array{Int64,1},Array{Int64,1},Array{Int64,1},Array{Float64,1},Array{Float64,1},Array{Int64,1},Array{Float64,1},Array{Float64,1},Array{Int64,1},DataValueArray{Any,1},DataValueArray{Any,1},DataValueArray{Any,1},DataValueArray{Any,1},DataValueArray{Any,1},DataValueArray{Any,1},DataValueArray{Any,1},DataValueArray{Union{},1},DataValueArray{Union{},1},DataValueArray{Union{},1},DataValueArray{Union{},1}}}}}}, ::String, ::Vararg{String,N} where N) at .\iostream.jl:367
 [7] open at .\iostream.jl:367 [inlined]
 [8] save(::IndexedTable{StructArrays.StructArray{NamedTuple{(:rectype, :year, :caseid, :hh_size, :famincome, :poverty130, :poverty185, :povertylevel, :foodstamp, :hh_numadults, :pernum, :lineno, :lfproxy_cps8, :wt06, :age, :sex, :race, :marst, :genhealth, :height, :weight, :bmi, :educ, :educyrs, :empstat, :occ, :ind2, :ind, :retired, :fullpart, :uhrsworkt, :uhrswork1, :earnweek, :hourwage, :hrsatrate, :earnweek_cps8, :hourwage_cps8, :hrsatrate_cps8, :diffany, :diffcare, :diffeye, :diffhear, :diffmob, :diffphys, :diffrem, :actline, :activity, :duration, :metvalue),Tuple{Int64,Int64,Int64,DataValue{Union{}},DataValue{Union{}},DataValue{Union{}},DataValue{Union{}},DataValue{Union{}},DataValue{Union{}},DataValue{Union{}},Int64,Int64,Int64,Float64,Int64,Int64,Int64,Int64,DataValue{Any},DataValue{Any},DataValue{Any},DataValue{Float64},Int64,Int64,Int64,Int64,Int64,Int64,Int64,Int64,Int64,Int64,Float64,Float64,Int64,Float64,Float64,Int64,DataValue{Any},DataValue{Any},DataValue{Any},DataValue{Any},DataValue{Any},DataValue{Any},DataValue{Any},DataValue{Union{}},DataValue{Union{}},DataValue{Union{}},DataValue{Union{}}}},1,NamedTuple{(:rectype, :year, :caseid, :hh_size, :famincome, :poverty130, :poverty185, :povertylevel, :foodstamp, :hh_numadults, :pernum, :lineno, :lfproxy_cps8, :wt06, :age, :sex, :race, :marst, :genhealth, :height, :weight, :bmi, :educ, :educyrs, :empstat, :occ, :ind2, :ind, :retired, :fullpart, :uhrsworkt, :uhrswork1, :earnweek, :hourwage, :hrsatrate, :earnweek_cps8, :hourwage_cps8, :hrsatrate_cps8, :diffany, :diffcare, :diffeye, :diffhear, :diffmob, :diffphys, :diffrem, :actline, :activity, :duration, :metvalue),Tuple{Array{Int64,1},Array{Int64,1},Array{Int64,1},DataValueArray{Union{},1},DataValueArray{Union{},1},DataValueArray{Union{},1},DataValueArray{Union{},1},DataValueArray{Union{},1},DataValueArray{Union{},1},DataValueArray{Union{},1},Array{Int64,1},Array{Int64,1},Array{Int64,1},Array{Float64,1},Array{Int64,1},Array{Int64,1},Array{Int64,1},Array{Int64,1},DataValueArray{Any,1},DataValueArray{Any,1},DataValueArray{Any,1},DataValueArray{Float64,1},Array{Int64,1},Array{Int64,1},Array{Int64,1},Array{Int64,1},Array{Int64,1},Array{Int64,1},Array{Int64,1},Array{Int64,1},Array{Int64,1},Array{Int64,1},Array{Float64,1},Array{Float64,1},Array{Int64,1},Array{Float64,1},Array{Float64,1},Array{Int64,1},DataValueArray{Any,1},DataValueArray{Any,1},DataValueArray{Any,1},DataValueArray{Any,1},DataValueArray{Any,1},DataValueArray{Any,1},DataValueArray{Any,1},DataValueArray{Union{},1},DataValueArray{Union{},1},DataValueArray{Union{},1},DataValueArray{Union{},1}}}}}, ::String) at C:\Users\PA.4471\.julia\packages\JuliaDB\ZXPIx\src\io.jl:212
 [9] top-level scope at none:0

pmarg avatar Mar 05 '19 13:03 pmarg

I got a different error now:

ERROR: ArgumentError: unsafe_wrap: pointer 000000000248C4D5 is not properly aligned to 8 bytes
Stacktrace:
 [1] #unsafe_wrap#62 at .\pointer.jl:84 [inlined]
 [2] unsafe_wrap at .\pointer.jl:84 [inlined]
 [3] #mmap#1(::Bool, ::Bool, ::Function, ::IOStream, ::Type{Array{UInt64,1}}, ::Tuple{Int64}, ::Int64) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Mmap\src\Mmap.jl:224
 [4] #mmap at .\none:0 [inlined]
 [5] #mmap#15(::Bool, ::Bool, ::Function, ::IOStream, ::Type{BitArray{1}}, ::Tuple{Int64}, ::Int64) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Mmap\src\Mmap.jl:292
 [6] mmap(::IOStream, ::Type{BitArray{1}}, ::Tuple{Int64}, ::Int64) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Mmap\src\Mmap.jl:290
 [7] mmread(::Type{BitArray{1}}, ::Serialization.Serializer{IOStream}, ::Bool) at C:\Users\PA.4471\.julia\packages\MemPool\tlPqB\src\io.jl:70
 [8] deserialize(::Serialization.Serializer{IOStream}, ::Type{MemPool.MMSer{BitArray{1}}}) at C:\Users\PA.4471\.julia\packages\MemPool\tlPqB\src\io.jl:27
 [9] handle_deserialize(::Serialization.Serializer{IOStream}, ::Int32) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Serialization\src\Serialization.jl:782
 [10] mmread(::Type{DataValueArray}, ::Serialization.Serializer{IOStream}, ::Bool) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Serialization\src\Serialization.jl:731
 [11] deserialize(::Serialization.Serializer{IOStream}, ::Type{MemPool.MMSer{DataValueArray}}) at C:\Users\PA.4471\.julia\packages\MemPool\tlPqB\src\io.jl:27
 [12] handle_deserialize(::Serialization.Serializer{IOStream}, ::Int32) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Serialization\src\Serialization.jl:782
 [13] collect_to!(::Array{Array{Int64,1},1}, ::Base.Generator{UnitRange{Int64},getfield(JuliaDB, Symbol("##30#32")){Serialization.Serializer{IOStream}}}, ::Int64, ::Int64) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Serialization\src\Serialization.jl:731
 [14] collect_to_with_first!(::Array{Array{Int64,1},1}, ::Array{Int64,1}, ::Base.Generator{UnitRange{Int64},getfield(JuliaDB, Symbol("##30#32")){Serialization.Serializer{IOStream}}}, ::Int64) at .\array.jl:630
 [15] collect(::Base.Generator{UnitRange{Int64},getfield(JuliaDB, Symbol("##30#32")){Serialization.Serializer{IOStream}}}) at .\array.jl:611
 [16] mmread(::Type{StructArrays.StructArray{T,1,C} where C<:NamedTuple where T}, ::Serialization.Serializer{IOStream}, ::Bool) at C:\Users\PA.4471\.julia\packages\JuliaDB\ZXPIx\src\serialize.jl:53
 [17] deserialize(::Serialization.Serializer{IOStream}, ::Type{MemPool.MMSer{StructArrays.StructArray{T,1,C} where C<:NamedTuple where T}}) at C:\Users\PA.4471\.julia\packages\MemPool\tlPqB\src\io.jl:27
 [18] handle_deserialize(::Serialization.Serializer{IOStream}, ::Int32) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Serialization\src\Serialization.jl:782
 [19] mmread(::Type{IndexedTable}, ::Serialization.Serializer{IOStream}, ::Bool) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Serialization\src\Serialization.jl:731
 [20] deserialize(::Serialization.Serializer{IOStream}, ::Type{MemPool.MMSer{IndexedTable}}) at C:\Users\PA.4471\.julia\packages\MemPool\tlPqB\src\io.jl:27
 [21] handle_deserialize(::Serialization.Serializer{IOStream}, ::Int32) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Serialization\src\Serialization.jl:782
 [22] deserialize(::Serialization.Serializer{IOStream}) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Serialization\src\Serialization.jl:731
 [23] handle_deserialize(::Serialization.Serializer{IOStream}, ::Int32) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Serialization\src\Serialization.jl:821
 [24] deserialize(::Serialization.Serializer{IOStream}) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Serialization\src\Serialization.jl:731
 [25] deserialize at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Serialization\src\Serialization.jl:718 [inlined]
 [26] #open#310(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::typeof(Serialization.deserialize), ::String) at .\iostream.jl:369
 [27] open at .\iostream.jl:367 [inlined]
 [28] #load#197(::Array{Int64,1}, ::Function, ::String) at C:\Users\PA.4471\.julia\packages\JuliaDB\ZXPIx\src\io.jl:182
 [29] load at C:\Users\PA.4471\.julia\packages\JuliaDB\ZXPIx\src\io.jl:174 [inlined]
 [30] save(::IndexedTable{StructArrays.StructArray{NamedTuple{(:rectype, :year, :caseid, :hh_size, :famincome, :poverty130, :poverty185, :povertylevel, :foodstamp, :hh_numadults, :pernum, :lineno, :lfproxy_cps8, :wt06, :age, :sex, :race, :marst, :genhealth, :height, :weight, :bmi, :educ, :educyrs, :empstat, :occ, :ind2, :ind, :retired, :fullpart, :uhrsworkt, :uhrswork1, :earnweek, :hourwage, :hrsatrate, :earnweek_cps8, :hourwage_cps8, :hrsatrate_cps8, :diffany, :diffcare, :diffeye, :diffhear, :diffmob, :diffphys, :diffrem, :actline, :activity, :duration, :metvalue),Tuple{Int64,Int64,Int64,DataValue{Union{}},DataValue{Union{}},DataValue{Union{}},DataValue{Union{}},DataValue{Union{}},DataValue{Union{}},DataValue{Union{}},Int64,Int64,Int64,Float64,Int64,Int64,Int64,Int64,DataValue{Any},DataValue{Any},DataValue{Any},DataValue{Float64},Int64,Int64,Int64,Int64,Int64,Int64,Int64,Int64,Int64,Int64,Float64,Float64,Int64,Float64,Float64,Int64,DataValue{Any},DataValue{Any},DataValue{Any},DataValue{Any},DataValue{Any},DataValue{Any},DataValue{Any},DataValue{Union{}},DataValue{Union{}},DataValue{Union{}},DataValue{Union{}}}},1,NamedTuple{(:rectype, :year, :caseid, :hh_size, :famincome, :poverty130, :poverty185, :povertylevel, :foodstamp, :hh_numadults, :pernum, :lineno, :lfproxy_cps8, :wt06, :age, :sex, :race, :marst, :genhealth, :height, :weight, :bmi, :educ, :educyrs, :empstat, :occ, :ind2, :ind, :retired, :fullpart, :uhrsworkt, :uhrswork1, :earnweek, :hourwage, :hrsatrate, :earnweek_cps8, :hourwage_cps8, :hrsatrate_cps8, :diffany, :diffcare, :diffeye, :diffhear, :diffmob, :diffphys, :diffrem, :actline, :activity, :duration, :metvalue),Tuple{Array{Int64,1},Array{Int64,1},Array{Int64,1},DataValueArray{Union{},1},DataValueArray{Union{},1},DataValueArray{Union{},1},DataValueArray{Union{},1},DataValueArray{Union{},1},DataValueArray{Union{},1},DataValueArray{Union{},1},Array{Int64,1},Array{Int64,1},Array{Int64,1},Array{Float64,1},Array{Int64,1},Array{Int64,1},Array{Int64,1},Array{Int64,1},DataValueArray{Any,1},DataValueArray{Any,1},DataValueArray{Any,1},DataValueArray{Float64,1},Array{Int64,1},Array{Int64,1},Array{Int64,1},Array{Int64,1},Array{Int64,1},Array{Int64,1},Array{Int64,1},Array{Int64,1},Array{Int64,1},Array{Int64,1},Array{Float64,1},Array{Float64,1},Array{Int64,1},Array{Float64,1},Array{Float64,1},Array{Int64,1},DataValueArray{Any,1},DataValueArray{Any,1},DataValueArray{Any,1},DataValueArray{Any,1},DataValueArray{Any,1},DataValueArray{Any,1},DataValueArray{Any,1},DataValueArray{Union{},1},DataValueArray{Union{},1},DataValueArray{Union{},1},DataValueArray{Union{},1}}}}}, ::String) at C:\Users\PA.4471\.julia\packages\JuliaDB\ZXPIx\src\io.jl:215
 [31] top-level scope at none:0

pmarg avatar Mar 05 '19 13:03 pmarg