public class Writer extends Object
| Modifier and Type | Field and Description |
|---|---|
protected ClickHouseStatementImpl |
statement |
| Modifier and Type | Method and Description |
|---|---|
T |
addDbParam(ClickHouseQueryParam param,
String value) |
Writer |
data(File input)
Shortcut method for specifying a file as an input
|
Writer |
data(File input,
ClickHouseFormat format) |
Writer |
data(InputStream stream)
Specifies data input stream
|
Writer |
data(InputStream stream,
ClickHouseFormat format) |
Writer |
format(ClickHouseFormat format)
Specifies format for further insert of data via send()
|
T |
option(String key,
String value) |
T |
options(Map<String,String> params) |
void |
send()
Method to call, when Writer is fully configured
|
void |
send(String sql,
ClickHouseStreamCallback callback,
ClickHouseFormat format)
Sends the data in RowBinary or in Native formats
|
void |
send(String sql,
InputStream data,
ClickHouseFormat format)
Allows to send stream of data to ClickHouse
|
void |
sendToTable(String table,
InputStream data,
ClickHouseFormat format)
Convenient method for importing the data into table
|
Writer |
sql(String sql)
Set SQL for data insertion
|
Writer |
table(String table)
Set table name for data insertion
|
T |
withDbParams(Map<ClickHouseQueryParam,String> dbParams) |
protected final ClickHouseStatementImpl statement
public Writer format(ClickHouseFormat format)
public Writer table(String table)
table - table namepublic Writer sql(String sql)
sql - in a form "INSERT INTO table_name [(X,Y,Z)] VALUES "public Writer data(InputStream stream)
public Writer data(InputStream stream, ClickHouseFormat format)
public Writer data(File input, ClickHouseFormat format)
public void send()
throws SQLException
SQLExceptionpublic void send(String sql, InputStream data, ClickHouseFormat format) throws SQLException
sql - in a form of "INSERT INTO table_name (X,Y,Z) VALUES "data - where to read data fromformat - format of data in InputStreamSQLExceptionpublic void sendToTable(String table, InputStream data, ClickHouseFormat format) throws SQLException
table - table namedata - source dataformat - format of data in InputStreamSQLExceptionpublic void send(String sql, ClickHouseStreamCallback callback, ClickHouseFormat format) throws SQLException
SQLExceptionpublic T addDbParam(ClickHouseQueryParam param, String value)
public T withDbParams(Map<ClickHouseQueryParam,String> dbParams)
Copyright © 2020. All rights reserved.