@Test public void testVariableScaleDecimal() { final BigDecimal testValue = new BigDecimal("138.456"); final Struct struct = VariableScaleDecimal.fromLogical(VariableScaleDecimal.schema(), new SpecialValueDecimal(testValue)); final BigDecimal decodedValue = VariableScaleDecimal.toLogical(struct).getDecimalValue().get(); assertEquals("Number should be same after serde", testValue, decodedValue); } }
@Test public void testVariableScaleDecimal() { final BigDecimal testValue = new BigDecimal("138.456"); final Struct struct = VariableScaleDecimal.fromLogical(VariableScaleDecimal.schema(), new SpecialValueDecimal(testValue)); final BigDecimal decodedValue = VariableScaleDecimal.toLogical(struct).getDecimalValue().get(); assertEquals("Number should be same after serde", testValue, decodedValue); } }