We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apache Commons CSV --> 01:27
2023-02-16T02:34:38.933511 ProxiedStatement: getConnection 2023-02-16T02:34:39.141314 m=streamSelect, sql=SELECT * FROM TMP, autoCommit=true 2023-02-16T02:34:39.160498 m=streamSelect, status=executed, sql=SELECT * FROM TMP 2023-02-16T02:34:39.586226 status=printingRecords 2023-02-16T02:36:06.345703 status=csvWritten 2023-02-16T02:36:14.271099 status=linesCount, lines=7000000 2023-02-16T02:36:14.271566 m=getWarnings
private int extractQueryToCsv() throws SQLException { try { CsvTableDaos.streamSelect(this.connection, this.csvStm.getExtractSql(), (rs) -> { try (final CSVPrinter printer = this.createCsvPrinter()) { Log.log("status=printingRecords"); printer.printRecords(rs, true); } }); } catch (Exception e) { throw new SQLException(e); } Log.log("status=csvWritten"); try { final int lines = Files.countLines(this.csvStm.getFile()) - HEADER_COUNT; Log.log("status=linesCount, lines={}", lines); return lines; } catch (IOException e) { throw new SQLException(e); } }
Vanilla BufferedWritter --> 01:08
2023-02-16T02:41:39.530363 ProxiedStatement: getConnection 2023-02-16T02:41:40.230132 m=streamSelect, sql=SELECT * FROM TMP, autoCommit=true 2023-02-16T02:41:40.251840 m=streamSelect, status=executed, sql=SELECT * FROM TMP 2023-02-16T02:42:48.085736 m=getWarnings 2023-02-16T02:42:48.086107 m=clearWarnings 2023-02-16T02:42:48.086320 ProxiedStatement: getWarnings 2023-02-16T02:42:48.086503 ProxiedStatement: clearWarnings 2023-02-16T02:42:48.086680 m=getMetaData 2023-02-16T02:42:48.086866 ProxiedStatement: getUpdateCount 20
private int extractQueryToCsv0() throws SQLException { try { final BufferedWriter out = java.nio.file.Files.newBufferedWriter(this.csvStm.getFile()); CsvTableDaos.streamSelect(this.connection, this.csvStm.getExtractSql(), (rs) -> { // try (final CSVPrinter printer = this.createCsvPrinter()) { final int columns = rs .getMetaData() .getColumnCount(); while (rs.next()){ for (int i = 1; i <= columns; i++) { out.write(rs.getString(i)); out.write(", "); } out.write('\n'); } // printer.printRecords(rs, true); // } }); } catch (Exception e) { throw new SQLException(e); } try { return Files.countLines(this.csvStm.getFile()) - HEADER_COUNT; } catch (IOException e) { throw new SQLException(e); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Apache Commons CSV --> 01:27
Vanilla BufferedWritter --> 01:08
The text was updated successfully, but these errors were encountered: