Skip to content

Commit

Permalink
Upgrade ClickHouse JDBC driver to 0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ebyhr committed Feb 26, 2023
1 parent b5fa479 commit 73c63b3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
*/
package io.trino.plugin.clickhouse;

import com.clickhouse.client.ClickHouseColumn;
import com.clickhouse.client.ClickHouseDataType;
import com.clickhouse.client.ClickHouseVersion;
import com.clickhouse.data.ClickHouseColumn;
import com.clickhouse.data.ClickHouseDataType;
import com.clickhouse.data.ClickHouseVersion;
import com.google.common.base.Enums;
import com.google.common.base.Splitter;
import com.google.common.collect.ImmutableList;
Expand Down Expand Up @@ -95,7 +95,7 @@
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.BiFunction;

import static com.clickhouse.client.ClickHouseValues.convertToQuotedString;
import static com.clickhouse.data.ClickHouseValues.convertToQuotedString;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Strings.emptyToNull;
import static com.google.common.base.Strings.isNullOrEmpty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
import io.trino.plugin.jdbc.JdbcMetadataConfig;
import io.trino.plugin.jdbc.credential.CredentialProvider;

import java.util.Properties;

import static com.clickhouse.client.config.ClickHouseClientOption.USE_BINARY_STRING;
import static io.airlift.configuration.ConfigBinder.configBinder;
import static io.trino.plugin.clickhouse.ClickHouseClient.DEFAULT_DOMAIN_COMPACTION_THRESHOLD;
import static io.trino.plugin.jdbc.JdbcModule.bindSessionPropertiesProvider;
Expand All @@ -53,6 +56,9 @@ public void configure(Binder binder)
@ForBaseJdbc
public static ConnectionFactory createConnectionFactory(BaseJdbcConfig config, CredentialProvider credentialProvider)
{
return new ClickHouseConnectionFactory(new DriverConnectionFactory(new ClickHouseDriver(), config, credentialProvider));
Properties properties = new Properties();
// The connector expects byte array for FixedString and String types
properties.setProperty(USE_BINARY_STRING.getKey(), "true");
return new ClickHouseConnectionFactory(new DriverConnectionFactory(new ClickHouseDriver(), config.getConnectionUrl(), properties, credentialProvider));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
package io.trino.plugin.clickhouse;

import com.clickhouse.client.ClickHouseVersion;
import com.clickhouse.data.ClickHouseVersion;
import com.google.common.collect.ImmutableList;
import io.trino.spi.TrinoException;

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,7 @@
<dependency>
<groupId>com.clickhouse</groupId>
<artifactId>clickhouse-jdbc</artifactId>
<version>0.3.2-patch3</version>
<version>0.4.1</version>
<classifier>all</classifier>
<exclusions>
<exclusion>
Expand Down

0 comments on commit 73c63b3

Please sign in to comment.