Skip to content

Commit

Permalink
fix build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
advancedxy committed Mar 9, 2024
1 parent dbddcd3 commit ea80c97
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ use arrow_schema::DataType;
use datafusion::{common::Result, physical_plan::ColumnarValue};
use datafusion_common::{internal_err, DataFusionError, Result as DataFusionResult, ScalarValue};
use datafusion_physical_expr::{aggregate::utils::down_cast_any_ref, PhysicalExpr};
use log::info;
use once_cell::sync::OnceCell;
use std::{
any::Any,
Expand Down Expand Up @@ -99,7 +98,6 @@ impl PhysicalExpr for BloomFilterMightContain {
);
}
ColumnarValue::Scalar(ScalarValue::Binary(v)) => {
info!("init for bloom filter");
let filter = v.map(|v| SparkBloomFilter::new_from_buf(v.as_bytes()));
self.bloom_filter.get_or_init(|| filter);
}
Expand All @@ -112,9 +110,9 @@ impl PhysicalExpr for BloomFilterMightContain {
let lazy_filter = self.bloom_filter.get().unwrap();
if lazy_filter.is_none() {
// when the bloom filter is null, we should return a boolean array with all nulls
return Ok(ColumnarValue::Array(Arc::new(BooleanArray::new_null(
Ok(ColumnarValue::Array(Arc::new(BooleanArray::new_null(
num_rows,
))));
))))
} else {
let spark_filter = lazy_filter.as_ref().unwrap();
let values = self.value_expr.evaluate(batch)?;
Expand All @@ -134,9 +132,9 @@ impl PhysicalExpr for BloomFilterMightContain {
Ok(ColumnarValue::Scalar(ScalarValue::Boolean(result)))
}
_ => {
return internal_err!(
internal_err!(
"value_expr must be evaluated as an int64 array or a int64 scalar"
);
)
}
},
}
Expand Down
7 changes: 1 addition & 6 deletions core/src/execution/datafusion/util/spark_bloom_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,7 @@ impl SparkBloomFilter {
pub fn might_contain_longs(&self, items: &Int64Array) -> CometResult<BooleanArray> {
Ok(items
.iter()
.map(|v| {
v.and_then(|v| {
let might_contain = self.might_contain_long(v);
Some(might_contain)
})
})
.map(|v| v.map(|x| self.might_contain_long(x)))
.collect())
}
}

0 comments on commit ea80c97

Please sign in to comment.