I am importing data from database, getting DataFrame.
I am supposed to import only numeric columns, either Integer or floating point.
If the column is nullable, type is a Union of Missing & type, e.g. Union{Missing, Float64}.
Here is the code I am using currently:
function columnTypeCompare(coltype, aType)::Bool
return (coltype === aType) || (coltype === Union{Missing, aType})
end
function isAcceptableDataType(coltype)::Bool
for oneDataType in [Int8,Int16,Int32,Int64,Int128,UInt8,UInt16,UInt32,UInt64,UInt128,Float16,Float32,Float64]
if columnTypeCompare(coltype, oneDataType)
return true
end
end
return false
end
But I suspect there has to be easier way to determine this, using maybe Core.Number or something like that. Any suggestion(s)?
Thank you.