java - Importing dates from CSV with jOOQ -
i have csv file i'm trying import via jooq's loadcsv
method. i'd import straight mysql database date
column, csv file has dates formatted yyyymmdd
instead of yyyy-mm-dd
. there way can pass custom date format (or date parser) jooq import process?
thanks!
as of jooq 3.3, there no support such data type transformations in loader api. have registered issue #3221 add support useful feature. suspect should feasible (java 8 syntax):
ctx.loadinto(author) .loadcsv(csv) .fields(author.id, author.first_name, author.last_name) .values( row -> author.id.getdatatype().convert(row[0]), row -> row[1].split(" ")[0], row -> row[1].split(" ")[1] ) .execute();
contributions welcome, of course ;-)
Comments
Post a Comment