Skip to content
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

How do I pass values to myInputStream when inserting data with Java Client #317

Closed
lichao12 opened this issue Feb 5, 2024 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@lichao12
Copy link

lichao12 commented Feb 5, 2024

try (ClickHouseClient client = ClickHouseClient.newInstance(ClickHouseProtocol.HTTP);
ClickHouseResponse response = client.read(servers).write()
.format(ClickHouseFormat.RowBinaryWithNamesAndTypes)
.query("insert into my_table select c2, c3 from input('c1 UInt8, c2 String, c3 Int32')")
.data(myInputStream) // load data into a table and wait untilit's completed
.executeAndWait()) {
ClickHouseResponseSummary summary = response.getSummary();
summary.getWrittenRows();
}

What is myInputStream, and how do I serialize or pass values?

@lichao12 lichao12 added the bug Something isn't working label Feb 5, 2024
@Paultagoras
Copy link
Contributor

Hi @lichao12 ! I think you're looking for https://github.com/ClickHouse/clickhouse-java which is a different repository that this connector makes use of.

It has a lot of examples along the lines of what you're looking for like this and this, so while I'm going to close this (because it's unrelated to this repository) I would encourage you to check that other repository and the examples out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants