Skip to content

Commit 91a0239

Browse files
authored
Returned support of YDB composite types (#62)
2 parents 21dbf86 + d4c9c69 commit 91a0239

File tree

2 files changed

+197
-95
lines changed

2 files changed

+197
-95
lines changed

jdbc/src/main/java/tech/ydb/jdbc/impl/YdbTypes.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,20 +195,27 @@ public static int toSqlType(Type type) {
195195

196196
private int toSqlTypeImpl(Type type) {
197197
switch (type.getKind()) {
198+
case PRIMITIVE:
199+
if (!sqlTypeByPrimitiveNumId.containsKey(type)) {
200+
throw new RuntimeException("Internal error. Unsupported YDB type: " + type);
201+
}
202+
return sqlTypeByPrimitiveNumId.get(type);
198203
case OPTIONAL:
199204
return toSqlTypeImpl(type.unwrapOptional());
200205
case DECIMAL:
201206
return Types.DECIMAL;
207+
case STRUCT:
208+
return Types.STRUCT;
209+
case LIST:
210+
return Types.ARRAY;
202211
case NULL:
203212
case VOID:
204213
return Types.NULL;
205214
case PG_TYPE:
215+
case TUPLE:
216+
case DICT:
217+
case VARIANT:
206218
return Types.OTHER;
207-
case PRIMITIVE:
208-
if (!sqlTypeByPrimitiveNumId.containsKey(type)) {
209-
throw new RuntimeException("Internal error. Unsupported YDB type: " + type);
210-
}
211-
return sqlTypeByPrimitiveNumId.get(type);
212219
default:
213220
throw new RuntimeException("Internal error. Unsupported YDB kind: " + type);
214221
}

0 commit comments

Comments
 (0)