apache / orc

Apache ORC - the smallest, fastest columnar storage for Hadoop workloads
https://orc.apache.org/
Apache License 2.0
678 stars 481 forks source link

ORC-1588: Fix incorrect `Decimal` assert in `LeafFilterFactory` #1752

Closed cxzl25 closed 8 months ago

cxzl25 commented 8 months ago

What changes were proposed in this pull request?

This PR aims to fix incorrect Decimal assert in LeafFilterFactory.

Why are the changes needed?

Due to the wrong assertion, ArrayIndexOutOfBoundsException happens.

Caused by: java.lang.ArrayIndexOutOfBoundsException: Index -2 out of bounds for length 19
    at org.apache.hadoop.hive.common.type.FastHiveDecimalImpl.fastSerialize64(FastHiveDecimalImpl.java:2205)
    at org.apache.hadoop.hive.common.type.FastHiveDecimal.fastSerialize64(FastHiveDecimal.java:290)
    at org.apache.hadoop.hive.serde2.io.HiveDecimalWritable.serialize64(HiveDecimalWritable.java:537)
    at org.apache.orc.impl.filter.leaf.LeafFilterFactory.createBetweenFilter(LeafFilterFactory.java:165)

How was this patch tested?

UT & GA

Was this patch authored or co-authored using generative AI tooling?

No

dongjoon-hyun commented 8 months ago

Thank you, @cxzl25 . Merged to main/2.0.