shardulm94 commented on a change in pull request #1271:
URL: https://github.com/apache/iceberg/pull/1271#discussion_r465199882
##########
File path:
spark/src/main/java/org/apache/iceberg/spark/data/SparkOrcValueReaders.java
##########
@@ -195,7 +196,12 @@ public Long nonNullRead(ColumnVector vector, int row) {
@Override
public Decimal nonNullRead(ColumnVector vector, int row) {
HiveDecimalWritable value = ((DecimalColumnVector) vector).vector[row];
- return new Decimal().set(value.serialize64(value.scale()),
value.precision(), value.scale());
+ BigDecimal decimal = new
BigDecimal(BigInteger.valueOf(value.serialize64(value.scale())), value.scale());
Review comment:
I believe `value.serialize64` returns the raw long value adjusted for
the requested scale (and since precision <= 18, it always fits in long), I
don't think it is tied to any precision. That being said, I am not very
familiar with using decimals, so maybe I am missing something. Can you give an
example of the case you are referring to?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]