Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Duplicate
-
0.6.1
-
None
-
None
Description
Some JDBC drivers (Oracle is one of them) return NUMBER columns as BigDecimal. NiFi then turns that into a string in the Avro that is produced.
This happens in JdbcCommon when creating the schema:
case DECIMAL: case NUMERIC: builder.name(meta.getColumnName(i)).type().unionOf() .nullBuilder().endNull().and().stringType().endUnion().noDefault();
Then later when getting the value of the column to add to the Avro record:
} else if (value instanceof BigDecimal || value instanceof BigInteger) { rec.put(i - 1, value.toString()); }
It looks like Avro has support for Decimal types and we should look into using this:
https://avro.apache.org/docs/1.7.7/spec.html#Logical+Types
https://issues.apache.org/jira/browse/AVRO-1402
Attachments
Issue Links
- is duplicated by
-
NIFI-2624 JDBC-to-Avro processors handle BigDecimals as Strings
- Resolved