diff --git a/sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/ParquetVectorUpdaterFactory.java b/sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/ParquetVectorUpdaterFactory.java index bfc6e836a088b..3863818b02556 100644 --- a/sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/ParquetVectorUpdaterFactory.java +++ b/sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/ParquetVectorUpdaterFactory.java @@ -1404,7 +1404,8 @@ private static class IntegerToDecimalUpdater extends DecimalUpdater { IntegerToDecimalUpdater(ColumnDescriptor descriptor, DecimalType sparkType) { super(sparkType); - LogicalTypeAnnotation typeAnnotation = descriptor.getPrimitiveType().getLogicalTypeAnnotation(); + LogicalTypeAnnotation typeAnnotation = + descriptor.getPrimitiveType().getLogicalTypeAnnotation(); this.parquetScale = ((DecimalLogicalTypeAnnotation) typeAnnotation).getScale(); } @@ -1428,7 +1429,8 @@ public void decodeSingleDictionaryId( WritableColumnVector values, WritableColumnVector dictionaryIds, Dictionary dictionary) { - BigDecimal decimal = BigDecimal.valueOf(dictionary.decodeToInt(dictionaryIds.getDictId(offset)), parquetScale); + BigDecimal decimal = + BigDecimal.valueOf(dictionary.decodeToInt(dictionaryIds.getDictId(offset)), parquetScale); writeDecimal(offset, values, decimal); } } @@ -1438,7 +1440,8 @@ private static class LongToDecimalUpdater extends DecimalUpdater { LongToDecimalUpdater(ColumnDescriptor descriptor, DecimalType sparkType) { super(sparkType); - LogicalTypeAnnotation typeAnnotation = descriptor.getPrimitiveType().getLogicalTypeAnnotation(); + LogicalTypeAnnotation typeAnnotation = + descriptor.getPrimitiveType().getLogicalTypeAnnotation(); this.parquetScale = ((DecimalLogicalTypeAnnotation) typeAnnotation).getScale(); } @@ -1462,7 +1465,8 @@ public void decodeSingleDictionaryId( WritableColumnVector values, WritableColumnVector dictionaryIds, Dictionary dictionary) { - BigDecimal decimal = BigDecimal.valueOf(dictionary.decodeToLong(dictionaryIds.getDictId(offset)), parquetScale); + BigDecimal decimal = + BigDecimal.valueOf(dictionary.decodeToLong(dictionaryIds.getDictId(offset)), parquetScale); writeDecimal(offset, values, decimal); } } @@ -1472,7 +1476,8 @@ private static class BinaryToDecimalUpdater extends DecimalUpdater { BinaryToDecimalUpdater(ColumnDescriptor descriptor, DecimalType sparkType) { super(sparkType); - LogicalTypeAnnotation typeAnnotation = descriptor.getPrimitiveType().getLogicalTypeAnnotation(); + LogicalTypeAnnotation typeAnnotation = + descriptor.getPrimitiveType().getLogicalTypeAnnotation(); this.parquetScale = ((DecimalLogicalTypeAnnotation) typeAnnotation).getScale(); } @@ -1498,7 +1503,8 @@ public void decodeSingleDictionaryId( WritableColumnVector values, WritableColumnVector dictionaryIds, Dictionary dictionary) { - BigInteger value = new BigInteger(dictionary.decodeToBinary(dictionaryIds.getDictId(offset)).getBytes()); + BigInteger value = + new BigInteger(dictionary.decodeToBinary(dictionaryIds.getDictId(offset)).getBytes()); BigDecimal decimal = new BigDecimal(value, parquetScale); writeDecimal(offset, values, decimal); } @@ -1510,7 +1516,8 @@ private static class FixedLenByteArrayToDecimalUpdater extends DecimalUpdater { FixedLenByteArrayToDecimalUpdater(ColumnDescriptor descriptor, DecimalType sparkType) { super(sparkType); - LogicalTypeAnnotation typeAnnotation = descriptor.getPrimitiveType().getLogicalTypeAnnotation(); + LogicalTypeAnnotation typeAnnotation = + descriptor.getPrimitiveType().getLogicalTypeAnnotation(); this.parquetScale = ((DecimalLogicalTypeAnnotation) typeAnnotation).getScale(); this.arrayLen = descriptor.getPrimitiveType().getTypeLength(); } @@ -1536,7 +1543,8 @@ public void decodeSingleDictionaryId( WritableColumnVector values, WritableColumnVector dictionaryIds, Dictionary dictionary) { - BigInteger value = new BigInteger(dictionary.decodeToBinary(dictionaryIds.getDictId(offset)).getBytes()); + BigInteger value = + new BigInteger(dictionary.decodeToBinary(dictionaryIds.getDictId(offset)).getBytes()); BigDecimal decimal = new BigDecimal(value, this.parquetScale); writeDecimal(offset, values, decimal); } diff --git a/sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedColumnReader.java b/sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedColumnReader.java index 9cb41f5aa3541..6479644968ed8 100644 --- a/sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedColumnReader.java +++ b/sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedColumnReader.java @@ -188,7 +188,8 @@ private boolean isLazyDecodingSupported( * with different scale. */ private boolean needsDecimalScaleRebase(DataType sparkType) { - LogicalTypeAnnotation typeAnnotation = descriptor.getPrimitiveType().getLogicalTypeAnnotation(); + LogicalTypeAnnotation typeAnnotation = + descriptor.getPrimitiveType().getLogicalTypeAnnotation(); if (!(typeAnnotation instanceof DecimalLogicalTypeAnnotation)) return false; if (!(sparkType instanceof DecimalType)) return false; DecimalLogicalTypeAnnotation parquetDecimal = (DecimalLogicalTypeAnnotation) typeAnnotation;