File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
main/java/com/clickhouse/jdbc/metadata
test/java/com/clickhouse/jdbc/metadata Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -179,7 +179,11 @@ public boolean isDefinitelyWritable(int column) throws SQLException {
179179 @ Override
180180 public String getColumnClassName (int column ) throws SQLException {
181181 try {
182- return typeClassMap .getOrDefault (getColumn (column ).getDataType (), Object .class ).getName ();
182+ Class <?> columnClassType = typeClassMap .get (getColumn (column ).getDataType ());
183+ if (columnClassType == null ) {
184+ columnClassType = Object .class ;
185+ }
186+ return columnClassType .getName ();
183187 } catch (Exception e ) {
184188 throw ExceptionUtils .toSqlState (e );
185189 }
Original file line number Diff line number Diff line change @@ -77,6 +77,18 @@ public void testGetColumnTypeIntegers() throws Exception {
7777 }
7878 }
7979
80+ @ Test
81+ public void testGetColumnTypeMap () throws Exception {
82+ try (Connection conn = getJdbcConnection ()) {
83+ try (Statement stmt = conn .createStatement ()) {
84+ ResultSet rs = stmt .executeQuery ("select map('a', 1) as a" );
85+ ResultSetMetaData rsmd = rs .getMetaData ();
86+ assertEquals (rsmd .getColumnType (1 ), Types .JAVA_OBJECT );
87+ assertEquals (rsmd .getColumnClassName (1 ), Object .class .getName ());
88+ }
89+ }
90+ }
91+
8092 @ Test (groups = { "integration" })
8193 public void testGetColumnTypeFloats () throws Exception {
8294 try (Connection conn = getJdbcConnection ()) {
You can’t perform that action at this time.
0 commit comments