Skip to content

[client-v2] Send the User-Agent in the standard client format and add client metadata - #3213

Merged
chernser merged 9 commits into
mainfrom
polyglot/client-v2-user-agent-standard-format
Oct 20, 2026
Merged

chernser merged 9 commits into
mainfrom
polyglot/client-v2-user-agent-standard-format

Conversation

@polyglotAI-bot

@polyglotAI-bot polyglotAI-bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Implements #3202. client-v2 now sends the User-Agent header in the standard ClickHouse client format, which clickhouse-go, clickhouse-js, clickhouse-connect and clickhouse-rs already use:

<application> clickhouse-java-v2/<version> (<key>:<value>; ...; lv:java/<java.version>; os:<os.name>; hc:ahc_<Apache HttpClient version>)
  • jvm:<version> is now lv:java/<version>. The OS is now the os: entry.
  • The trailing Apache-HttpClient/<version> token is now the hc:ahc_<version> entry: hc is the HTTP client, ahc_ is Apache HttpClient (maintainer review). The version comes from the generated class Versions, so it is correct also in the shaded jar.
  • New Client.Builder#setClientName(String, Map<String, String>) sets the client name and adds key/value pairs to the comment group. The client adds lv, os and hc only for keys that the metadata does not set.
  • All client identification logic is in the new internal class WorkloadIdentitySupport. It builds the complete User-Agent value, so a transport only sets the header.

Example from the issue:

Flink-ClickHouse-Sink/0.2.0 clickhouse-java-v2/0.12.0 (fv:flink/2.0.0; api:table; lv:java/17.0.19; os:Mac OS X)

Closes #3202

Design

  • WorkloadIdentitySupport (client-v2/.../api/internal) owns the client identification. getUserAgent(customUserAgent, requestConfig) returns the complete User-Agent value: the application part (a custom User-Agent header if one is set, else the client name; trimmed; blank counts as not set), then clickhouse-java-v2/<version> (<metadata>; lv:...; os:...; hc:ahc_...). It also validates metadata entries. HttpAPIClientHelper only reads the custom header and sets the returned value, so a new transport gets the same identification from the same class.

  • Config property client_id_metadata (ClientConfigProperties.CLIENT_ID_METADATA, Map.class, appended at the end of the enum). It follows the existing type_hint_mapping pattern: string form key1=value1,key2=value2, parsed by toKeyValuePairs into an ordered map. Because it is a property, JDBC gets it through connection properties and URL parameters without jdbc-v2 code changes.

  • Builder method setClientName(String, Map) (an overload of setClientName) writes the client name and that string form. setClientName(String) does not change the metadata (jdbc-v2 calls it after it applies the connection properties). Escaping is handled by the new package-private ClientConfigProperties.fromKeyValuePairs (inverse of toKeyValuePairs). Entries keep the iteration order of the map. null or an empty map removes the setting.

  • Caching. The metadata is validated when the client is built. One method, composeClientPart, composes the complete client part (clickhouse-java-v2/<version> (<metadata>; lv:java/...; os:...; hc:ahc_...)) one time per client, with one code path and no static part constants. The metadata entries come first; lv, os and hc are added only if the metadata does not set them (keys compared ignoring case, with ClientUtils#putIfAbsentIgnoreCase). CLIENT_ID_METADATA has no default value; it is read only if set. Client creates one WorkloadIdentitySupport, keeps it in a final field, and gives it to the HttpAPIClientHelper constructor. The helper only sets the header from it for each request. The constructor composes the value for the client configuration (application part = the client-level User-Agent header if set, else the client name) and keeps it. Client#updateClientName calls WorkloadIdentitySupport#updateClientName on its instance directly, which composes the value again and keeps it (synchronized; the kept strings are volatile). A request with another application part (a client_name / User-Agent set for one operation) gets a new string that reuses the client part, and the kept value does not change. A blank value set for one operation counts as not set and gets the kept value. ClientConfigProperties holds only the raw inputs, with no default or composed value.

  • Long value warning. The client logs a warning (no exception) when the kept User-Agent value is longer than 200 characters, when the client is created and when the client name changes. A value composed for one request is not logged (docs/changes_checklist.md: no logs in the request path).

  • Validation is called from CLIENT_ID_METADATA.parseValue (rules in WorkloadIdentitySupport.checkClientMetadataEntry), so it covers the builder, setOption and JDBC. It is the same pattern as ssl_cipher_suites. build() throws ClientMisconfigurationException if:

    • a key or value is not printable ASCII;
    • a key contains a space or any of :;(),=;
    • a value contains any of ;().

    These rules keep the comment group parseable. Keys and values are trimmed, and entries with a null or empty key or value are ignored.

  • Client-level only. The metadata is put into the client part when the client is created. It is kept when Client#updateClientName / JDBC setClientInfo(ApplicationName) changes the application part, and when a custom User-Agent header is set. It is not read from operation settings. This is documented, and a test covers it.

  • The application part is unchanged: a custom User-Agent header, else the client name. The docs and the httpHeader Javadoc state that applications must set the client name, not the User-Agent header.

Compatibility

This intentionally changes the HTTP User-Agent output (a high-risk surface per docs/ai-review.md). The change is requested in #3202.

  • Queries that parse system.query_log.http_user_agent for jvm: or Apache-HttpClient/ must use the new format.
  • The change applies to jdbc-v2 too, because jdbc-v2 sends its requests through client-v2.
  • The changelog entry is marked "Breaking change" so it can be collated under that heading.
  • No public API signature changes (the internal package is not public API). Added: one enum constant (at the end), one builder overload setClientName(String, Map), the internal class WorkloadIdentitySupport, the internal method ClientUtils#putIfAbsentIgnoreCase, and the generated internal class Versions. The internal HttpAPIClientHelper constructor gets a WorkloadIdentitySupport parameter.
  • Build: client-v2 uses templating-maven-plugin (version managed in the root pom) to generate Versions from src/main/java-templates.
  • Removed: the internal apache.http.client.version key from client-v2-version.properties. Versions.APACHE_HTTP_CLIENT replaces it. ahc_<version> is the version that the client is built with; before, the non-shaded jar reported the runtime package version.
  • Client.clientVersion is now Versions.CLIENT (${revision}, the same value as the version key of client-v2-version.properties). Nothing reads client-v2-version.properties any more, so the file and the client-v2 resource filtering block are removed. Client.clientVersion is set with String.valueOf, so it is not a compile-time constant: code compiled against it reads the version of the client that it runs with, as before.

Not changed: jdbc-v2 still adds detected frameworks as its own group after jdbc-v2/<version> (e.g. ((apache.spark)), with double parentheses). That is a separate issue. Moving frameworks into client_id_metadata would change jdbc-v2 output and needs a key name, so it is left for a follow-up.

Changes

  • WorkloadIdentitySupport (new, internal): builds the User-Agent value in the standard format plus metadata, and validates metadata entries.
  • ClientConfigProperties: CLIENT_ID_METADATA; fromKeyValuePairs helper.
  • Client: creates the WorkloadIdentitySupport and updates it in updateClientName; clientVersion comes from Versions.CLIENT.
  • Client.Builder#setClientName(String, Map); setClientName(String) and httpHeader Javadoc state to use the client name, not the User-Agent header. Same note on CommonSettings#httpHeader.
  • HttpAPIClientHelper: gets the client's WorkloadIdentitySupport in its constructor and sets the User-Agent value that it returns. Removed the Apache HttpClient version lookup.
  • Versions (generated, internal) + templating-maven-plugin in client-v2/pom.xml (version in the root pom): the client version and the Apache HttpClient version.
  • ClientUtils#putIfAbsentIgnoreCase (new, internal).
  • Docs: docs/features.md (client-v2 entry, jdbc-v2 client-info bullet), docs/clickhouse-docs/client.mdx (builder table, Client Identification), docs/clickhouse-docs/jdbc.mdx, docs/integration-client.md, docs/integration-jdbc.md.
  • history/latest/3202.md.

Test

  • UserAgentUnitTest (new, WireMock): asserts the exact header on the wire through Client#query. Rows: no name; the issue example; setOption string form; escaped ,/=/\ in a value; entries with an empty or null key or value ignored; empty and blank client name with metadata; setOption metadata kept by setClientName(String) and replaced by setClientName(String, Map); setClientName(String) keeps metadata; metadata cleared with null and with an empty map; custom User-Agent header plus metadata. Also: metadata that replaces os. A second test covers updateClientName, an operation-level User-Agent header, and operation-level client_id_metadata (ignored). A third test checks that a blank operation-level client name gets the client value. A fourth test checks that invalid metadata is rejected at build().
  • WorkloadIdentitySupportTest (new, data providers): one row for each request case (client name, metadata, custom User-Agent, operation-level client name, blank values, trimming) — a value equal to the client value must be the kept instance (assertSame); one row for each updateClientName case; metadata replaces lv / os / hc (also upper-case keys); two instances do not share the client part; VersionsTest checks that Versions.CLIENT is a resolved version and that Versions.APACHE_HTTP_CLIENT equals the version that httpclient5 reports (VersionInfo).
  • ClientUtilsTest#testPutIfAbsentIgnoreCase (new): a new key is added (also to an empty map); the same key, in the same or in a different case, and also when it is not the first key, does not change the map; a null key is rejected.
  • HttpAPIClientHelperTest: through a real Client, updateClientName composes the value again and keeps it (assertSame), and a value longer than 200 characters is logged at client creation and on updateClientName, not per request.
  • ClientConfigPropertiesTest: valid parse rows (order, trim, empty entries, : and = in values). Invalid rows: each forbidden character, control and non-ASCII characters, stray , / tokens without =. os and lv keys are valid. Also a null row and a round trip of fromKeyValuePairs.
  • HttpTransportTests#testUserAgentHasCompleteProductName: the data-provider patterns asserted the old format, so they now assert the new format with lv:, os: and hc:ahc_. This is the only existing test whose expectations changed.
  • ConnectionTest#testClientMetadataInUserAgent (new, jdbc-v2 integration): client_id_metadata as a connection property and as a URL parameter, checked in system.query_log, also after setClientInfo(ApplicationName). executeQueryAndVerifyUserAgent now also returns the user agent. Its assertions did not change.
  • Mutation check: putting metadata after os: makes 5 UserAgentUnitTest rows fail.

Run locally (ClickHouse 26.9, head a545bcfd9): client-v2 unit 783/783; jdbc-v2 unit 1963/1963; client-v2 HttpTransportTests User-Agent/client-name integration tests 11/11; jdbc-v2 ConnectionTest User-Agent/client info tests 3/3; javadoc clean; packages/clickhouse-jdbc-all builds, and its shaded Versions keeps both values.

docs/changes_checklist.md

  • Enum constant added: appended at the end. The key client_id_metadata is unique and has no default. Its value type Map matches parseValue.
  • New configuration property added: invalid values fail predictably (ClientMisconfigurationException). It does not overlap an existing property. docs/features.md is updated.
  • New method added: setClientName(String, Map) is an overload of setClientName and follows the typeHintMapping builder pattern for the map. Nullability is documented. Behavior tests are added.
  • String / header output changed: intentional, covered end to end (WireMock header, system.query_log for client-v2 and jdbc-v2).
  • Logging: one warn when the kept User-Agent value is longer than 200 characters, only when the client is created and on updateClientName (not in the request path). The removed code had one warn / one debug for the HTTP client version lookup.
  • Method signature changed: only the constructor of the internal HttpAPIClientHelper (new WorkloadIdentitySupport parameter). All callers are in client-v2 and are updated.

Checklist

Pre-PR validation gate

  • Works through the real entry point (query path on the wire, and system.query_log)
  • Public API follows existing builder/config patterns
  • Entry points covered: Builder, setOption, JDBC property and URL, runtime client-name changes, custom header at client and operation level
  • Tests pin intended behavior; no existing test weakened
  • Public surface, docs and changelog updated
  • Checked against AGENTS.md, docs/ai-review.md, docs/changes_checklist.md

🤖 Generated with Claude Code


Note

Medium Risk
Intentional breaking change to every request’s User-Agent and query-log observability; mis-parsed metadata is rejected at build time but does not affect auth or data paths.

Overview
Breaking: HTTP User-Agent now follows the standard ClickHouse client shape (clickhouse-java-v2/<version> (lv:java/...; os:...; hc:ahc_...)), replacing jvm: and trailing Apache-HttpClient/.... Anything parsing system.query_log.http_user_agent for the old tokens must be updated.

Adds Client.Builder#setClientName(String, Map) and the client_id_metadata property so apps can attach validated key/value pairs to the comment group (with defaults for lv, os, and hc when not overridden). Identification is centralized in new internal WorkloadIdentitySupport, wired from Client through HttpAPIClientHelper; updateClientName recomposes and caches the header (with a warning above 200 characters).

Build-wise, templating-maven-plugin generates Versions from java-templates (client and Apache HttpClient versions for shaded jars); client-v2-version.properties and resource filtering are removed. Client.clientVersion reads Versions.CLIENT at runtime.

Docs, changelog (history/latest/3202.md), and jdbc-v2 inherit the new header via client-v2 (including client_id_metadata on connections).

Reviewed by Cursor Bugbot for commit 3d8771a. Bugbot is set up for automated code reviews on this repo. Configure here.

… client metadata

The User-Agent header is now
'<client name> clickhouse-java-v2/<version> (<key>:<value>; ...; lv:java/<java.version>; os:<os.name>)',
the format that clickhouse-go, clickhouse-js, clickhouse-connect and clickhouse-rs use.
'jvm:' becomes 'lv:java/', the OS becomes the 'os:' entry, and the trailing
'Apache-HttpClient/<version>' token is removed.

Client.Builder#setClientMetadata(Map) (property 'client_metadata',
'key1=value1,key2=value2') adds key/value pairs to the comment group, before
'lv' and 'os'. Entries that would break the format are rejected with
ClientMisconfigurationException when the client is built.

