You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### insert(String tableName, DataStreamWriter writer, ClickHouseFormat format, InsertSettings settings)
386
+
**Beta**
387
+
388
+
This API method allows to pass a writer object that will encode data directly into an output stream. Data will be compressed by the client.
389
+
There is a configuration option in `InsertSettings` called `appCompressedData` that allows to turn off client compression and let application to send compressed stream.
390
+
Examples shows major usecases this API was designed for.
391
+
392
+
`com.clickhouse.client.api.DataStreamWriter` is a functional interface with a method `onOutput` that is called by the client when output stream is ready for data to be written. This interface has
393
+
another method `onRetry` with default implementation. This method is called when retry logic is triggered and mainly used to reset data source if applicable.
394
+
395
+
396
+
**Signatures**
397
+
```java
398
+
CompletableFuture<InsertResponse> insert(String tableName, // name of destination table
399
+
DataStreamWriter writer, // data writer instance
400
+
ClickHouseFormat format, // data format in which the writer encodes data
401
+
InsertSettings settings) // operation settings
402
+
```
403
+
404
+
**Parameters**
405
+
406
+
`tableName` - name of the target table.
407
+
408
+
`writer` - data writer instance.
409
+
410
+
`format` - data format in which the writer encodes data.
411
+
412
+
`settings` - request settings.
413
+
414
+
**Return value**
415
+
416
+
Future of `InsertResponse` type - the result of the operation and additional information like server side metrics.
417
+
418
+
**Examples**
419
+
420
+
Writing a collection of JSON objects encoded as string values using `JSONEachRow` format:
0 commit comments