go-clickhouse icon indicating copy to clipboard operation
go-clickhouse copied to clipboard

Does this support send stream?

Open mdianjun opened this issue 2 years ago • 1 comments

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

mdianjun avatar Nov 09 '21 02:11 mdianjun

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

DoubleDi avatar Nov 09 '21 14:11 DoubleDi