@@ -826,9 +826,9 @@ public ResultSet getTableTypes() throws SQLException {
826826 }
827827 }
828828
829- private static final String DATA_TYPE_COL = "DATA_TYPE" ;
829+ private static final ClickHouseColumn DATA_TYPE_COL = ClickHouseColumn . of ( "DATA_TYPE" , ClickHouseDataType . Int32 . name ()) ;
830830 @ Override
831- @ SuppressWarnings ({"squid:S2077 " })
831+ @ SuppressWarnings ({"squid:S2095 " })
832832 public ResultSet getColumns (String catalog , String schemaPattern , String tableNamePattern , String columnNamePattern ) throws SQLException {
833833 //TODO: Best way to convert type to JDBC data type
834834 // TODO: handle useCatalogs == true and return schema catalog name
@@ -864,7 +864,7 @@ public ResultSet getColumns(String catalog, String schemaPattern, String tableNa
864864 " ORDER BY TABLE_SCHEM, TABLE_NAME, ORDINAL_POSITION" ;
865865 try {
866866 return new MetadataResultSet ((ResultSetImpl ) connection .createStatement ().executeQuery (sql ))
867- .transform (DATA_TYPE_COL , ClickHouseColumn . of ( DATA_TYPE_COL , ClickHouseDataType . Int32 . name ()) , DatabaseMetaData ::columnDataTypeToSqlType );
867+ .transform (DATA_TYPE_COL . getColumnName (), DATA_TYPE_COL , DatabaseMetaData ::columnDataTypeToSqlType );
868868 } catch (Exception e ) {
869869 throw ExceptionUtils .toSqlState (e );
870870 }
@@ -996,12 +996,14 @@ public ResultSet getCrossReference(String parentCatalog, String parentSchema, St
996996 }
997997 }
998998
999+ private static final ClickHouseColumn NULLABLE_COL = ClickHouseColumn .of ("NULLABLE" , ClickHouseDataType .Int32 .name ());
9991000 @ Override
1001+ @ SuppressWarnings ({"squid:S2095" })
10001002 public ResultSet getTypeInfo () throws SQLException {
10011003 try {
10021004 return new MetadataResultSet ((ResultSetImpl ) connection .createStatement ().executeQuery (DATA_TYPE_INFO_SQL ))
1003- .transform ("DATA_TYPE" , ClickHouseColumn . of ( "DATA_TYPE" , "Int32" ) , DatabaseMetaData ::dataTypeToSqlTypeInt )
1004- .transform ("NULLABLE" , ClickHouseColumn . of ( "NULLABLE" , "Int32" ) , DatabaseMetaData ::dataTypeNullability );
1005+ .transform (DATA_TYPE_COL . getColumnName (), DATA_TYPE_COL , DatabaseMetaData ::dataTypeToSqlTypeInt )
1006+ .transform (NULLABLE_COL . getColumnName (), NULLABLE_COL , DatabaseMetaData ::dataTypeNullability );
10051007 } catch (Exception e ) {
10061008 throw ExceptionUtils .toSqlState (e );
10071009 }
0 commit comments