Implements: #3202

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Client V2 Coverage

Coverage Report

Package Coverage Lines Covered Total Lines
com.clickhouse.client.api 88.84% 1138 1281
com.clickhouse.client.api.command 43.33% 13 30
com.clickhouse.client.api.data_formats 67.77% 431 636
com.clickhouse.client.api.data_formats.internal 82.12% 2163 2634
com.clickhouse.client.api.enums 100.00% 14 14
com.clickhouse.client.api.http 0.00% 1
com.clickhouse.client.api.insert 93.20% 96 103
com.clickhouse.client.api.internal 87.39% 1449 1658
com.clickhouse.client.api.metadata 90.74% 49 54
com.clickhouse.client.api.metrics 94.12% 80 85
com.clickhouse.client.api.observability 96.04% 194 202
com.clickhouse.client.api.observability.micrometer 100.00% 57 57
com.clickhouse.client.api.observability.otel 98.65% 73 74
com.clickhouse.client.api.query 86.16% 137 159
com.clickhouse.client.api.serde 87.72% 50 57
com.clickhouse.client.api.sql 87.50% 28 32
com.clickhouse.client.api.transport 94.25% 82 87
Class Coverage
Class Coverage Lines Covered Total Lines
com.clickhouse.client.api.ClickHouseException 85.71% 12 14
com.clickhouse.client.api.Client 91.33% 474 519
com.clickhouse.client.api.Client.Builder 86.84% 231 266
com.clickhouse.client.api.Client.new DataStreamWriter() {...} 100.00% 8 8
com.clickhouse.client.api.ClientConfigProperties 97.36% 221 227
com.clickhouse.client.api.ClientConfigProperties.new ClientConfigProperties() {...} 100.00% 8 8
com.clickhouse.client.api.ClientException 66.67% 4 6
com.clickhouse.client.api.ClientFaultCause 100.00% 8 8
com.clickhouse.client.api.ClientMisconfigurationException 100.00% 4 4
com.clickhouse.client.api.command.CommandResponse 47.06% 8 17
com.clickhouse.client.api.command.CommandSettings 38.46% 5 13
com.clickhouse.client.api.CompressionMethod 100.00% 3 3
com.clickhouse.client.api.ConnectionInitiationException 50.00% 3 6
com.clickhouse.client.api.ConnectionReuseStrategy 100.00% 3 3
com.clickhouse.client.api.data_formats.GsonJsonParserFactory 100.00% 10 10
com.clickhouse.client.api.data_formats.GsonJsonParserFactory.JsonParserImpl 100.00% 11 11
com.clickhouse.client.api.data_formats.GsonJsonParserFactory.new TypeToken() {...} 100.00% 1 1
com.clickhouse.client.api.data_formats.internal.AbstractBinaryFormatReader 76.50% 319 417
com.clickhouse.client.api.data_formats.internal.AbstractBinaryFormatReader.RecordWrapper 50.00% 17 34
com.clickhouse.client.api.data_formats.internal.BinaryReaderBackedRecord 14.77% 13 88
com.clickhouse.client.api.data_formats.internal.BinaryStreamReader 94.25% 574 609
com.clickhouse.client.api.data_formats.internal.BinaryStreamReader.ArrayValue 83.72% 36 43
com.clickhouse.client.api.data_formats.internal.BinaryStreamReader.CachingByteBufferAllocator 100.00% 8 8
com.clickhouse.client.api.data_formats.internal.BinaryStreamReader.DefaultByteBufferAllocator 100.00% 2 2
com.clickhouse.client.api.data_formats.internal.BinaryStreamReader.EnumValue 80.00% 8 10
com.clickhouse.client.api.data_formats.internal.InetAddressConverter 66.67% 18 27
com.clickhouse.client.api.data_formats.internal.MapBackedRecord 59.40% 139 234
com.clickhouse.client.api.data_formats.internal.NumberConverter 92.47% 86 93
com.clickhouse.client.api.data_formats.internal.NumberConverter.NumberType 100.00% 7 7
com.clickhouse.client.api.data_formats.internal.ProcessParser 85.71% 36 42
com.clickhouse.client.api.data_formats.internal.SerializerUtils 89.21% 777 871
com.clickhouse.client.api.data_formats.internal.SerializerUtils.DynamicClassLoader 100.00% 3 3
com.clickhouse.client.api.data_formats.internal.StringValue 97.14% 34 35
com.clickhouse.client.api.data_formats.internal.ValueConverters 77.48% 86 111
com.clickhouse.client.api.data_formats.JacksonJsonParserFactory 100.00% 5 5
com.clickhouse.client.api.data_formats.JacksonJsonParserFactory.JsonParserImpl 100.00% 8 8
com.clickhouse.client.api.data_formats.JSONEachRowFormatReader 95.12% 195 205
com.clickhouse.client.api.data_formats.NativeFormatReader 91.49% 86 94
com.clickhouse.client.api.data_formats.NativeFormatReader.Block 66.67% 12 18
com.clickhouse.client.api.data_formats.RowBinaryFormatReader 15.79% 3 19
com.clickhouse.client.api.data_formats.RowBinaryFormatSerializer 28.83% 32 111
com.clickhouse.client.api.data_formats.RowBinaryFormatWriter 32.67% 33 101
com.clickhouse.client.api.data_formats.RowBinaryFormatWriter.InputStreamHolder 0.00% 4
com.clickhouse.client.api.data_formats.RowBinaryFormatWriter.ReaderHolder 0.00% 4
com.clickhouse.client.api.data_formats.RowBinaryWithNamesAndTypesFormatReader 100.00% 22 22
com.clickhouse.client.api.data_formats.RowBinaryWithNamesFormatReader 56.52% 13 23
com.clickhouse.client.api.DataStreamWriter 0.00% 1
com.clickhouse.client.api.DataTransferException 50.00% 2 4
com.clickhouse.client.api.DataTypeUtils 60.83% 73 120
com.clickhouse.client.api.enums.Protocol 100.00% 2 2
com.clickhouse.client.api.enums.ProxyType 100.00% 3 3
com.clickhouse.client.api.enums.SSLMode 100.00% 9 9
com.clickhouse.client.api.http.ClickHouseHttpProto 0.00% 1
com.clickhouse.client.api.insert.InsertResponse 100.00% 15 15
com.clickhouse.client.api.insert.InsertSettings 92.05% 81 88
com.clickhouse.client.api.internal.BaseCollectionConverter 100.00% 28 28
com.clickhouse.client.api.internal.BaseCollectionConverter.BaseArrayWriter 100.00% 6 6
com.clickhouse.client.api.internal.BaseCollectionConverter.BaseCollectionWriter 71.43% 15 21
com.clickhouse.client.api.internal.BaseCollectionConverter.BaseListWriter 100.00% 6 6
com.clickhouse.client.api.internal.BaseCollectionConverter.ListConversionState 100.00% 11 11
com.clickhouse.client.api.internal.BasicObjectsPool 0.00% 11
com.clickhouse.client.api.internal.CachingObjectsSupplier 0.00% 10
com.clickhouse.client.api.internal.ClientStatisticsHolder 50.00% 7 14
com.clickhouse.client.api.internal.ClientUtils 100.00% 15 15
com.clickhouse.client.api.internal.CommonSettings 97.22% 70 72
com.clickhouse.client.api.internal.CompressedBlockEntity 82.61% 38 46
com.clickhouse.client.api.internal.CompressedBlockInputStream 92.77% 77 83
com.clickhouse.client.api.internal.CompressedBlockOutputStream 91.80% 56 61
com.clickhouse.client.api.internal.CompressedBlockOutputStream.LZ4OutputStream 100.00% 6 6
com.clickhouse.client.api.internal.CompressedBlockOutputStream.ZSTDOutputStream 100.00% 6 6
com.clickhouse.client.api.internal.CompressedEntity 81.58% 31 38
com.clickhouse.client.api.internal.CredentialsManager 95.38% 62 65
com.clickhouse.client.api.internal.DataTypeConverter 92.16% 235 255
com.clickhouse.client.api.internal.DataTypeConverter.ArrayAsStringWriter 100.00% 18 18
com.clickhouse.client.api.internal.DataTypeConverter.ListAsStringWriter 100.00% 16 16
com.clickhouse.client.api.internal.DataTypeConverter.Literal 100.00% 3 3
com.clickhouse.client.api.internal.EnvUtils 0.00% 14
com.clickhouse.client.api.internal.Gauge 66.67% 4 6
com.clickhouse.client.api.internal.HttpAPIClientHelper 94.03% 488 519
com.clickhouse.client.api.internal.HttpAPIClientHelper.CustomSSLConnectionFactory 100.00% 11 11
com.clickhouse.client.api.internal.HttpAPIClientHelper.DummySSLConnectionSocketFactory 0.00% 3
com.clickhouse.client.api.internal.HttpAPIClientHelper.MeteredManagedHttpClientConnectionFactory 50.00% 7 14
com.clickhouse.client.api.internal.HttpAPIClientHelper.TransportRequestImpl 100.00% 12 12
com.clickhouse.client.api.internal.HttpAPIClientHelper.TransportResponseImpl 81.25% 13 16
com.clickhouse.client.api.internal.MapUtils 35.48% 22 62
com.clickhouse.client.api.internal.SchemaUtils 100.00% 24 24
com.clickhouse.client.api.internal.ServerSettings 0.00% 1
com.clickhouse.client.api.internal.SslContextProvider 92.68% 38 41
com.clickhouse.client.api.internal.SslContextProvider.Builder 100.00% 38 38
com.clickhouse.client.api.internal.SslContextProvider.NonValidatingTrustManager 75.00% 3 4
com.clickhouse.client.api.internal.StopWatch 66.67% 10 15
com.clickhouse.client.api.internal.TableSchemaParser 80.77% 21 26
com.clickhouse.client.api.internal.ValidationUtils 55.00% 11 20
com.clickhouse.client.api.internal.ValidationUtils.SettingsValidationException 100.00% 3 3
com.clickhouse.client.api.internal.WorkloadIdentitySupport 100.00% 38 38
com.clickhouse.client.api.metadata.DefaultColumnToMethodMatchingStrategy 100.00% 13 13
com.clickhouse.client.api.metadata.NoSuchColumnException 0.00% 2
com.clickhouse.client.api.metadata.TableSchema 92.31% 36 39
com.clickhouse.client.api.metrics.ClientMetrics 100.00% 7 7
com.clickhouse.client.api.metrics.MicrometerLoader 90.91% 40 44
com.clickhouse.client.api.metrics.OperationMetrics 94.74% 18 19
com.clickhouse.client.api.metrics.OperationType 100.00% 3 3
com.clickhouse.client.api.metrics.ServerMetrics 100.00% 12 12
com.clickhouse.client.api.observability.DefaultMetricsRecorder 100.00% 9 9
com.clickhouse.client.api.observability.DefaultSpanRecorder 100.00% 12 12
com.clickhouse.client.api.observability.DefaultSpanRecorder.NoopSpan 75.00% 3 4
com.clickhouse.client.api.observability.MetricAttribute 100.00% 11 11
com.clickhouse.client.api.observability.MetricName 100.00% 13 13
com.clickhouse.client.api.observability.MetricsSupport 92.31% 36 39
com.clickhouse.client.api.observability.micrometer.MicrometerMetricsRecorder 100.00% 57 57
com.clickhouse.client.api.observability.otel.OpenTelemetrySpanRecorder 100.00% 47 47
com.clickhouse.client.api.observability.otel.OpenTelemetrySpanRecorder.OpenTelemetrySpan 96.30% 26 27
com.clickhouse.client.api.observability.SpanAttribute 100.00% 25 25
com.clickhouse.client.api.observability.SpanSupport 95.51% 85 89
com.clickhouse.client.api.query.NullValueException 50.00% 2 4
com.clickhouse.client.api.query.QueryResponse 86.49% 32 37
com.clickhouse.client.api.query.QuerySettings 97.67% 84 86
com.clickhouse.client.api.query.QueryStatement 0.00% 4
com.clickhouse.client.api.query.Records 60.87% 14 23
com.clickhouse.client.api.query.Records.new Iterator() {...} 100.00% 5 5
com.clickhouse.client.api.serde.DataSerializationException 33.33% 2 6
com.clickhouse.client.api.serde.POJOSerDe 97.96% 48 49
com.clickhouse.client.api.serde.SerializerNotFoundException 0.00% 2
com.clickhouse.client.api.ServerException 100.00% 13 13
com.clickhouse.client.api.ServerException.ErrorCodes 100.00% 9 9
com.clickhouse.client.api.Session 100.00% 46 46
com.clickhouse.client.api.sql.SQLUtils 87.50% 28 32
com.clickhouse.client.api.transport.ClientNodeSelector 100.00% 21 21
com.clickhouse.client.api.transport.EndpointState 100.00% 10 10
com.clickhouse.client.api.transport.HttpEndpoint 90.00% 45 50
com.clickhouse.client.api.transport.HttpEndpoint.EndpointDetails 100.00% 6 6
com.clickhouse.client.api.TransportException 100.00% 3 3

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

