Ted-Jiang commented on code in PR #8930:
URL: https://github.com/apache/arrow-datafusion/pull/8930#discussion_r1462733142
##########
datafusion/core/src/datasource/physical_plan/parquet/row_groups.rs:
##########
@@ -209,16 +214,51 @@ impl PruningStatistics for BloomFilterStatistics {
let known_not_present = values
.iter()
- .map(|value| match value {
- ScalarValue::Utf8(Some(v)) => sbbf.check(&v.as_str()),
- ScalarValue::Boolean(Some(v)) => sbbf.check(v),
- ScalarValue::Float64(Some(v)) => sbbf.check(v),
- ScalarValue::Float32(Some(v)) => sbbf.check(v),
- ScalarValue::Int64(Some(v)) => sbbf.check(v),
- ScalarValue::Int32(Some(v)) => sbbf.check(v),
- ScalarValue::Int16(Some(v)) => sbbf.check(v),
- ScalarValue::Int8(Some(v)) => sbbf.check(v),
- _ => true,
+ .map(|value| {
+ match value {
+ ScalarValue::Utf8(Some(v)) => sbbf.check(&v.as_str()),
+ ScalarValue::Boolean(Some(v)) => sbbf.check(v),
+ ScalarValue::Float64(Some(v)) => sbbf.check(v),
+ ScalarValue::Float32(Some(v)) => sbbf.check(v),
+ ScalarValue::Int64(Some(v)) => sbbf.check(v),
+ ScalarValue::Int32(Some(v)) => sbbf.check(v),
+ ScalarValue::Int16(Some(v)) => sbbf.check(v),
+ ScalarValue::Int8(Some(v)) => sbbf.check(v),
+ ScalarValue::Decimal128(Some(v), p, s) => match
parquet_type {
+ Type::INT32 => {
+
//https://github.com/apache/parquet-format/blob/eb4b31c1d64a01088d02a2f9aefc6c17c54cc6fc/Encodings.md?plain=1#L35-L42
+ // All physical type are little-endian
+ let b = (*v as i32).to_le_bytes();
+ let decimal = Decimal::Int32 {
+ value: b,
+ precision: *p as i32,
+ scale: *s as i32,
+ };
+ sbbf.check(&decimal)
Review Comment:
file https://github.com/apache/arrow-rs/issues/5325 to look at the
bytes_order issue
##########
datafusion/core/tests/parquet/mod.rs:
##########
@@ -66,7 +66,9 @@ enum Scenario {
Int32Range,
Float64,
Decimal,
+ DecimalBloomFilter,
Review Comment:
add test
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]