influxdata/influxdb · error

NotRegexMatch function not registered

Error message

NotRegexMatch function not registered

What it means

`regex_not_match_expr` mirrors `regex_match_expr` for the `!~` operator and panics when the NotRegexMatch UDF is absent from the registry. The `.expect()` encodes the assumption that UDF registration happened at context construction. Seeing this panic means the registry was built without the negated regex-match UDF.

Solutions

  1. Run the full UDF registration (all query_functions UDFs) on your context before building expressions.
  2. Verify NotRegexMatch appears in the registry's UDF list.
  3. Update registration code if the UDF name constant changed after an upgrade.

Example fix

// before
register_udf(REGEX_MATCH_UDF_NAME); // partial registration
// after
register_udf(REGEX_MATCH_UDF_NAME);
register_udf(REGEX_NOT_MATCH_UDF_NAME); // both variants
Defensive patterns

Strategy: type-guard

Validate before calling

debug_assert!(registry().udf(regex::REGEX_NOT_MATCH_UDF_NAME).is_some(), "NotRegexMatch UDF not registered");

Type guard

fn has_regex_not_match_udf(registry: &SessionContext) -> bool {
    registry.udf(regex::REGEX_NOT_MATCH_UDF_NAME).is_some()
}

Try / catch

let udf = registry().udf(regex::REGEX_NOT_MATCH_UDF_NAME)
    .ok_or_else(|| anyhow!("NotRegexMatch UDF not registered"))?;

Prevention

When it happens

Trigger: Calling `regex_not_match_expr(input, pattern)` when `registry().udf(regex::REGEX_NOT_MATCH_UDF_NAME)` returns None — NotRegexMatch was never registered on the context.

Common situations: Manually constructed SessionContext without the crate's UDF registration; test helpers that registered RegexMatch but not NotRegexMatch; version drift renaming the UDF.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


AI-assisted analysis of influxdata/influxdb@06200ef96b (2026-09-19). Data as JSON: /api/errors/823332783d53c5c8. Report an issue: GitHub.

Appendix: source

Thrown at core/query_functions/src/lib.rs:83

/// col ~= /pattern/
/// ```
pub fn regex_match_expr(input: Expr, pattern: String) -> Expr {
    registry()
        .udf(regex::REGEX_MATCH_UDF_NAME)
        .expect("RegexMatch function not registered")
        .call(vec![input, lit(pattern)])
}

/// Return an Expr that invokes a InfluxRPC compatible regex match to
/// determine which values do not satisfy the pattern. Equivalent to:
///
/// ```text
/// col !~ /pattern/
/// ```
pub fn regex_not_match_expr(input: Expr, pattern: String) -> Expr {
    registry()
        .udf(regex::REGEX_NOT_MATCH_UDF_NAME)
        .expect("NotRegexMatch function not registered")
        .call(vec![input, lit(pattern)])
}

/// Create a DataFusion `Expr` that invokes `window_bounds` with the
/// appropriate every and offset arguments at runtime
pub fn make_window_bound_expr(
    time_arg: Expr,
    every: WindowDuration,
    offset: WindowDuration,
) -> Expr {
    let encoded_every: EncodedWindowDuration = every.into();
    let encoded_offset: EncodedWindowDuration = offset.into();

    registry()
        .udf(window::WINDOW_BOUNDS_UDF_NAME)
        .expect("WindowBounds function not registered")
        .call(vec![
            time_arg,

View on GitHub (pinned to 06200ef96b)