Skip to content

Commit b93815a

Browse files
committed
fixed proper settings for cloud
1 parent 170674e commit b93815a

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

client-v2/src/main/java/com/clickhouse/client/api/data_formats/internal/BinaryStreamReader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,12 @@ public <T> T readValue(ClickHouseColumn column, Class<?> typeHint) throws IOExce
160160
return (T) Boolean.valueOf(readByteOrEOF(input) == 1);
161161
case Enum8: {
162162
byte enum8Val = (byte) readUnsignedByte();
163-
String name = actualColumn.getEnumConstants().name(enum8Val);
163+
String name = actualColumn.getEnumConstants().nameNullable(enum8Val);
164164
return (T) new EnumValue(name == null ? "<unknown>" : name, enum8Val);
165165
}
166166
case Enum16: {
167167
short enum16Val = (short) readUnsignedShortLE();
168-
String name = actualColumn.getEnumConstants().name(enum16Val);
168+
String name = actualColumn.getEnumConstants().nameNullable(enum16Val);
169169
return (T) new EnumValue(name == null ? "<unknown>" : name, enum16Val);
170170
}
171171
case Date:

client-v2/src/test/java/com/clickhouse/client/query/QueryTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1418,7 +1418,7 @@ private List<Map<String, Object>> prepareDataSet(String table, List<String> colu
14181418

14191419
// Create table
14201420
CommandSettings settings = new CommandSettings();
1421-
if (isVersionMatch("[24.8,)")) {
1421+
if (isVersionMatch("[24.8,)") && !isCloud()) {
14221422
settings.serverSetting("allow_experimental_dynamic_type", "1")
14231423
.serverSetting("allow_experimental_json_type", "1");
14241424
}

jdbc-v2/src/test/java/com/clickhouse/jdbc/DataTypeTests.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -828,11 +828,13 @@ public void testDynamicTypesSimpleStatement() throws SQLException {
828828
}
829829

830830
Properties properties = new Properties();
831-
properties.setProperty(ClientConfigProperties.serverSetting("allow_experimental_dynamic_type"), "1");
832-
runQuery("CREATE TABLE test_dynamic (order Int8, "
831+
if (!isCloud()) {
832+
properties.setProperty(ClientConfigProperties.serverSetting("allow_experimental_dynamic_type"), "1");
833+
}
834+
assertTrue(runQuery("CREATE TABLE test_dynamic (order Int8, "
833835
+ "dynamic Dynamic"
834836
+ ") ENGINE = MergeTree ORDER BY ()",
835-
properties);
837+
properties), "Failed to create table");
836838

837839
// Insert random (valid) values
838840
long seed = System.currentTimeMillis();
@@ -944,7 +946,9 @@ public void testVariantTypesSimpleStatement() throws SQLException {
944946
}
945947

946948
Properties properties = new Properties();
947-
properties.setProperty(ClientConfigProperties.serverSetting("allow_experimental_variant_type"), "1");
949+
if (!isCloud()) {
950+
properties.setProperty(ClientConfigProperties.serverSetting("allow_experimental_variant_type"), "1");
951+
}
948952
runQuery("CREATE TABLE test_variant (order Int8, "
949953
+ "v Variant(String, Int32)"
950954
+ ") ENGINE = MergeTree ORDER BY ()",

0 commit comments

Comments
 (0)