JDBC V2 Coverage

Coverage Report

Package Coverage Lines Covered Total Lines
com.clickhouse.data 19.23% 5 26
com.clickhouse.jdbc 81.89% 1768 2159
com.clickhouse.jdbc.internal 89.91% 1345 1496
com.clickhouse.jdbc.internal.parser.antlr4 40.96% 6442 15727
com.clickhouse.jdbc.internal.parser.javacc 73.14% 4961 6783
com.clickhouse.jdbc.metadata 90.27% 835 925
com.clickhouse.jdbc.types 56.09% 290 517
Class Coverage
Class Coverage Lines Covered Total Lines
com.clickhouse.data.Tuple 19.23% 5 26
com.clickhouse.jdbc.ClientInfoProperties 100.00% 12 12
com.clickhouse.jdbc.ConnectionImpl 91.28% 272 298
com.clickhouse.jdbc.DataSourceImpl 96.15% 25 26
com.clickhouse.jdbc.Driver 78.26% 36 46
com.clickhouse.jdbc.Driver.FrameworksDetection 90.91% 10 11
com.clickhouse.jdbc.DriverProperties 93.94% 31 33
com.clickhouse.jdbc.internal.DetachedResultSet 80.68% 334 414
com.clickhouse.jdbc.internal.ExceptionUtils 72.00% 18 25
com.clickhouse.jdbc.internal.FeatureManager 100.00% 8 8
com.clickhouse.jdbc.internal.JdbcConfiguration 95.26% 201 211
com.clickhouse.jdbc.internal.JdbcUtils 90.40% 386 427
com.clickhouse.jdbc.internal.JdbcUtils.ArrayProcessingCursor 100.00% 11 11
com.clickhouse.jdbc.internal.ParsedPreparedStatement 96.23% 51 53
com.clickhouse.jdbc.internal.ParsedStatement 93.75% 15 16
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseLexer 77.78% 28 36
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser 45.81% 4853 10594
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AliasContext 66.67% 6 9
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterPrivilegeContext 0.00% 44
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterStmtContext 83.33% 5 6
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableClauseAddColumnContext 41.67% 5 12
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableClauseAddIndexContext 0.00% 12
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableClauseAddProjectionContext 0.00% 12
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableClauseAlterTypeContext 31.25% 5 16
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableClauseAttachContext 0.00% 9
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableClauseClearColumnContext 0.00% 12
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableClauseClearIndexContext 0.00% 12
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableClauseClearProjectionContext 0.00% 12
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableClauseCommentContext 0.00% 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableClauseContext 83.33% 5 6
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableClauseDeleteContext 62.50% 5 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableClauseDetachContext 0.00% 7
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableClauseDropColumnContext 0.00% 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableClauseDropIndexContext 0.00% 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableClauseDropPartitionContext 0.00% 7
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableClauseDropProjectionContext 0.00% 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableClauseFreezePartitionContext 0.00% 7
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableClauseMaterializeIndexContext 0.00% 12
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableClauseMaterializeProjectionContext 0.00% 12
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableClauseModifyCodecContext 0.00% 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableClauseModifyCommentContext 38.46% 5 13
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableClauseModifyContext 50.00% 5 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableClauseModifyOrderByContext 0.00% 9
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableClauseModifyRemoveContext 0.00% 12
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableClauseModifyTTLContext 0.00% 7
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableClauseMovePartitionContext 0.00% 13
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableClauseRemoveTTLContext 0.00% 7
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableClauseRenameContext 0.00% 12
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableClauseReplaceContext 0.00% 9
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableClauseUpdateContext 0.00% 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableColumnPositionContext 60.00% 6 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AlterTableStmtContext 38.46% 5 13
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ArrayJoinClauseContext 50.00% 6 12
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AssignmentExprContext 54.55% 6 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AssignmentExprListContext 54.55% 6 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AssignmentValueContext 83.33% 5 6
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AssignmentValuesContext 83.33% 5 6
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AssignmentValuesEmptyContext 0.00% 7
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AssignmentValuesListContext 54.55% 6 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.AttachStmtContext 33.33% 6 18
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.CheckAllTablesStmtContext 0.00% 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.CheckGrantStmtContext 45.45% 5 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.CheckStmtContext 83.33% 5 6
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.CheckTableStmtContext 35.71% 5 14
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ClusterClauseContext 54.55% 6 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.CodecArgExprContext 0.00% 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.CodecExprContext 0.00% 14
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnAliasesContext 0.00% 13
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnArgExprContext 66.67% 6 9
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnArgListContext 46.15% 6 13
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExceptExprContext 83.33% 5 6
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExceptExprIdentifiersContext 41.67% 5 12
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExceptExprRegexpContext 0.00% 9
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprAgrFuncWithFilterContext 38.46% 5 13
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprAliasContext 55.56% 5 9
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprAndContext 62.50% 5 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprArrayAccessContext 55.56% 5 9
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprArrayContext 62.50% 5 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprAsteriskContext 62.50% 5 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprBetweenContext 0.00% 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprCaseContext 35.71% 5 14
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprCast2Context 62.50% 5 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprCastContext 45.45% 5 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprContext 83.33% 5 6
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprDateContext 71.43% 5 7
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprExtractContext 0.00% 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprFunctionContext 38.46% 5 13
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprIdentifierContext 83.33% 5 6
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprIntervalContext 62.50% 5 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprIsNullContext 55.56% 5 9
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprListContext 54.55% 6 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprLiteralContext 83.33% 5 6
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprNegateContext 0.00% 7
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprNotContext 0.00% 7
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprOrContext 62.50% 5 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprParamContext 62.50% 5 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprParensContext 62.50% 5 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprPrecedence1Context 50.00% 5 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprPrecedence2Context 50.00% 5 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprPrecedence3Context 26.32% 5 19
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprRegexpContext 62.50% 5 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprSubqueryContext 62.50% 5 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprSubstringContext 0.00% 12
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprTernaryOpContext 55.56% 5 9
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprTimestampContext 71.43% 5 7
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprTrimContext 0.00% 14
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprTupleAccessContext 62.50% 5 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprTupleContext 62.50% 5 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprWinFunctionContext 0.00% 13
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnExprWinFunctionTargetContext 0.00% 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnIdentifierContext 60.00% 6 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnLambdaExprContext 40.00% 6 15
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnPrivilegeContext 42.86% 6 14
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnsClauseContext 53.85% 7 13
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnsExprAsteriskContext 55.56% 5 9
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnsExprColumnContext 83.33% 5 6
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnsExprContext 83.33% 5 6
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnsExprSubqueryContext 0.00% 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnTypeExprComplexContext 41.67% 5 12
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnTypeExprContext 83.33% 5 6
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnTypeExprEnumContext 0.00% 12
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnTypeExprNestedContext 0.00% 13
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnTypeExprParamContext 55.56% 5 9
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ColumnTypeExprSimpleContext 83.33% 5 6
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.CreateDatabaseStmtContext 38.46% 5 13
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.CreateDictionaryStmtContext 21.74% 5 23
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.CreateFunctionStmtContext 33.33% 5 15
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.CreateLiveViewStmtContext 0.00% 21
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.CreateMaterializedViewStmtContext 0.00% 20
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.CreateNamedCollectionStmtContext 27.78% 5 18
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.CreatePolicyStmtContext 17.24% 5 29
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.CreatePrivilegeContext 0.00% 24
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.CreateProfileStmtContext 14.71% 5 34
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.CreateQuotaStmtContext 18.52% 5 27
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.CreateRoleStmtContext 26.32% 5 19
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.CreateStmtContext 83.33% 5 6
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.CreateTableStmtContext 25.00% 5 20
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.CreateUserStmtContext 17.86% 5 28
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.CreateViewStmtContext 26.32% 5 19
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.CteClauseContext 40.00% 6 15
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.CteUnboundColContext 83.33% 5 6
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.CteUnboundColExprContext 50.00% 5 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.CteUnboundColLiteralContext 62.50% 5 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.CteUnboundColParamContext 62.50% 5 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.CteUnboundSubQueryContext 0.00% 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.DatabaseIdentifierContext 63.64% 7 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.DataClauseContext 83.33% 5 6
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.DataClauseFormatContext 0.00% 7
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.DataClauseSelectContext 62.50% 5 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.DataClauseValuesContext 60.00% 6 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.DeleteStmtContext 42.86% 6 14
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.DescribeStmtContext 54.55% 6 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.DestinationClauseContext 0.00% 9
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.DictionaryArgExprContext 0.00% 12
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.DictionaryAttrDfntContext 40.00% 6 15
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.DictionaryEngineClauseContext 75.00% 6 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.DictionaryPrimaryKeyClauseContext 46.15% 6 13
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.DictionarySchemaClauseContext 46.15% 6 13
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.DictionarySettingsClauseContext 54.55% 6 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.DropPrivilegeContext 0.00% 24
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.DropStmtContext 15.00% 6 40
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.EngineClauseContext 75.00% 6 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.EngineExprContext 46.15% 6 13
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.EnumValueContext 0.00% 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ExchangeStmtContext 42.86% 6 14
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ExistsDatabaseStmtContext 0.00% 13
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ExistsStmtContext 83.33% 5 6
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ExistsTableStmtContext 31.25% 5 16
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ExplainStmtContext 33.33% 6 18
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.FilenameContext 0.00% 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.FloatingLiteralContext 50.00% 6 12
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.FrameBetweenContext 0.00% 9
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.FrameStartContext 0.00% 6
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.FromClauseContext 36.84% 7 19
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.GrantStmtContext 20.69% 6 29
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.GrantTableIdentifierContext 50.00% 6 12
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.GroupByClauseContext 42.86% 6 14
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.HavingClauseContext 0.00% 9
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.IdentifierContext 50.00% 6 12
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.IdentifierOrNullContext 66.67% 6 9
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.InserParameterExprContext 62.50% 5 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.InsertParameterContext 83.33% 5 6
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.InsertParameterFuncExprContext 55.56% 5 9
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.InsertRawValueContext 83.33% 5 6
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.InsertStmtContext 60.00% 9 15
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.IntervalContext 40.00% 6 15
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.JoinConstraintClauseContext 0.00% 12
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.JoinExprContext 83.33% 5 6
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.JoinExprCrossOpContext 62.50% 5 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.JoinExprOpContext 0.00% 12
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.JoinExprParensContext 0.00% 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.JoinExprTableContext 62.50% 5 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.JoinOpContext 0.00% 6
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.JoinOpCrossContext 50.00% 6 12
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.JoinOpFullContext 0.00% 9
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.JoinOpInnerContext 0.00% 9
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.JoinOpLeftRightContext 0.00% 13
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.KeywordContext 1.88% 6 319
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.KeywordForAliasContext 2.32% 6 259
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.KillMutationStmtContext 35.71% 5 14
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.KillQueryStmtContext 35.71% 5 14
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.KillStmtContext 83.33% 5 6
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.LayoutClauseContext 40.00% 6 15
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.LifetimeClauseContext 42.86% 6 14
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.LimitByClauseContext 0.00% 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.LimitClauseContext 54.55% 6 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.LimitExprContext 54.55% 6 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.LiteralContext 54.55% 6 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.MoveStmtContext 33.33% 6 18
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.NameCollectionKeyContext 50.00% 6 12
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.NamedQueryContext 40.00% 6 15
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.NestedIdentifierContext 70.00% 7 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.NumberLiteralContext 40.00% 6 15
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.OptimizeByExprContext 30.00% 6 20
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.OptimizeStmtContext 40.00% 6 15
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.OrderByClauseContext 60.00% 6 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.OrderExprContext 37.50% 6 16
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.OrderExprListContext 54.55% 6 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.PartitionByClauseContext 0.00% 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.PartitionClauseContext 0.00% 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.PrewhereClauseContext 0.00% 9
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.PrimaryKeyClauseContext 0.00% 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.PrivelegeListContext 54.55% 6 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.PrivilegeContext 13.64% 6 44
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ProjectionOrderByClauseContext 0.00% 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ProjectionSelectStmtContext 0.00% 14
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.QueryContext 38.24% 13 34
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.QueryStmtContext 46.67% 7 15
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.QuotaForClauseContext 33.33% 6 18
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.QuotaMaxExprContext 60.00% 6 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.RangeClauseContext 0.00% 14
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.RatioExprContext 0.00% 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.RenameStmtContext 37.50% 6 16
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.RevokeStmtContext 26.09% 6 23
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.SampleByClauseContext 0.00% 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.SampleClauseContext 0.00% 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.SchemaAsFunctionClauseContext 0.00% 7
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.SchemaAsTableClauseContext 71.43% 5 7
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.SchemaDescriptionClauseContext 45.45% 5 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.SelectStmtContext 21.43% 6 28
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.SelectStmtWithParensContext 54.55% 6 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.SelectUnionStmtContext 40.00% 6 15
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.SetRolesListContext 63.64% 7 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.SetRoleStmtContext 38.10% 8 21
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.SetStmtContext 60.00% 6 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.SettingExprContext 60.00% 6 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.SettingExprListContext 54.55% 6 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.SettingsClauseContext 0.00% 9
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowAccessStmtContext 71.43% 5 7
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowClustersStmtContext 27.78% 5 18
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowClusterStmtContext 62.50% 5 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowColumnsStmtContext 23.81% 5 21
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowCreatePolicyStmtContext 41.67% 5 12
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowCreateProfileContext 38.46% 5 13
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowCreateQuotaStmtContext 38.46% 5 13
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowCreateRoleStmtContext 41.67% 5 12
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowCreateStmtContext 27.78% 5 18
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowCreateUserStmtContext 38.46% 5 13
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowDatabasesStmtContext 0.00% 18
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowDictionariesStmtContext 26.32% 5 19
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowEnginesStmtContext 41.67% 5 12
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowFromDbClauseContext 60.00% 6 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowFromTableFromDbClauseContext 54.55% 6 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowFSCachesStmtContext 62.50% 5 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowFunctionsStmtContext 45.45% 5 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowGrantsStmtContext 33.33% 5 15
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowIndexStmtContext 22.73% 5 22
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowMergesStmtContext 27.78% 5 18
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowPoliciesStmtContext 50.00% 5 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowPrivilegeContext 0.00% 25
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowProcessListStmtContext 41.67% 5 12
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowProfilesStmtContext 62.50% 5 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowQuotasStmtContext 71.43% 5 7
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowQuotaStmtContext 62.50% 5 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowRolesStmtContext 55.56% 5 9
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowSettingsStmtContext 45.45% 5 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowSettingStmtContext 62.50% 5 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowStmtContext 83.33% 5 6
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowTablesStmtContext 23.81% 5 21
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ShowUsersStmtContext 71.43% 5 7
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.SourceClauseContext 42.86% 6 14
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.SourcePrivilegeContext 0.00% 25
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.SubqueryClauseContext 66.67% 6 9
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.SystemPrivilegeContext 0.00% 81
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.SystemStmtContext 5.88% 6 102
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.TableArgExprContext 60.00% 6 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.TableArgListContext 54.55% 6 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.TableColumnDfntContext 35.29% 6 17
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.TableColumnPropertyExprContext 54.55% 6 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.TableColumnPropertyTypeContext 0.00% 13
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.TableElementExprColumnContext 83.33% 5 6
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.TableElementExprConstraintContext 0.00% 9
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.TableElementExprContext 83.33% 5 6
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.TableElementExprIndexContext 0.00% 7
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.TableElementExprProjectionContext 0.00% 7
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.TableExprAliasContext 55.56% 5 9
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.TableExprContext 83.33% 5 6
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.TableExprFunctionContext 83.33% 5 6
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.TableExprIdentifierContext 100.00% 6 6
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.TableExprSubqueryContext 62.50% 5 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.TableFunctionExprContext 54.55% 6 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.TableIdentifierContext 80.00% 8 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.TableIndexDfntContext 0.00% 13
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.TableProjectionDfntContext 0.00% 9
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.TableSchemaClauseContext 83.33% 5 6
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.TopClauseContext 0.00% 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.TruncateStmtContext 42.86% 6 14
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.TtlClauseContext 0.00% 12
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.TtlExprContext 0.00% 13
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.UndropStmtContext 50.00% 6 12
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.UpdateStmtContext 46.15% 6 13
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.UserCreateGranteesClauseContext 0.00% 19
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.UserCreateHostClauseContext 0.00% 14
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.UserCreateHostDefContext 0.00% 13
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.UserIdentifiedClauseContext 27.27% 6 22
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.UserIdentifiedWithClauseContext 17.14% 6 35
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.UserIdentifierContext 54.55% 6 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.UseStmtContext 77.78% 7 9
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.UuidClauseContext 66.67% 6 9
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ValidUntilClauseContext 0.00% 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ViewIdentifierContext 0.00% 8
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.ViewParamContext 63.64% 7 11
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.WatchStmtContext 0.00% 12
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.WhereClauseContext 66.67% 6 9
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.WindowClauseContext 0.00% 13
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.WindowExprContext 0.00% 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.WinFrameBoundContext 0.00% 13
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.WinFrameClauseContext 0.00% 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.WinFrameExtendContext 0.00% 6
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.WinOrderByClauseContext 0.00% 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.WinPartitionByClauseContext 0.00% 10
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParser.WithClauseContext 0.00% 9
com.clickhouse.jdbc.internal.parser.antlr4.ClickHouseParserBaseListener 64.76% 384 593
com.clickhouse.jdbc.internal.parser.javacc.AbstractCharStream 52.04% 102 196
com.clickhouse.jdbc.internal.parser.javacc.ClickHouseSqlParser 72.89% 2963 4065
com.clickhouse.jdbc.internal.parser.javacc.ClickHouseSqlParserConstants 100.00% 1 1
com.clickhouse.jdbc.internal.parser.javacc.ClickHouseSqlParserTokenManager 84.25% 1728 2051
com.clickhouse.jdbc.internal.parser.javacc.ClickHouseSqlStatement 38.78% 57 147
com.clickhouse.jdbc.internal.parser.javacc.ClickHouseSqlUtils 68.57% 24 35
com.clickhouse.jdbc.internal.parser.javacc.JdbcParseHandler 24.05% 19 79
com.clickhouse.jdbc.internal.parser.javacc.LanguageType 100.00% 6 6
com.clickhouse.jdbc.internal.parser.javacc.OperationType 100.00% 2 2
com.clickhouse.jdbc.internal.parser.javacc.ParseException 3.95% 3 76
com.clickhouse.jdbc.internal.parser.javacc.ParseHandler 50.00% 2 4
com.clickhouse.jdbc.internal.parser.javacc.SimpleCharStream 30.00% 9 30
com.clickhouse.jdbc.internal.parser.javacc.StatementType 92.50% 37 40
com.clickhouse.jdbc.internal.parser.javacc.Token 66.67% 8 12
com.clickhouse.jdbc.internal.parser.javacc.TokenMgrException 0.00% 39
com.clickhouse.jdbc.internal.SqlParserFacade 94.44% 51 54
com.clickhouse.jdbc.internal.SqlParserFacade.ANTLR4AndParamsParser 100.00% 18 18
com.clickhouse.jdbc.internal.SqlParserFacade.ANTLR4AndParamsParser.ParseStatementAndParamsListener 92.86% 13 14
com.clickhouse.jdbc.internal.SqlParserFacade.ANTLR4Parser 100.00% 49 49
com.clickhouse.jdbc.internal.SqlParserFacade.ANTLR4Parser.ParsedPreparedStatementListener 98.39% 61 62
com.clickhouse.jdbc.internal.SqlParserFacade.ANTLR4Parser.ParsedStatementListener 100.00% 15 15
com.clickhouse.jdbc.internal.SqlParserFacade.ANTLR4Parser.ParserErrorListener 100.00% 2 2
com.clickhouse.jdbc.internal.SqlParserFacade.JavaCCParser 95.58% 108 113
com.clickhouse.jdbc.internal.SqlParserFacade.SQLParser 100.00% 4 4
com.clickhouse.jdbc.JdbcV2Wrapper 100.00% 4 4
com.clickhouse.jdbc.metadata.DatabaseMetaDataImpl 87.39% 520 595
com.clickhouse.jdbc.metadata.DatabaseMetaDataImpl.TableType 100.00% 14 14
com.clickhouse.jdbc.metadata.DatabaseMetaDataImpl.TypeLiteralInfo 100.00% 6 6
com.clickhouse.jdbc.metadata.ParameterMetaDataImpl 100.00% 23 23
com.clickhouse.jdbc.metadata.ResultSetMetaDataImpl 98.86% 87 88
com.clickhouse.jdbc.metadata.ResultSetMetaDataImpl.ColumnTypeBinding 100.00% 10 10
com.clickhouse.jdbc.metadata.ShowStatementsMetaData 92.59% 175 189
com.clickhouse.jdbc.PreparedStatementImpl 78.47% 390 497
com.clickhouse.jdbc.PreparedStatementImpl.ArrayProcessingCursor 100.00% 7 7
com.clickhouse.jdbc.ResultSetImpl 84.75% 539 636
com.clickhouse.jdbc.StatementImpl 93.63% 353 377
com.clickhouse.jdbc.types.Array 88.00% 44 50
com.clickhouse.jdbc.types.ArrayResultSet 51.85% 238 459
com.clickhouse.jdbc.types.Struct 100.00% 8 8
com.clickhouse.jdbc.WriterStatementImpl 41.98% 89 212

