Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,37 +65,42 @@ protected void initializeBlock(int columnCount, String[] replaceStringList, int

@Override
protected Object getColumnValue(int columnIndex, ColumnType type, String[] replaceStringList) throws SQLException {
switch (type.getType()) {
case TINYINT:
return resultSet.getObject(columnIndex + 1, Byte.class);
case SMALLINT:
return resultSet.getObject(columnIndex + 1, Short.class);
case INT:
return resultSet.getObject(columnIndex + 1, Integer.class);
case BIGINT:
return resultSet.getObject(columnIndex + 1, Long.class);
case FLOAT:
return resultSet.getObject(columnIndex + 1, Float.class);
case DOUBLE:
return resultSet.getObject(columnIndex + 1, Double.class);
case LARGEINT:
case DECIMALV2:
case DECIMAL32:
case DECIMAL64:
case DECIMAL128:
return resultSet.getObject(columnIndex + 1, BigDecimal.class);
case DATE:
case DATEV2:
return resultSet.getObject(columnIndex + 1, LocalDate.class);
case DATETIME:
case DATETIMEV2:
return resultSet.getObject(columnIndex + 1, LocalDateTime.class);
case CHAR:
case VARCHAR:
case STRING:
return resultSet.getObject(columnIndex + 1);
default:
throw new IllegalArgumentException("Unsupported column type: " + type.getType());
try {
switch (type.getType()) {
case TINYINT:
return resultSet.getObject(columnIndex + 1, Byte.class);
case SMALLINT:
return resultSet.getObject(columnIndex + 1, Short.class);
case INT:
return resultSet.getObject(columnIndex + 1, Integer.class);
case BIGINT:
return resultSet.getObject(columnIndex + 1, Long.class);
case FLOAT:
return resultSet.getObject(columnIndex + 1, Float.class);
case DOUBLE:
return resultSet.getObject(columnIndex + 1, Double.class);
case LARGEINT:
case DECIMALV2:
case DECIMAL32:
case DECIMAL64:
case DECIMAL128:
return resultSet.getObject(columnIndex + 1, BigDecimal.class);
case DATE:
case DATEV2:
return resultSet.getObject(columnIndex + 1, LocalDate.class);
case DATETIME:
case DATETIMEV2:
return resultSet.getObject(columnIndex + 1, LocalDateTime.class);
case CHAR:
case VARCHAR:
case STRING:
return resultSet.getObject(columnIndex + 1);
default:
throw new IllegalArgumentException("Unsupported column type: " + type.getType());
}
} catch (AbstractMethodError e) {
LOG.warn("Detected an outdated ojdbc driver. Please use ojdbc8 or above.", e);
throw new SQLException("Detected an outdated ojdbc driver. Please use ojdbc8 or above.");
}
}

Expand Down