Skip to content

Commit e3d3dda

Browse files
committed
enabled experimental type for cloud. made diagnostic socket to close
1 parent b7c0e9e commit e3d3dda

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

clickhouse-http-client/src/main/java/com/clickhouse/client/http/ApacheHttpConnectionImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,7 @@ static class HttpConnectionManager extends PoolingHttpClientConnectionManager {
433433
USER_AGENT = ClickHouseClientOption.buildUserAgent(null,
434434
versionInfo != null && !versionInfo.isEmpty() ? versionInfo : PROVIDER);
435435

436-
try {
437-
Socket s = new Socket();
436+
try (Socket s = new Socket()) {
438437
int defaultSoRcvBuf = s.getReceiveBufferSize();
439438
int defaultSoSndBuf = s.getSendBufferSize();
440439
s.setReceiveBufferSize(Integer.MAX_VALUE);
@@ -446,6 +445,7 @@ static class HttpConnectionManager extends PoolingHttpClientConnectionManager {
446445
defaultSoRcvBuf, defaultSoSndBuf, maxSoRcvBuf, maxSoSndBuf);
447446
} catch (Exception e) { // NOSONAR
448447
// ignore
448+
log.warn("Failed to get default socket buffer size", e);
449449
}
450450
}
451451

client-v2/src/test/java/com/clickhouse/client/datatypes/DataTypeTests.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public static String tblCreateSQL(String table) {
142142

143143
@Test(groups = {"integration"})
144144
public void testVariantWithSimpleDataTypes() throws Exception {
145-
if (isVersionMatch("(,24.8]") || isCloud()) {
145+
if (isVersionMatch("(,24.8]")) {
146146
return;
147147
}
148148

@@ -183,7 +183,7 @@ public void testVariantWithSimpleDataTypes() throws Exception {
183183
continue dataTypesLoop;
184184

185185
}
186-
b.append(")) Engine = MergeTree ORDER BY () SETTINGS enable_variant_type=1");
186+
b.append(")) Engine = MergeTree ORDER BY () SETTINGS allow_experimental_variant_type=1");
187187

188188
client.execute(b.toString());
189189
client.register(DTOForVariantPrimitivesTests.class, client.getTableSchema(table));
@@ -396,7 +396,7 @@ public void testVariantWithTuple() throws Exception {
396396

397397
@Test(groups = {"integration"})
398398
public void testDynamicWithPrimitives() throws Exception {
399-
if (isVersionMatch("(,24.8]") || isCloud()) {
399+
if (isVersionMatch("(,24.8]")) {
400400
return;
401401
}
402402

@@ -588,14 +588,14 @@ public static class DTOForDynamicPrimitivesTests {
588588
}
589589

590590
private void testDynamicWith(String withWhat, Object[] values, String[] expectedStrValues) throws Exception {
591-
if (isVersionMatch("(,24.8]") || isCloud()) {
591+
if (isVersionMatch("(,24.8]")) {
592592
return;
593593
}
594594

595595
String table = "test_dynamic_with_" + withWhat;
596596
client.execute("DROP TABLE IF EXISTS " + table).get();
597597
client.execute(tableDefinition(table, "rowId Int32", "field Dynamic"),
598-
(CommandSettings) new CommandSettings().serverSetting("enable_dynamic_type", "1")).get();
598+
(CommandSettings) new CommandSettings().serverSetting("allow_experimental_dynamic_type", "1")).get();
599599

600600
client.register(DTOForDynamicPrimitivesTests.class, client.getTableSchema(table));
601601

@@ -612,7 +612,7 @@ private void testDynamicWith(String withWhat, Object[] values, String[] expected
612612
}
613613

614614
private void testVariantWith(String withWhat, String[] fields, Object[] values, String[] expectedStrValues) throws Exception {
615-
if (isVersionMatch("(,24.8]") || isCloud()) {
615+
if (isVersionMatch("(,24.8]")) {
616616
return;
617617
}
618618

@@ -621,7 +621,7 @@ private void testVariantWith(String withWhat, String[] fields, Object[] values,
621621
actualFields[0] = "rowId Int32";
622622
System.arraycopy(fields, 0, actualFields, 1, fields.length);
623623
client.execute("DROP TABLE IF EXISTS " + table).get();
624-
client.execute(tableDefinition(table, actualFields), (CommandSettings) new CommandSettings().serverSetting("enable_variant_type", "1")).get();
624+
client.execute(tableDefinition(table, actualFields), (CommandSettings) new CommandSettings().serverSetting("allow_experimental_variant_type", "1")).get();
625625

626626
client.register(DTOForVariantPrimitivesTests.class, client.getTableSchema(table));
627627

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,8 +1418,9 @@ 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,)") && !isCloud()) {
1422-
settings.serverSetting("allow_experimental_dynamic_type", "1")
1421+
if (isVersionMatch("[24.8,)")) {
1422+
settings.serverSetting("allow_experimental_variant_type", "1")
1423+
.serverSetting("allow_experimental_dynamic_type", "1")
14231424
.serverSetting("allow_experimental_json_type", "1");
14241425
}
14251426
StringBuilder createStmtBuilder = new StringBuilder();

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ public void testGeometricTypesSimpleStatement() throws SQLException {
823823

824824
@Test(groups = { "integration" })
825825
public void testDynamicTypesSimpleStatement() throws SQLException {
826-
if (earlierThan(24, 8) || isCloud()) {
826+
if (earlierThan(24, 8)) {
827827
return;
828828
}
829829

@@ -941,7 +941,7 @@ public void testTypeConversions() throws Exception {
941941

942942
@Test(groups = { "integration" })
943943
public void testVariantTypesSimpleStatement() throws SQLException {
944-
if (earlierThan(24, 8) || isCloud()) {
944+
if (earlierThan(24, 8)) {
945945
return;
946946
}
947947

0 commit comments

Comments
 (0)