Skip to content

Commit e2cd51e

Browse files
authored
Merge pull request #2679 from ClickHouse/fix_head_tests_dec_03
Fix tests for new data type Geometry. issue is created and planned
2 parents f9f588d + d63e1ce commit e2cd51e

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

clickhouse-data/src/main/java/com/clickhouse/data/ClickHouseDataType.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,12 @@ public enum ClickHouseDataType implements SQLType {
106106
Ring(Object.class, false, true, true, 0, 0, 0, 0, 0, true), // same as Array(Point)
107107
LineString( Object.class, false, true, true, 0, 0, 0, 0, 0, true), // same as Array(Point)
108108
MultiLineString(Object.class, false, true, true, 0, 0, 0, 0, 0, true), // same as Array(Ring)
109-
110109
JSON(Object.class, false, false, false, 0, 0, 0, 0, 0, true, 0x30),
111-
@Deprecated
110+
@Deprecated // (since = "CH 25.11")
112111
Object(Object.class, true, true, false, 0, 0, 0, 0, 0, true),
113112
String(String.class, false, true, false, 0, 0, 0, 0, 0, false, 0x15, "BINARY LARGE OBJECT", "BINARY VARYING", "BLOB",
114113
"BYTEA", "CHAR", "CHAR LARGE OBJECT", "CHAR VARYING", "CHARACTER", "CHARACTER LARGE OBJECT",
115-
"CHARACTER VARYING", "CLOB", "GEOMETRY", "LONGBLOB", "LONGTEXT", "MEDIUMBLOB", "MEDIUMTEXT",
114+
"CHARACTER VARYING", "CLOB", "LONGBLOB", "LONGTEXT", "MEDIUMBLOB", "MEDIUMTEXT",
116115
"NATIONAL CHAR", "NATIONAL CHAR VARYING", "NATIONAL CHARACTER", "NATIONAL CHARACTER LARGE OBJECT",
117116
"NATIONAL CHARACTER VARYING", "NCHAR", "NCHAR LARGE OBJECT", "NCHAR VARYING", "NVARCHAR", "TEXT",
118117
"TINYBLOB", "TINYTEXT", "VARBINARY", "VARCHAR", "VARCHAR2"),
@@ -131,6 +130,7 @@ public enum ClickHouseDataType implements SQLType {
131130
Time(LocalDateTime.class, true, false, false, 4, 9, 0, 0, 9, false, 0x32), // 0x33 for Time(Timezone)
132131
Time64(LocalDateTime.class, true, false, false, 8, 9, 0, 0, 0, false, 0x34), // 0x35 for Time64(P, Timezone)
133132
QBit(Double.class, true, true, false, 0, 0, 0, 0, 0, false, 0x36),
133+
Geometry(Object.class, false, false, false, 0, 0, 0, 0, 0, true),
134134
;
135135

136136
public static final List<ClickHouseDataType> ORDERED_BY_RANGE_INT_TYPES =

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ public void testVariantWithSimpleDataTypes() throws Exception {
172172
switch (dataType) {
173173
case BFloat16:
174174
case QBit:
175+
case Geometry:
175176
// TODO: add support
176177
continue dataTypesLoop;
177178
// skipped
@@ -466,6 +467,7 @@ public void testDynamicWithPrimitives() throws Exception {
466467
switch (dataType) {
467468
case BFloat16:
468469
case QBit:
470+
case Geometry:
469471
// TODO: add support
470472
continue;
471473
case Array:

jdbc-v2/src/test/java/com/clickhouse/jdbc/metadata/DatabaseMetaDataTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ public void testGetTypeInfo() throws Exception {
446446
assertEquals(rs.getShort("NULLABLE"), DatabaseMetaData.typeNoNulls);
447447
}
448448

449-
if (dataType != ClickHouseDataType.Enum) {
449+
if (dataType != ClickHouseDataType.Enum && dataType != ClickHouseDataType.Geometry) {
450450
assertEquals(rs.getBoolean("CASE_SENSITIVE"), dataType.isCaseSensitive());
451451
}
452452
assertEquals(rs.getInt("SEARCHABLE"), DatabaseMetaData.typeSearchable);
@@ -478,7 +478,11 @@ public void testFindNestedTypes() throws Exception {
478478
nestedTypes.remove(typeName);
479479
}
480480

481-
assertTrue(nestedTypes.isEmpty(), "Nested types " + nestedTypes + " not found");
481+
if (ClickHouseVersion.of(getServerVersion()).check("(,25.10]")) {
482+
assertEquals(nestedTypes, Arrays.asList("Geometry")); // Geometry was introduced in 25.11
483+
} else {
484+
assertEquals(nestedTypes, Arrays.asList("Object")); // Object is deprecated in 25.11
485+
}
482486
}
483487
}
484488
}

0 commit comments

Comments
 (0)