@github-actions

Copy link
Copy Markdown

JDBC V1 Coverage

Coverage Report

Package Coverage Lines Covered Total Lines
com.clickhouse.jdbc 35.40% 947 2675
com.clickhouse.jdbc.internal 63.88% 1344 2104
com.clickhouse.jdbc.parser 69.59% 4598 6607
Class Coverage
Class Coverage Lines Covered Total Lines
com.clickhouse.jdbc.AbstractResultSet 1.33% 3 226
com.clickhouse.jdbc.ClickHouseArray 34.62% 9 26
com.clickhouse.jdbc.ClickHouseBlob 0.00% 12
com.clickhouse.jdbc.ClickHouseClob 0.00% 14
com.clickhouse.jdbc.ClickHouseConnection 52.78% 19 36
com.clickhouse.jdbc.ClickHouseDatabaseMetaData 47.31% 185 391
com.clickhouse.jdbc.ClickHouseDataSource 41.18% 7 17
com.clickhouse.jdbc.ClickHouseDriver 72.73% 40 55
com.clickhouse.jdbc.ClickHousePreparedStatement 16.67% 13 78
com.clickhouse.jdbc.ClickHouseResultSet 65.23% 167 256
com.clickhouse.jdbc.ClickHouseResultSetMetaData 34.21% 13 38
com.clickhouse.jdbc.ClickHouseScrollableResultSet 0.00% 17
com.clickhouse.jdbc.ClickHouseStatement 0.00% 1
com.clickhouse.jdbc.ClickHouseStruct 71.43% 5 7
com.clickhouse.jdbc.ClickHouseXml 0.00% 10
com.clickhouse.jdbc.CombinedResultSet 51.88% 83 160
com.clickhouse.jdbc.DataSourceV1 69.70% 23 33
com.clickhouse.jdbc.DriverV1 40.63% 39 96
com.clickhouse.jdbc.DriverV1.FrameworksDetection 90.91% 10 11
com.clickhouse.jdbc.internal.AbstractPreparedStatement 27.59% 16 58
com.clickhouse.jdbc.internal.ClickHouseConnectionImpl 68.97% 389 564
com.clickhouse.jdbc.internal.ClickHouseJdbcUrlParser 100.00% 29 29
com.clickhouse.jdbc.internal.ClickHouseJdbcUrlParser.ConnectionInfo 100.00% 18 18
com.clickhouse.jdbc.internal.ClickHouseParameterMetaData 70.37% 19 27
com.clickhouse.jdbc.internal.ClickHouseStatementImpl 61.66% 283 459
com.clickhouse.jdbc.internal.InputBasedPreparedStatement 71.76% 183 255
com.clickhouse.jdbc.internal.JdbcSavepoint 100.00% 14 14
com.clickhouse.jdbc.internal.JdbcTransaction 72.50% 58 80
com.clickhouse.jdbc.internal.SqlBasedPreparedStatement 66.86% 230 344
com.clickhouse.jdbc.internal.StreamBasedPreparedStatement 45.21% 66 146
com.clickhouse.jdbc.internal.TableBasedPreparedStatement 35.45% 39 110
com.clickhouse.jdbc.JdbcConfig 71.84% 74 103
com.clickhouse.jdbc.JdbcParameterizedQuery 70.00% 63 90
com.clickhouse.jdbc.JdbcParseHandler 95.12% 78 82
com.clickhouse.jdbc.JdbcTypeMapping 42.96% 61 142
com.clickhouse.jdbc.JdbcTypeMapping.AnsiTypeMapping 16.81% 20 119
com.clickhouse.jdbc.JdbcTypeMapping.InstanceHolder 100.00% 3 3
com.clickhouse.jdbc.JdbcWrapper 20.00% 1 5
com.clickhouse.jdbc.Main 0.00% 60
com.clickhouse.jdbc.Main.GenericQuery 0.00% 114
com.clickhouse.jdbc.Main.Int8Query 0.00% 59
com.clickhouse.jdbc.Main.MixedQuery 0.00% 89
com.clickhouse.jdbc.Main.Options 0.00% 124
com.clickhouse.jdbc.Main.Pojo 0.00% 25
com.clickhouse.jdbc.Main.StringQuery 0.00% 57
com.clickhouse.jdbc.Main.UInt64Query 0.00% 57
com.clickhouse.jdbc.parser.AbstractCharStream 44.44% 88 198
com.clickhouse.jdbc.parser.ClickHouseSqlParser 69.08% 2840 4111
com.clickhouse.jdbc.parser.ClickHouseSqlParserConstants 100.00% 1 1
com.clickhouse.jdbc.parser.ClickHouseSqlParserTokenManager 76.77% 1474 1920
com.clickhouse.jdbc.parser.ClickHouseSqlStatement 69.93% 100 143
com.clickhouse.jdbc.parser.ClickHouseSqlUtils 100.00% 28 28
com.clickhouse.jdbc.parser.LanguageType 100.00% 6 6
com.clickhouse.jdbc.parser.OperationType 100.00% 2 2
com.clickhouse.jdbc.parser.ParseException 3.95% 3 76
com.clickhouse.jdbc.parser.ParseHandler 75.00% 3 4
com.clickhouse.jdbc.parser.SimpleCharStream 30.00% 9 30
com.clickhouse.jdbc.parser.StatementType 97.30% 36 37
com.clickhouse.jdbc.parser.Token 66.67% 8 12
com.clickhouse.jdbc.parser.TokenMgrException 0.00% 39
com.clickhouse.jdbc.SqlExceptionUtils 50.00% 31 62

@github-actions

Copy link
Copy Markdown

Client V1 Coverage

Coverage Report

Package Coverage Lines Covered Total Lines
com.clickhouse.client 52.86% 2162 4090
com.clickhouse.client.config 76.14% 217 285
com.clickhouse.client.naming 86.96% 20 23
Class Coverage
Class Coverage Lines Covered Total Lines
com.clickhouse.client.AbstractClient 63.93% 78 122
com.clickhouse.client.AbstractSocketClient 3.13% 7 224
com.clickhouse.client.AbstractSocketClient.SocketRequest 0.00% 8
com.clickhouse.client.ClickHouseClient 6.16% 17 276
com.clickhouse.client.ClickHouseClientBuilder 68.67% 57 83
com.clickhouse.client.ClickHouseClientBuilder.Agent 19.05% 28 147
com.clickhouse.client.ClickHouseClientBuilder.DummyClient 53.85% 7 13
com.clickhouse.client.ClickHouseCluster 40.98% 25 61
com.clickhouse.client.ClickHouseConfig 80.93% 208 257
com.clickhouse.client.ClickHouseConfig.ClientOptions 66.67% 14 21
com.clickhouse.client.ClickHouseCredentials 60.00% 18 30
com.clickhouse.client.ClickHouseDnsResolver 44.44% 8 18
com.clickhouse.client.ClickHouseException 74.58% 44 59
com.clickhouse.client.ClickHouseLoadBalancingPolicy 67.06% 57 85
com.clickhouse.client.ClickHouseLoadBalancingPolicy.DefaultPolicy 100.00% 2 2
com.clickhouse.client.ClickHouseLoadBalancingPolicy.FirstAlivePolicy 95.24% 20 21
com.clickhouse.client.ClickHouseLoadBalancingPolicy.RandomPolicy 100.00% 6 6
com.clickhouse.client.ClickHouseLoadBalancingPolicy.RoundRobinPolicy 92.86% 13 14
com.clickhouse.client.ClickHouseNode 80.45% 284 353
com.clickhouse.client.ClickHouseNode.Builder 66.67% 68 102
com.clickhouse.client.ClickHouseNode.Status 100.00% 5 5
com.clickhouse.client.ClickHouseNodes 53.87% 202 375
com.clickhouse.client.ClickHouseNodeSelector 88.64% 78 88
com.clickhouse.client.ClickHouseParameterizedQuery 76.32% 174 228
com.clickhouse.client.ClickHouseParameterizedQuery.QueryPart 62.50% 15 24
com.clickhouse.client.ClickHouseProtocol 97.06% 33 34
com.clickhouse.client.ClickHouseRequest 55.74% 330 592
com.clickhouse.client.ClickHouseRequest.Mutation 83.33% 90 108
com.clickhouse.client.ClickHouseRequest.PipedWriter 100.00% 7 7
com.clickhouse.client.ClickHouseRequestManager 17.86% 5 28
com.clickhouse.client.ClickHouseRequestManager.InstanceHolder 100.00% 1 1
com.clickhouse.client.ClickHouseResponse 18.18% 2 11
com.clickhouse.client.ClickHouseResponse.new ClickHouseResponse() {...} 33.33% 3 9
com.clickhouse.client.ClickHouseResponseSummary 85.00% 51 60
com.clickhouse.client.ClickHouseResponseSummary.Progress 92.00% 23 25
com.clickhouse.client.ClickHouseResponseSummary.Statistics 64.71% 11 17
com.clickhouse.client.ClickHouseSimpleResponse 48.57% 34 70
com.clickhouse.client.ClickHouseSslContextProvider 90.91% 10 11
com.clickhouse.client.ClickHouseStreamResponse 0.00% 47
com.clickhouse.client.ClickHouseTransaction 0.00% 220
com.clickhouse.client.ClickHouseTransaction.XID 92.59% 50 54
com.clickhouse.client.ClickHouseTransactionException 0.00% 11
com.clickhouse.client.ClickHouseVersionUtils 48.43% 77 159
com.clickhouse.client.config.ClickHouseClientOption 89.61% 138 154
com.clickhouse.client.config.ClickHouseDefaults 94.44% 34 36
com.clickhouse.client.config.ClickHouseDefaultSslContextProvider 45.24% 38 84
com.clickhouse.client.config.ClickHouseDefaultSslContextProvider.NonValidatingTrustManager 0.00% 4
com.clickhouse.client.config.ClickHouseHealthCheckMethod 100.00% 3 3
com.clickhouse.client.config.ClickHouseProxyType 100.00% 2 2
com.clickhouse.client.config.ClickHouseSslMode 100.00% 2 2
com.clickhouse.client.naming.SrvResolver 86.96% 20 23
com.clickhouse.client.UnsupportedProtocolException 0.00% 4

@chernser chernser left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • move client identification logic into WorkloadIdentitySupport class.
  • make it around User-Agent header so future transport implementations do not skip this feature
  • add another method com.clickhouse.client.api.Client.Builder#setClientName with metadata options
  • User still should specify set client name instead of setting User-Agent header - this should be stated in the documentation.

Address review feedback on #3213:
- Add WorkloadIdentitySupport. It builds the User-Agent value (client
  name or custom User-Agent, then clickhouse-java-v2/<version> with the
  metadata, lv and os entries) and validates client metadata entries.
  HttpAPIClientHelper only reads a custom User-Agent header and sets the
  value that the class returns.
- Replace Client.Builder#setClientMetadata(Map) with
  Client.Builder#setClientName(String, Map). setClientName(String) does
  not change the metadata. The client_metadata property is unchanged.
- State in the docs and in the httpHeader Javadoc that applications set
  the client name, not the User-Agent header.

Implements: #3202

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@polyglotAI-bot

Copy link
Copy Markdown
Collaborator Author

@chernser Thank you for the review. I pushed aabc06e:

  1. WorkloadIdentitySupport (client-v2/.../api/internal/WorkloadIdentitySupport.java) now owns the client identification. It builds the User-Agent value from the client name and the client metadata, and it validates metadata entries (the client_metadata property calls it).
  2. Around the User-Agent header: getUserAgent(customUserAgent, requestConfig) returns the complete header value. HttpAPIClientHelper only reads a User-Agent header that the application set and sets the value that the class returns. A new transport uses the same class and sends the same identification.
  3. Client.Builder#setClientName(String clientName, Map<String, String> metadata) is added. I removed setClientMetadata(Map). It was added in this PR and is not released, so now there is one builder method for the identification. The client_metadata property stays for JDBC URLs and setOption. setClientName(String) does not change the metadata, because jdbc-v2 calls it after it applies the connection properties. If you want to keep setClientMetadata as well, tell me and I will add it back.
  4. Docs: the setClientName and httpHeader Javadoc, client.mdx, jdbc.mdx, integration-client.md, integration-jdbc.md and features.md now state that applications must set the client name, not the User-Agent header (a custom User-Agent header replaces the client name).

Not changed: jdbc-v2 still builds its own application part (<app> jdbc-v2/<version> <frameworks>) and passes it to setClientName. Moving that into WorkloadIdentitySupport would change the jdbc-v2 output, so I left it for a follow-up.

Tests (ClickHouse 26.9): client-v2 unit 760/760, jdbc-v2 unit 1963/1963, client-v2 User-Agent integration tests 11/11, jdbc-v2 User-Agent integration tests 6/6, packages/clickhouse-jdbc-all packages. New UserAgentUnitTest rows cover the overload: metadata kept by setClientName(String), replaced by setClientName(String, Map), and cleared by null or an empty map.

@chernser chernser left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good - logic is in separate file. But implementation is far from optimal

  1. cache metadata. it is a massive string and should be validated upon build and composed only once.
  2. mandatory user agent part must be composed once and cached.
  3. ClientConfigurationProperties cannot hold default value because it will be rebuilt everytime user create client with custom user agent or client name (see previous logic)

- The mandatory part (clickhouse-java-v2/<version>, lv, os) is a static
  constant, composed once.
- The client metadata is validated when the client is built and composed
  once per client.
- The complete value is cached and composed again only when the
  application part changes (client name or custom User-Agent).
- The application part is trimmed; use ClientUtils#isBlank.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@polyglotAI-bot

Copy link
Copy Markdown
Collaborator Author

@chernser Thank you for the review. I pushed 3abea18 for your review of 2026-10-19T19:28Z:

  1. Metadata is validated on build and composed once. CLIENT_METADATA.parseValue validates the entries. It runs one time, in parseConfigMap, from the Client constructor that Builder#build() calls, so an invalid entry makes build() throw ClientMisconfigurationException. The WorkloadIdentitySupport constructor composes the metadata into the client part one time per client. Requests do not read or compose the metadata.

  2. The mandatory part is composed once and cached. clickhouse-java-v2/<version> ( and lv:java/<java.version>; os:<os.name>) are now static constants of WorkloadIdentitySupport, composed one time per JVM. A client without metadata uses the static client part as is.

  3. ClientConfigProperties holds no default or composed value. My reading of this point: the cache must not be in ClientConfigProperties (as a default value, or as a stored User-Agent header like in 8b91639), because the value depends on the client name or custom User-Agent of each client. So ClientConfigProperties holds only the raw inputs (client_name, client_metadata). The cache is in WorkloadIdentitySupport, one instance per client:

    • The constructor composes the complete value for the configured client name.
    • getUserAgent(...) returns the cached string. It composes a new value, and caches it, only when the application part changes (Client#updateClientName, or a client_name / User-Agent set for one operation).

    If you meant something else by this point, please tell me.

I also removed the TODO: implement cache for user-agent in HttpAPIClientHelper#correctUserAgentHeader.

Tests

  • New WorkloadIdentitySupportTest. It checks that the value is composed one time per application part, and that clients share the mandatory part (assertSame), against values from the format spec.
  • A new UserAgentUnitTest row: a client name with spaces is trimmed.
  • I made 3 mutations: no trim, no cache, and a mandatory part composed per client. The new tests fail for each one.

Results (CH 26.9)

  • client-v2 unit: 763/763
  • jdbc-v2 unit: 1963/1963
  • client-v2 User-Agent integration tests: 11/11
  • jdbc-v2 ConnectionTest User-Agent / client info: 3/3
  • javadoc: clean

SonarCloud rule java:S3077 flags the volatile reference to the cached
User-Agent. Use an AtomicReference, as CredentialsManager does. The
behavior does not change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Triage

Category: feature • Risk: high

Summary
Implements #3202: client-v2 now composes the HTTP User-Agent in the standard ClickHouse client format (<app> clickhouse-java-v2/<v> (key:value; ...; lv:java/...; os:...; ahc:...)), replacing the old jvm: token and trailing Apache-HttpClient/<v> suffix, and adds a new way for applications to inject key/value metadata into the comment group via Client.Builder#setClientName(String, Map) and a new config property client_id_metadata (also reachable via JDBC URL/properties). Identification logic moves into a new internal class WorkloadIdentitySupport with a cached, volatile/synchronized composed value refreshed on updateClientName. The build gains a templating-maven-plugin to generate DependencyVersions (shaded Apache HttpClient version). jdbc-v2 inherits the format change since it sends through client-v2. Extensive WireMock/unit/integration tests, docs, and a changelog entry marked "Breaking change" are included.

What this impacts

  • client-v2: Client builder API, ClientConfigProperties (new enum constant + fromKeyValuePairs), HttpAPIClientHelper request path, new WorkloadIdentitySupport
  • jdbc-v2: inherits the new User-Agent on every request (integration test added; no source change)
  • Wire-visible output: system.query_log.http_user_agent format changes for all consumers; parsers keyed on jvm: or Apache-HttpClient/ break
  • Build: new templating-maven-plugin in client-v2/pom.xml and root pom.xml; build.date/apache.http.client.version removed from client-v2-version.properties

Concerns

  • High rule: wire-visible output shape changed — the User-Agent/http_user_agent format changes unconditionally for client-v2 and jdbc-v2, which can silently break downstream log/monitoring parsers.
  • High rule: no feature flag — the breaking format change has no option to retain the old format for a transition period.
  • High rule: large diff — 869 additions across 21 files (~330 lines of main source plus tests/docs/build); consider reviewing in parts (format change vs. metadata API vs. build templating).
  • High rule: new concurrency primitives in the request path — WorkloadIdentitySupport introduces a synchronized update method and two volatile fields read non-atomically in getUserAgent (ordering is comment-justified but merits careful review).
  • Description drift: the PR body is stale vs. the latest commit — body says the Apache-HttpClient token is dropped, the property is client_metadata, and lv/os are reserved/rejected keys; the code adds an ahc: entry via new build-time templating, names the property client_id_metadata, and lets metadata override lv/os/ahc (case-insensitive). The documented test inventory may not match the code either.
  • Reviewer chernser has already requested changes.

Required reviewer action

  • high — at least one human reviewer.

@chernser chernser left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLIENT_METADATA should not have default value
there should be no constants for parts like this - it is hard to maintain because logic get disconnected.
Make just one branch - compose client part once.

compose client can be a bit heavy in logic - it is called once. But it is important to keep this logic in one place and do not have many branches.

Review follow-up for #3213:
- Remove the static constants for parts of the User-Agent (start, end,
  value without metadata). composeClientPart now composes the complete
  client part with one code path, once per client, when the client is
  created. This replaces the per-JVM constants from 3abea18.
- Read client_metadata only if it is set (applyIfSet), with no default.
- Replace 0x20 / 0x7E with isPrintableAscii (' ' to '~'), and explain
  the forbidden characters of a metadata entry.
- Tests: replace testMandatoryPartSharedByClients (it pinned the
  shared static part) with a test for no / empty metadata that also
  catches state shared between instances; add rows for the ends of
  the printable ASCII range (0x1F, '~', 0x7F).

Implements: #3202

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@polyglotAI-bot

Copy link
Copy Markdown
Collaborator Author

@chernser Thank you. I pushed 8fa4ebd for your review of 2026-10-19T21:02Z:

  1. CLIENT_METADATA has no default value. The enum constant uses the constructor without a default (null). WorkloadIdentitySupport no longer calls getOrDefault for it. It reads the value only if it is set (applyIfSet).
  2. No constants for parts of the User-Agent. I removed CLIENT_PART_START, CLIENT_PART_END and CLIENT_PART_WITHOUT_METADATA.
  3. One branch, in one place. composeClientPart(configuration) composes the complete client part (clickhouse-java-v2/<version> (, the metadata entries, lv:java/..., os:...) with one code path, a StringJoiner. The constructor calls it once per client.
  4. Magic constants: see the inline reply.

What I kept, and why:

  • RESERVED_KEY_LANGUAGE_VERSION and RESERVED_KEY_OS are keys, not parts of the value. The reserved-key validation and the composition both use them, so the two stay connected.
  • The per-client cache of the complete value (application part → value), from your previous review. A request composes the value again only when the client name or a custom User-Agent changes.

Tests

  • testMandatoryPartSharedByClients checked that clients share the static part, so I replaced it. The new test checks no metadata and empty metadata, and fails if the client part is shared between instances.
  • New rows for the ends of the printable ASCII range.
  • 4 mutations each make a test fail: metadata joined as one entry, a static client part, and wrong range ends (0x1F, 0x7F).

Results (CH 26.9)

  • client-v2 unit: 767/767
  • client-v2 User-Agent integration tests: 11/11
  • jdbc-v2 ConnectionTest User-Agent / client info: 3/3
  • javadoc: clean

Comment thread client-v2/src/main/java/com/clickhouse/client/api/ClientConfigProperties.java Outdated
Comment thread client-v2/src/main/resources/client-v2-version.properties
…name client_id_metadata

- HttpAPIClientHelper keeps one final WorkloadIdentitySupport (no
  AtomicReference). Client#updateClientName calls
  WorkloadIdentitySupport#updateClientName, which composes the value
  again and keeps it (synchronized; volatile strings).
- A blank application part for one operation gets the kept value.
- Client metadata can set lv, os and ahc (keys compared ignoring
  case); the client adds its own entry only for a key that is not set.
- New ahc entry: the Apache HttpClient version, from the generated
  class DependencyVersions (templating-maven-plugin), so the version is
  correct also in the shaded jar.
- Property client_metadata renamed to client_id_metadata.
- compose -> composeUserAgent; START_OF_ASCII_RANGE /
  END_OF_ASCII_RANGE constants.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@polyglotAI-bot

Copy link
Copy Markdown
Collaborator Author

@chernser Thank you. I pushed 014290c for your review of 2026-10-20T01:01Z and the 8 inline comments (I replied in each thread):

  1. One instance per client. HttpAPIClientHelper keeps a final WorkloadIdentitySupport, without AtomicReference. Client#updateClientName calls WorkloadIdentitySupport#updateClientName on the same instance, which composes the value for the new client name and keeps it.
  2. Blank application part. A blank client name or User-Agent value set for one operation gets the kept value, not a new string.
  3. Metadata can replace lv, os and ahc. The client adds its own entry only for a key that the metadata does not set (keys compared ignoring case). lv and os are no longer reserved.
  4. ahc. client-v2 generates DependencyVersions with templating-maven-plugin. ahc:<version> is the Apache HttpClient version, also in the shaded jar.
  5. Names. client_metadata → client_id_metadata, compose → composeUserAgent, and the START_OF_ASCII_RANGE / END_OF_ASCII_RANGE constants.

Tests (CH 26.9): client-v2 unit 779/779, jdbc-v2 unit 1963/1963, client-v2 User-Agent ITs 11/11, jdbc-v2 ConnectionTest User-Agent/client info 3/3.

Two questions are in the ahc thread: whether ahc should prefer the runtime httpclient5 version when the jar is not shaded, and whether Client.clientVersion should move to the generated class too.

@chernser chernser left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments

…>, add Versions

- Client creates the WorkloadIdentitySupport, keeps it in a final field
  and updates it in updateClientName. HttpAPIClientHelper gets it in its
  constructor and only sets the User-Agent header from it;
  HttpAPIClientHelper#updateClientName is removed.
- The HTTP client entry is now hc:ahc_<Apache HttpClient version>.
- The generated class DependencyVersions is now Versions. It also has
  the client version (CLIENT), so client-v2-version.properties is not
  read any more and is removed, with the resource filtering block.
  Client.clientVersion comes from Versions.CLIENT and is not a
  compile-time constant.
- addIfNotSet moved to ClientUtils#putIfAbsentIgnoreCase (null key is
  rejected).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@polyglotAI-bot

Copy link
Copy Markdown
Collaborator Author

@chernser Thank you. I pushed a545bcf for your review of 2026-10-20T01:45Z and the 4 inline comments (I replied in each thread):

  1. Versions. DependencyVersions is now com.clickhouse.client.api.internal.Versions, with CLIENT and APACHE_HTTP_CLIENT. Client.clientVersion comes from Versions.CLIENT (not a compile-time constant). client-v2-version.properties is no longer read, so I removed it and the resource filtering block.
  2. WorkloadIdentitySupport in Client. Client creates it, keeps it, and updates it in updateClientName. HttpAPIClientHelper gets it in its constructor and only sets the header.
  3. hc:ahc_<version>. For example hc:ahc_5.6.4, in code, tests and docs.
  4. ClientUtils#putIfAbsentIgnoreCase. Moved, with tests.

Results (ClickHouse 26.9): client-v2 unit 786/786, client-v2 User-Agent integration tests 11/11, jdbc-v2 unit 1963/1963, jdbc-v2 ConnectionTest User-Agent/client info 3/3, javadoc clean, clickhouse-jdbc-all builds. I updated the PR description.

Comment thread docs/integration-client.md Outdated
Comment thread docs/clickhouse-docs/client.mdx Outdated

@chernser chernser left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments. coverage still 88%

…oc examples as methods

- WorkloadIdentitySupportTest: one data-provider test for the value of a
  request and one for client name updates, plus a test that two instances
  do not share the client part.
- UserAgentUnitTest: entries with a null key or a null value in the
  setClientName(String, Map) metadata are ignored.
- Client.Builder#setClientName(String, Map) Javadoc and features.md: a null
  key or value is ignored.
- docs: wrap the client metadata examples as methods.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@polyglotAI-bot

Copy link
Copy Markdown
Collaborator Author

@chernser Thank you. I pushed 3d8771a for your review of 2026-10-20T05:27Z (I replied in the 3 threads):

  1. Doc examples. Both client metadata examples (integration-client.md, client.mdx) are now methods with imports.

  2. WorkloadIdentitySupportTest. It now uses data providers: one row for each request case and one row for each client name update.

  3. Coverage. The only lines of this PR without coverage were in ClientConfigProperties#fromKeyValuePairs: the skip of a metadata entry with a null key or value. A UserAgentUnitTest row now sends such entries through setClientName(String, Map). The Javadoc and features.md now say that null entries are ignored. Of the 79 coverable lines that this PR changes, Sonar showed 77 covered for a545bcf. The 2 missing ones were these lines, so all 79 should be covered now.

    The 88.7% figure is mostly lines that existed before this PR. For this PR, Sonar counts all coverable lines of Client.java as new code: new_lines_to_cover = 792, which equals the file's lines_to_cover (main: 785, of which 78 are not covered). Of the 81 uncovered "new" lines, 80 are in Client.java. They are existing code, for example the builder setters setConnectTimeout(long, ChronoUnit), setSocketKeepAlive, setSocketLinger and setSSLKeyStoreType, and error branches in query/insert. The 9 coverable lines that this PR changes in Client.java are all covered. You can check it with api/measures/component_tree?component=ClickHouse_clickhouse-java&pullRequest=3213&metricKeys=new_lines_to_cover,new_uncovered_lines.

    I did not add tests for the existing Client.java code in this PR, to keep it to one feature. If you want the Sonar figure higher, I can add them here or in a separate PR. Please tell me which you prefer.

@sonarqubecloud

Copy link
Copy Markdown

@chernser
chernser merged commit 7f2cb57 into main Oct 20, 2026
34 of 37 checks passed
@chernser
chernser deleted the polyglot/client-v2-user-agent-standard-format branch October 20, 2026 15:05
This was referenced Oct 20, 2026
chernser added a commit that referenced this pull request Oct 21, 2026
…er-agent

[v0.11.0] Send the User-Agent in the standard client format and add client metadata (backport #3213)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[client-v2] Build the User-Agent in the standard client format and let applications add metadata

2 participants