Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add to ClickHouseIO dedicated useragnet #32253

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading