-
Notifications
You must be signed in to change notification settings - Fork 608
Closed
Labels
Milestone
Description
How to import CSV files into a table?
v0.3.2-patch10,use “ com.clickhouse.jdbc.ClickHouseStatement” Is this correct?
clickHouseStatement.write() // Write API entrypoint
.table(endPiont).format(ClickHouseFormat.CSV)// where to write data
.data(file.getAbsolutePath(), ClickHouseCompression.ZIP)/// specify input
.send();
ru.yandex.clickhouse.* will Deprecated
Before 0.3.2...
import ru.yandex.clickhouse.ClickHouseStatement;
ClickHouseStatement sth = connection.createStatement();
sth
.write() // Write API entrypoint
.table("default.my_table") // where to write data
.option("format_csv_delimiter", ";") // specific param
.data(new File("/path/to/file.csv.gz"), ClickHouseFormat.CSV, ClickHouseCompression.gzip) // specify input
.send();