Skip to content

Commit 6344ece

Browse files
committed
Merge branch 'main' into jdbc_database_metadata
2 parents 398ffde + e2cd51e commit 6344ece

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
@@ -631,7 +631,7 @@ public void testGetTypeInfo() throws Exception {
631631
assertEquals(rs.getShort("NULLABLE"), DatabaseMetaData.typeNoNulls);
632632
}
633633

634-
if (dataType != ClickHouseDataType.Enum) {
634+
if (dataType != ClickHouseDataType.Enum && dataType != ClickHouseDataType.Geometry) {
635635
assertEquals(rs.getBoolean("CASE_SENSITIVE"), dataType.isCaseSensitive());
636636
}
637637
assertEquals(rs.getInt("SEARCHABLE"), DatabaseMetaData.typeSearchable);
@@ -663,7 +663,11 @@ public void testFindNestedTypes() throws Exception {
663663
nestedTypes.remove(typeName);
664664
}
665665

666-
assertTrue(nestedTypes.isEmpty(), "Nested types " + nestedTypes + " not found");
666+
if (ClickHouseVersion.of(getServerVersion()).check("(,25.10]")) {
667+
assertEquals(nestedTypes, Arrays.asList("Geometry")); // Geometry was introduced in 25.11
668+
} else {
669+
assertEquals(nestedTypes, Arrays.asList("Object")); // Object is deprecated in 25.11
670+
}
667671
}
668672
}
669673
}

0 commit comments

Comments
 (0)