This is an automated email from the ASF dual-hosted git repository.

yhu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 714f08b34ae Add to ClickHouseIO dedicated useragnet (#32253)
714f08b34ae is described below

commit 714f08b34ae96cfc0a9371b093211e67c1b038be
Author: Mark Zitnik <[email protected]>
AuthorDate: Tue Aug 20 19:09:17 2024 +0300

    Add to ClickHouseIO dedicated useragnet (#32253)
---
 CHANGES.md                                                           | 1 +
 .../main/java/org/apache/beam/sdk/io/clickhouse/ClickHouseIO.java    | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/CHANGES.md b/CHANGES.md
index 78f243a2055..e1cb4be078e 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -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
 
diff --git 
a/sdks/java/io/clickhouse/src/main/java/org/apache/beam/sdk/io/clickhouse/ClickHouseIO.java
 
b/sdks/java/io/clickhouse/src/main/java/org/apache/beam/sdk/io/clickhouse/ClickHouseIO.java
index 688b08146f3..52dca7cfa64 100644
--- 
a/sdks/java/io/clickhouse/src/main/java/org/apache/beam/sdk/io/clickhouse/ClickHouseIO.java
+++ 
b/sdks/java/io/clickhouse/src/main/java/org/apache/beam/sdk/io/clickhouse/ClickHouseIO.java
@@ -46,6 +46,7 @@ import org.apache.beam.sdk.transforms.ParDo;
 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;
@@ -178,12 +179,16 @@ public class ClickHouseIO {
         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>()

Reply via email to