-
Notifications
You must be signed in to change notification settings - Fork 546
New issue
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
Does client-v2 query API support bulk insert for prepared statement? #2050
Comments
I find another way to do so: INSERT INTO mytable (c1, c2, c3)
SELECT *
FROM arrayJoin({myList:Array(Map(String, String))}) Is there any better way ? Because this syntax ( |
Good day, @abcfy2! JDBC supports such inserts because it doesn't have a good way to send big data. As for JDBC - if there is no special requirement, I would recommend using java client for better performance and feature support. |
Thanks @chernser . Can't wait for this feature. How everything goes well. But currently is there any way for me to insert bulk insert ? I try to build a List<String> csvRows = new ArrayList<>();
csvRows.add("1,2,3");
csvRows.add("4,5,6");
InsertSettings settings = new InsertSettings();
settings.setOption(ClickHouseClientOption.FORMAT.getKey(), ClickHouseFormat.CSV.name());
client.insert("mytable", csvRows, settings); java.lang.NullPointerException: Cannot invoke "java.lang.Boolean.booleanValue()" because the return value of "java.util.Map.get(java.lang.Object)" is null
at com.clickhouse.client.api.Client.insert(Client.java:1227) Maybe I have to build a But I can't use Thanks. |
Describe your feedback
For example:
I want to insert multiple rows.
Does this API support bulk insert ? How to?
I don't want to manually splice prepared statements, that's too much trouble. (Like
VALUES ({v1:String}, {v2:String}, {v3:String}), ({v1_2:String}, {v2_2:String}, {v3_2:String}),...,()
)I know JDBC driver often has a
executeBatch()
function to do so.But how to do this in client-v2?
Thanks.
The text was updated successfully, but these errors were encountered: