From 91b3d662fd99ad099b3d1226a8ecb261a6db0ae0 Mon Sep 17 00:00:00 2001 From: Dongjoon Hyun Date: Mon, 8 Jan 2018 19:22:31 -0800 Subject: [PATCH] Address comments. --- .../execution/datasources/orc/OrcColumnarBatchReader.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sql/core/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnarBatchReader.java b/sql/core/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnarBatchReader.java index caffdbd7cacf5..744bf3fb5e71a 100644 --- a/sql/core/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnarBatchReader.java +++ b/sql/core/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnarBatchReader.java @@ -472,7 +472,7 @@ private void putNonNullFloats(int count, DoubleColumnVector fromColumn, Writable private void putNonNullDecimals(int count, DecimalColumnVector fromColumn, WritableColumnVector toColumn, DecimalType type) { DecimalColumnVector data = fromColumn; - if (type.precision() > Decimal.MAX_INT_DIGITS()) { + if (type.precision() > Decimal.MAX_LONG_DIGITS()) { WritableColumnVector arrayData = toColumn.getChildColumn(0); arrayData.reserve(count * 16); } @@ -590,6 +590,10 @@ private void putByteArrays(int count, BytesColumnVector fromColumn, WritableColu private void putDecimals(int count, DecimalColumnVector fromColumn, WritableColumnVector toColumn, DecimalType type) { HiveDecimalWritable[] vector = fromColumn.vector; + if (type.precision() > Decimal.MAX_LONG_DIGITS()) { + WritableColumnVector arrayData = toColumn.getChildColumn(0); + arrayData.reserve(count * 16); + } for (int index = 0; index < count; index++) { if (fromColumn.isNull[index]) { toColumn.putNull(index);