From fddda8d0fa366818537b63c31e802df908e85b96 Mon Sep 17 00:00:00 2001 From: Luca Cominardi Date: Fri, 30 Oct 2026 15:07:40 +0100 Subject: [PATCH] Keep the jitexpr input column var_type accessor Restore `InputColumn::var_type()`, and its call in `open_segment`. --- .../value_source/jitexpr_value_source/input_column.rs | 6 +++++- .../jitexpr_value_source/jitexpr_value_source.rs | 2 +- src/aggregation/value_source/jitexpr_value_source/mod.rs | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/aggregation/value_source/jitexpr_value_source/input_column.rs b/src/aggregation/value_source/jitexpr_value_source/input_column.rs index dc121ed17..949993af5 100644 --- a/src/aggregation/value_source/jitexpr_value_source/input_column.rs +++ b/src/aggregation/value_source/jitexpr_value_source/input_column.rs @@ -9,7 +9,7 @@ use crate::{DocId, TantivyError, COLLECT_BLOCK_BUFFER_LEN}; /// A fast-field column bound to an input of the compiled expression. pub(super) struct InputColumn { - pub(super) var_type: VarType, + var_type: VarType, /// Values in their monotonic `u64` mapping. Term ords for a `Str` input. Its index tells /// which docs have a value. pub(super) column: Column, @@ -56,6 +56,10 @@ impl InputColumn { } } + pub(super) fn var_type(&self) -> VarType { + self.var_type + } + /// Returns the number of terms of the dictionary of a `Str` input, or `None` for the other /// types. pub(super) fn num_terms(&self) -> Option { diff --git a/src/aggregation/value_source/jitexpr_value_source/jitexpr_value_source.rs b/src/aggregation/value_source/jitexpr_value_source/jitexpr_value_source.rs index 931276703..789fe8ab8 100644 --- a/src/aggregation/value_source/jitexpr_value_source/jitexpr_value_source.rs +++ b/src/aggregation/value_source/jitexpr_value_source/jitexpr_value_source.rs @@ -170,7 +170,7 @@ impl JitExprValueSource { // Evaluating the function with inputs of the wrong type is undefined behavior. assert_eq!(compiled_fn.inputs().len(), inputs.len()); for (compiled_input, input) in compiled_fn.inputs().iter().zip(&inputs) { - assert_eq!(compiled_input.r#type, input.var_type); + assert_eq!(compiled_input.r#type, input.var_type()); } let num_inputs = inputs.len(); let evaluation = match inputs.as_slice() { diff --git a/src/aggregation/value_source/jitexpr_value_source/mod.rs b/src/aggregation/value_source/jitexpr_value_source/mod.rs index 2ffdee755..9886a29c4 100644 --- a/src/aggregation/value_source/jitexpr_value_source/mod.rs +++ b/src/aggregation/value_source/jitexpr_value_source/mod.rs @@ -186,7 +186,7 @@ impl JitExprValueSourceProvider { ))); }; let input = InputColumn::open(&handle)?; - if input.var_type != compiled_input.r#type { + if input.var_type() != compiled_input.r#type { return Err(TantivyError::InternalError(format!( "the compiled input `{}` expects {:?}, but its column has type {}", compiled_input.variable_name,