Skip to content

Commit

Permalink
Add to ClickHouseIO dedicated useragnet (#32253)
Browse files Browse the repository at this point in the history
  • Loading branch information
mzitnik authored Aug 20, 2024
1 parent ff64566 commit 714f08b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
* Improvements to the performance of BigqueryIO when using withPropagateSuccessfulStorageApiWrites(true) method (Java) ([#31840](https://github.com/apache/beam/pull/31840)).
* [Managed Iceberg] Added support for writing to partitioned tables ([#32102](https://github.com/apache/beam/pull/32102))
* Update ClickHouseIO to use the latest version of the ClickHouse JDBC driver ([#32228](https://github.com/apache/beam/issues/32228)).
* Add ClickHouseIO dedicated User-Agent ([#32252](https://github.com/apache/beam/issues/32252)).

## New Features / Improvements

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import org.apache.beam.sdk.util.BackOff;
import org.apache.beam.sdk.util.BackOffUtils;
import org.apache.beam.sdk.util.FluentBackoff;
import org.apache.beam.sdk.util.ReleaseInfo;
import org.apache.beam.sdk.util.Sleeper;
import org.apache.beam.sdk.values.PCollection;
import org.apache.beam.sdk.values.PDone;
Expand Down Expand Up @@ -178,12 +179,16 @@ public PDone expand(PCollection<T> input) {
tableSchema = getTableSchema(jdbcUrl(), table());
}

String sdkVersion = ReleaseInfo.getReleaseInfo().getSdkVersion();
String userAgent = String.format("Apache Beam/%s", sdkVersion);

Properties properties = properties();

set(properties, "max_insert_block_size", maxInsertBlockSize());
set(properties, "insert_quorum", insertQuorum());
set(properties, "insert_distributed_sync", insertDistributedSync());
set(properties, "insert_deduplication", insertDeduplicate());
set(properties, "product_name", userAgent);

WriteFn<T> fn =
new AutoValue_ClickHouseIO_WriteFn.Builder<T>()
Expand Down

0 comments on commit 714f08b

Please sign in to comment.