From adc969648f076ee6eefad96dd6a7f7e621012d80 Mon Sep 17 00:00:00 2001 From: Bajram Bojku Date: Thu, 3 Sep 2020 11:36:46 -0500 Subject: [PATCH] Changed Decimal Type Mapping --- .../main/java/io/cdap/plugin/oracle/OracleSourceDBRecord.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oracle-plugin/src/main/java/io/cdap/plugin/oracle/OracleSourceDBRecord.java b/oracle-plugin/src/main/java/io/cdap/plugin/oracle/OracleSourceDBRecord.java index 11382b137..6afb5d41c 100644 --- a/oracle-plugin/src/main/java/io/cdap/plugin/oracle/OracleSourceDBRecord.java +++ b/oracle-plugin/src/main/java/io/cdap/plugin/oracle/OracleSourceDBRecord.java @@ -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'