Incorrect parsing of complex types (Arrays and Tuples) #103
Closed
Description
Here are some cases that I've found (rs
is a ResultSet
instance):
-
Tuple:
select ('1', 2) as a;
can only be extracted as
String
:rs.getMetaData.getColumnTypeName(1) = "Tuple(String, UInt8)" rs.getObject(1) = "('1',2)"
-
Nested arrays:
select [[1,2], [3,4]] as a;
cannot be extracted as
Array
:rs.getMetaData.getColumnTypeName(1) = "Array(Array(UInt8))" rs.getObject(1) // Method threw 'java.lang.RuntimeException' exception. // Parse exception: ByteFragment{[[[1,2],[3,4]]], start=0, len=13} rs.getArray(1) // Method threw 'java.lang.IllegalStateException' exception.
-
Tuples nested in Array:
select [('a',1), ('b', 2)] as a;
strange parsing behavior when parsed as
Array
:rs.getMetaData.getColumnTypeName(1) = Array(Tuple(String, UInt8)) rs.getArray(1)={ru.yandex.clickhouse.ClickHouseArray}: array = {java.lang.String[4]@3644} 0 = "('a'" 1 = "1)" 2 = "('b'" 3 = "2)"