Replies: 1 comment
-
For inserting more than trivial amounts of data, you want to use the Appender (java usage at the bottom of https://duckdb.org/docs/data/overview) or import directly from Parquet or CSV. I typically just insert Parquet and it is very fast and easy. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello
I wrote 50 million pieces of data with duckdb. Write speed is very slow.
In addition, JDBC transaction commit is not supported in duckdb.
Is there a good writing method for transaction submission?
The code is as follows:
#3489
public static void insertToFile() {
Connection conn = null;
Statement statement = null;
ResultSet resultSet = null;
In addition, the errors reported during commit are as follows:
DuckDBAppender appender = conn2.createAppender("main", "data2");
conn2.setAutoCommit(false);
The background error log is as follows:
java.sql.SQLException: TransactionContext Error: cannot commit - no transaction is active
at org.duckdb.DuckDBNative.duckdb_jdbc_execute(Native Method)
at org.duckdb.DuckDBPreparedStatement.execute(DuckDBPreparedStatement.java:89)
at org.duckdb.DuckDBPreparedStatement.execute(DuckDBPreparedStatement.java:122)
at org.duckdb.DuckDBConnection.commit(DuckDBConnection.java:80)
Beta Was this translation helpful? Give feedback.
All reactions