Skip to content

Commit

Permalink
Changed Decimal Type Mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
Bajram Bojku committed Sep 3, 2020
1 parent cd931a9 commit adc9696
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ private void handleOracleSpecificType(ResultSet resultSet, StructuredRecord.Buil
// This is the only way to differentiate FLOAT/REAL columns from other numeric columns, that based on NUMBER.
// Since FLOAT is a subtype of the NUMBER data type, 'getColumnType' and 'getColumnTypeName' can not be used.
if (Double.class.getTypeName().equals(resultSet.getMetaData().getColumnClassName(columnIndex))) {
recordBuilder.set(field.getName(), resultSet.getDouble(columnIndex));
recordBuilder.setDecimal(field.getName(), BigDecimal.valueOf(resultSet.getDouble(columnIndex)));
} else {
// It's required to pass 'scale' parameter since in the case of Oracle, scale of 'BigDecimal' depends on the
// scale of actual value. For example for value '77.12' scale will be '2' even if sql scale is '6'
Expand Down

0 comments on commit adc9696

Please sign in to comment.