I'm using VerticaCopyStream to read from an InputStream in Java, through a UDL parser and into a vertica table.
The statement that I'm passing to Vertica is generated with this code:
String.format("COPY %s FROM STDIN WITH PARSER %s", verticaTableName, verticaParserWithArgs);I then use VerticaCopyStream with this code:
String copyStatement = String.format("COPY %s FROM STDIN WITH PARSER %s", verticaTableName, verticaParserWithArgs);
InputStream countingInputStream =
new CountingInputStream(myInputStream);
copyStream = new VerticaCopyStream(verticaConnection, copyStatement);
copyStream.start();
copyStream.addStream(countingInputStream);
copyStream.execute();
copyStream.finish();The COPY statements don't throw errors. But no rows are inserted either.
Looking into the logs, I see that the statement that VerticaCopyStream is actually executing is this:
COPY mytable FROM local STDIN WITH PARSER MyParser() returnrejected
From what I understand, "local" is only relevant when reading from a file on the file system. But, again, I'm not super familiar with the ins and outs of VerticaCopyStream.
And again, as you can see from the code above, I'm reading from a java buffer/stream, NOT a file.
Is anything obviously wrong with what I'm doing? Is VerticaCopyStream able to handle passing input streams to UDL parsers?
Thanks