Details
-
Improvement
-
Status: Patch Available
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
I'm building a custom RecordReader to import financial data from extracts in a custom file format. Everything works except when converting from Avro Schema to RecordSchema, the decimal information is silently converted to double causing the reader to interpret the transaction values as doubles.
It would be nice if we had native support for Decimals as now I have to read the values as string and then run a spark job to convert them to doubles.
My suggestion would be:
- Add a RecordFieldType.DECIMAL value
- Add a DecimalDataType class that has `getPrecision()` and `getScale()` getters
- Add a `RecordFieldType.getDecimalDataType(precision, scale)` method to create an instance of the RecordFieldType.DECIMAL value