Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.10.0
-
None
-
None
Description
Decimal types require not just the type (Decimal9, Decimal18, etc.) but also a precision and scale. The triple of (minor type, precision, scale) appears in the MaterializedField for the nullable or required vectors.
A repeated vector has three parts: the RepeatedDecimal18Vector which is composed of a UInt4Vector offset vector and a Decimal18Vector that holds values.
When RepeatedDecimal18Vector creates the Decimal18Vector to hold the values, it clones the MaterializedField. But, it does not clone the scale and precision, resulting in the loss of critical information.
public RepeatedDecimal18Vector(MaterializedField field, BufferAllocator allocator) { super(field, allocator); addOrGetVector(VectorDescriptor.create(Types.required(field.getType().getMinorType()))); }
This is normally not a problem because most code access the data via the repeated vector. But, for code that needs to work with the values, the results are wrong given that the types are wrong. (Values stored with one scale, 123.45, (scale 2) will be retrieved with 0 scale (123, say).
Attachments
Issue Links
- is part of
-
DRILL-5688 Add repeated map support to column accessors
- Resolved