|
13 | 13 | import com.clickhouse.client.api.metadata.TableSchema; |
14 | 14 | import com.clickhouse.client.api.query.GenericRecord; |
15 | 15 | import com.clickhouse.data.ClickHouseDataType; |
| 16 | +import com.clickhouse.data.ClickHouseVersion; |
16 | 17 | import lombok.AllArgsConstructor; |
17 | 18 | import lombok.Data; |
18 | 19 | import lombok.NoArgsConstructor; |
@@ -143,6 +144,10 @@ public static String tblCreateSQL(String table) { |
143 | 144 |
|
144 | 145 | @Test(groups = {"integration"}) |
145 | 146 | public void testVariantWithSimpleDataTypes() throws Exception { |
| 147 | + if (isVersionMatch("(,24.8]")) { |
| 148 | + return; |
| 149 | + } |
| 150 | + |
146 | 151 | final String table = "test_variant_primitives"; |
147 | 152 | final DataTypesTestingPOJO sample = new DataTypesTestingPOJO(); |
148 | 153 |
|
@@ -384,6 +389,10 @@ public void testVariantWithTuple() throws Exception { |
384 | 389 | } |
385 | 390 |
|
386 | 391 | private void testVariantWith(String withWhat, String[] fields, Object[] values, String[] expectedStrValues) throws Exception { |
| 392 | + if (isVersionMatch("(,24.8]")) { |
| 393 | + return; |
| 394 | + } |
| 395 | + |
387 | 396 | String table = "test_variant_with_" + withWhat; |
388 | 397 | String[] actualFields = new String[fields.length + 1]; |
389 | 398 | actualFields[0] = "rowId Int32"; |
@@ -417,4 +426,8 @@ public static String tableDefinition(String table, String... columns) { |
417 | 426 | return sb.toString(); |
418 | 427 | } |
419 | 428 |
|
| 429 | + public boolean isVersionMatch(String versionExpression) { |
| 430 | + List<GenericRecord> serverVersion = client.queryAll("SELECT version()"); |
| 431 | + return ClickHouseVersion.of(serverVersion.get(0).getString(1)).check(versionExpression); |
| 432 | + } |
420 | 433 | } |
0 commit comments