geniouses. I am a newbie in Julia, but have an ambitious. I am trying to a following stream so far, of course it's an automatic process.
- read data from csv file to DataFrames
- Checking the data then cerate DB tables due to DataFrames data type
- Insert data from DataFrames to the created table ( eg. SQLite )
I am sticking at No.2 now, because, for example the column's data type 'Vector{String15}'. I am struggling how can I reflect the datatype to the query of creating table. I mean I could not find any solutions below (a) (b).
fname = string( @__DIR__,"/","testdata/test.csv")
df = CSV.read( fname, DataFrame )
last = ncol(df)
for i = 1:last
col[i] = typeof(df[!,i]) # ex. Vector{String15}
if String == col[i] # (a) does not work
# create table sql
# expect
query = 'create table testtable( col1 varchar(15),....'
elseif Int == col[i] # (b) does not work
# create table sql
# expect
query = 'create table testtable( col1 int,....'
end
・
・
end
I am wonderring,
- I really have to get the type of table column from 'Vector{String15}' anyhow?
- Does DataFrames has an utility method to do it?
- Should combine with other module to do it?
I am expecting smart tips by you, thanks any advances.