Keep the jitexpr input column var_type accessor

Restore `InputColumn::var_type()`, and its call in `open_segment`.
This commit is contained in:
Luca Cominardi
2026-11-02 14:59:38 +01:00
parent b3ec92fb94
commit fddda8d0fa
3 changed files with 7 additions and 3 deletions
@@ -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<u64>,
@@ -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<usize> {
@@ -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() {
@@ -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,