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

Does this support send stream? #143

Open
mdianjun opened this issue Nov 9, 2021 · 1 comment
Open

Does this support send stream? #143

mdianjun opened this issue Nov 9, 2021 · 1 comment

Comments

@mdianjun
Copy link

mdianjun commented Nov 9, 2021

If send a local file, like clickhouse-jdbc, usage is:

val statement = conn.createStatement
          .write()
          .data(createHadoopInputStream(filePath), inputFileFormat)
statement.sql(insertSql).send()

It invoke sendStream(), the code is here: https://github.com/ClickHouse/clickhouse-jdbc/blob/9b72c8afc3ead981bb62b998ff64280095ceb317/clickhouse-jdbc/src/main/java/ru/yandex/clickhouse/ClickHouseStatementImpl.java#L1040

@DoubleDi
Copy link
Collaborator

DoubleDi commented Nov 9, 2021

This driver uses the http clickhouse api.
To insert batches you can use Begin -> Prepare -> Exec -> Commit syntax. And you can read the file line by line.
Please check the readme for examples

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants