[DNR]feat(plugin-clickhouse) : Enable jdbc-fetch-size #27688
Draft
nishithakbhaskaran wants to merge 1 commit intoprestodb:masterfrom
Draft
[DNR]feat(plugin-clickhouse) : Enable jdbc-fetch-size #27688nishithakbhaskaran wants to merge 1 commit intoprestodb:masterfrom
nishithakbhaskaran wants to merge 1 commit intoprestodb:masterfrom
Conversation
Contributor
Reviewer's GuideAdds a configurable JDBC fetch size to the ClickHouse connector and wires it through to JDBC PreparedStatements and metadata ResultSets, with defaults and tests for configuration mapping. Sequence diagram for applying jdbc-fetch-size in ClickHouseClientsequenceDiagram
participant PrestoEngine
participant ClickHouseClient
participant Connection
participant PreparedStatement
participant DatabaseMetaData
participant ResultSet
PrestoEngine->>ClickHouseClient: new ClickHouseClient(connectorId, config, baseJdbcConfig, connectionFactory)
ClickHouseClient->>ClickHouseConfig: getFetchSize()
ClickHouseConfig-->>ClickHouseClient: fetchSize
Note over ClickHouseClient: fetchSize stored in ClickHouseClient.fetchSize
PrestoEngine->>ClickHouseClient: getPreparedStatement(connection, sql)
ClickHouseClient->>Connection: prepareStatement(sql)
Connection-->>ClickHouseClient: PreparedStatement
ClickHouseClient->>PreparedStatement: setFetchSize(fetchSize)
ClickHouseClient-->>PrestoEngine: PreparedStatement
PrestoEngine->>ClickHouseClient: getTables(connection, schemaName, tableName)
ClickHouseClient->>Connection: getMetaData()
Connection-->>ClickHouseClient: DatabaseMetaData
ClickHouseClient->>DatabaseMetaData: getTables(catalog, schemaPattern, tablePattern, types)
DatabaseMetaData-->>ClickHouseClient: ResultSet
ClickHouseClient->>ResultSet: setFetchSize(fetchSize)
ClickHouseClient-->>PrestoEngine: ResultSet
Class diagram for ClickHouseConfig and ClickHouseClient fetch size supportclassDiagram
class ClickHouseConfig {
- boolean allowDropTable
- int commitBatchSize
- boolean caseSensitiveNameMatchingEnabled
- int fetchSize
+ String getConnectionUrl()
+ ClickHouseConfig setConnectionUrl(String connectionUrl)
+ boolean isMapStringAsVarchar()
+ ClickHouseConfig setMapStringAsVarchar(boolean mapStringAsVarchar)
+ boolean isCaseInsensitiveNameMatching()
+ ClickHouseConfig setCaseSensitiveNameMatching(boolean caseSensitiveNameMatchingEnabled)
+ int getFetchSize()
+ ClickHouseConfig setFetchSize(int fetchSize)
}
class ClickHouseClient {
- ClickHouseConnectorId connectorId
- ClickHouseConfig config
- int commitBatchSize
- boolean mapStringAsVarchar
- boolean caseSensitiveEnabled
- Cache remoteSchemaNames
- Cache remoteTableNames
- boolean caseSensitiveNameMatchingEnabled
- int fetchSize
+ ClickHouseClient(ClickHouseConnectorId connectorId, ClickHouseConfig config, BaseJdbcConfig baseJdbcConfig, ConnectionFactory connectionFactory)
+ Optional toPrestoType(ClickHouseTypeHandle typeHandle)
+ PreparedStatement getPreparedStatement(Connection connection, String sql)
+ ResultSet getTables(Connection connection, Optional schemaName, Optional tableName)
+ PreparedStatement buildSql(ConnectorSession session, Connection connection, ClickHouseSplit split, List columnHandles)
}
ClickHouseClient --> ClickHouseConfig : uses
ClickHouseClient "1" o-- "1" ClickHouseConnectorId : identified_by
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Motivation and Context
Impact
Test Plan
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.
If release note is NOT required, use:
Summary by Sourcery
Add configurable JDBC fetch size support to the ClickHouse connector and apply it to query and metadata retrieval.
New Features:
Tests: