java - VerticaCopyStream is very slow -
i use vertica flex table load json vertica without defining tables, , got problems loading time.
i connect vertica jdbc drive , use code..
string copyquery = "copy schema.tablename stdin parser fjsonparser()"; verticacopystream vstream = new verticacopystream((verticaconnection)conn, copyquery); inputstream input; vstream.start(); for(jsonnode json : jsonlist){ input = new bytearrayinputstream(json.tostring().getbytes()); vstream.addstream(input); input.close(); } vstream.execute(); vstream.finish();
the command "vstream.execute()" takes 12 seconds 5000 jsons when use copy command file runs less second.
your problem not verticacopystream , problem regard different parsers used , need compare apple apple , json parser should more slower simple csv parser .
Comments
Post a Comment