diff --git a/src/query/expression/src/utils/arrow.rs b/src/query/expression/src/utils/arrow.rs index 57c1ef658360b..e0f3d9ccbb942 100644 --- a/src/query/expression/src/utils/arrow.rs +++ b/src/query/expression/src/utils/arrow.rs @@ -113,7 +113,7 @@ pub fn combine_validities(lhs: Option<&Bitmap>, rhs: Option<&Bitmap>) -> Option< } } -pub fn combine_validities_2(lhs: Option, rhs: Option) -> Option { +pub fn and_validities(lhs: Option, rhs: Option) -> Option { match (lhs, rhs) { (Some(lhs), None) => Some(lhs), (None, Some(rhs)) => Some(rhs), @@ -122,7 +122,7 @@ pub fn combine_validities_2(lhs: Option, rhs: Option) -> Option< } } -pub fn combine_validities_3(lhs: Option, rhs: Option) -> Option { +pub fn or_validities(lhs: Option, rhs: Option) -> Option { match (lhs, rhs) { (Some(lhs), None) => Some(lhs), (None, Some(rhs)) => Some(rhs), diff --git a/src/query/service/src/pipelines/processors/transforms/hash_join/common.rs b/src/query/service/src/pipelines/processors/transforms/hash_join/common.rs index 9111084cc1852..b0f838e877780 100644 --- a/src/query/service/src/pipelines/processors/transforms/hash_join/common.rs +++ b/src/query/service/src/pipelines/processors/transforms/hash_join/common.rs @@ -17,8 +17,8 @@ use common_arrow::arrow::bitmap::MutableBitmap; use common_catalog::table_context::TableContext; use common_exception::ErrorCode; use common_exception::Result; -use common_expression::arrow::combine_validities_3; use common_expression::arrow::constant_bitmap; +use common_expression::arrow::or_validities; use common_expression::types::nullable::NullableColumn; use common_expression::types::AnyType; use common_expression::types::DataType; @@ -116,7 +116,7 @@ impl JoinHashTable { valids = Some(m.into()); break; } else { - valids = combine_validities_3(valids, Some(bitmap.clone())); + valids = or_validities(valids, Some(bitmap.clone())); } } Column::Null { .. } => {} diff --git a/src/query/service/src/pipelines/processors/transforms/hash_join/join_hash_table.rs b/src/query/service/src/pipelines/processors/transforms/hash_join/join_hash_table.rs index 7c0c60f2aef8b..f0c31b1d92758 100644 --- a/src/query/service/src/pipelines/processors/transforms/hash_join/join_hash_table.rs +++ b/src/query/service/src/pipelines/processors/transforms/hash_join/join_hash_table.rs @@ -21,7 +21,7 @@ use common_arrow::arrow::bitmap::MutableBitmap; use common_base::base::tokio::sync::Notify; use common_exception::ErrorCode; use common_exception::Result; -use common_expression::arrow::combine_validities_2; +use common_expression::arrow::and_validities; use common_expression::DataBlock; use common_expression::DataSchemaRef; use common_expression::Evaluator; @@ -274,7 +274,7 @@ impl JoinHashTable { valids = Some(m.into()); break; } else { - valids = combine_validities_2(valids, tmp_valids.cloned()); + valids = and_validities(valids, tmp_valids.cloned()); } } probe_state.valids = valids; diff --git a/src/query/storages/common/index/src/range_filter.rs b/src/query/storages/common/index/src/range_filter.rs index 1dcd46c5f8cb1..2162db00f38db 100644 --- a/src/query/storages/common/index/src/range_filter.rs +++ b/src/query/storages/common/index/src/range_filter.rs @@ -58,16 +58,7 @@ impl RangeFilter { }) .unwrap(); - Ok(Self { - schema, - expr: conjunction, - func_ctx: ctx.try_get_function_context()?, - }) - } - - pub fn try_eval_const(&self) -> Result { - let input_domains = self - .expr + let input_domains = conjunction .column_refs() .into_iter() .map(|(name, ty)| { @@ -76,11 +67,20 @@ impl RangeFilter { }) .collect::>()?; - let folder = ConstantFolder::new(input_domains, self.func_ctx, &BUILTIN_FUNCTIONS); - let (new_expr, _) = folder.fold(&self.expr); + let func_ctx = ctx.try_get_function_context()?; + let folder = ConstantFolder::new(input_domains, func_ctx, &BUILTIN_FUNCTIONS); + let (new_expr, _) = folder.fold(&conjunction); + + Ok(Self { + schema, + expr: new_expr, + func_ctx, + }) + } + pub fn try_eval_const(&self) -> Result { // Only return false, which means to skip this block, when the expression is folded to a constant false. - Ok(!matches!(new_expr, Expr::Constant { + Ok(!matches!(self.expr, Expr::Constant { scalar: Scalar::Boolean(false), .. })) diff --git a/src/query/storages/common/table-meta/src/meta/v2/segment.rs b/src/query/storages/common/table-meta/src/meta/v2/segment.rs index c092b87f0d5bf..21c3cb6f6138a 100644 --- a/src/query/storages/common/table-meta/src/meta/v2/segment.rs +++ b/src/query/storages/common/table-meta/src/meta/v2/segment.rs @@ -58,13 +58,6 @@ pub struct BlockMeta { #[serde(default)] pub bloom_filter_index_size: u64, - - /// Compression algo used to compress the columns of blocks - /// - /// If not specified, the legacy algo `Lz4` will be used. - /// `Lz4` is merely for backward compatibility, it will NO longer be - /// used in the write path. - #[serde(default = "Compression::legacy")] pub compression: Compression, }