@Override protected Slice readValue(DecimalInputStream valueStream) throws IOException { Slice decimal = unscaledDecimal(); valueStream.nextLongDecimal(decimal); return decimal; } }
private static void assertReadsLongValue(BigInteger value) throws IOException { DecimalInputStream stream = new DecimalInputStream(decimalInputStream(value)); Slice decimal = unscaledDecimal(); stream.nextLongDecimal(decimal); assertEquals(unscaledDecimalToBigInteger(decimal), value); }
private static void assertLongValueReadFails(BigInteger value) { Slice decimal = unscaledDecimal(); assertThrows(OrcCorruptionException.class, () -> { DecimalInputStream stream = new DecimalInputStream(decimalInputStream(value)); stream.nextLongDecimal(decimal); }); }
Slice rescaledDecimal = UnscaledDecimal128Arithmetic.unscaledDecimal(); decimalStream.nextLongDecimal(decimal); rescale(decimal, (int) (decimalType.getScale() - sourceScale), rescaledDecimal); decimalType.writeSlice(builder, rescaledDecimal); Slice rescaledDecimal = UnscaledDecimal128Arithmetic.unscaledDecimal(); decimalStream.nextLongDecimal(decimal); rescale(decimal, (int) (decimalType.getScale() - sourceScale), rescaledDecimal); decimalType.writeSlice(builder, rescaledDecimal);
@Override protected Slice readValue(DecimalInputStream valueStream) throws IOException { Slice decimal = unscaledDecimal(); valueStream.nextLongDecimal(decimal); return decimal; } }
private static void assertReadsLongValue(BigInteger value) throws IOException { DecimalInputStream stream = new DecimalInputStream(decimalInputStream(value)); Slice decimal = unscaledDecimal(); stream.nextLongDecimal(decimal); assertEquals(unscaledDecimalToBigInteger(decimal), value); }
private static void assertLongValueReadFails(BigInteger value) { Slice decimal = unscaledDecimal(); assertThrows(OrcCorruptionException.class, () -> { DecimalInputStream stream = new DecimalInputStream(decimalInputStream(value)); stream.nextLongDecimal(decimal); }); }
Slice rescaledDecimal = UnscaledDecimal128Arithmetic.unscaledDecimal(); decimalStream.nextLongDecimal(decimal); rescale(decimal, (int) (decimalType.getScale() - sourceScale), rescaledDecimal); decimalType.writeSlice(builder, rescaledDecimal); Slice rescaledDecimal = UnscaledDecimal128Arithmetic.unscaledDecimal(); decimalStream.nextLongDecimal(decimal); rescale(decimal, (int) (decimalType.getScale() - sourceScale), rescaledDecimal); decimalType.writeSlice(builder, rescaledDecimal);