cube-js/cube · error
Unsupported filter operator: {}
Error message
Unsupported filter operator: {} What it means
to_filter converts filter expression IR nodes into DataFusion expressions. When it encounters a filter operator variant it does not recognize in its match, it panics with 'Unsupported filter operator'.
Source
Thrown at rust/cubesql/cubesql/src/compile/rewrite/converter.rs:1895
.map(|f| serde_json::json!(f))
.collect(),
),
and: None,
});
if !segments.is_empty() {
return Err(CubeError::rewrite(
"Can't use OR operator with segments".to_string(),
));
}
if change_user.is_some() {
return Err(CubeError::rewrite(
"Can't use OR operator with __user column"
.to_string(),
));
}
}
x => panic!("Unsupported filter operator: {}", x),
}
}
LogicalPlanLanguage::FilterMember(params) => {
let member =
match_data_node!(node_by_id, params[0], FilterMemberMember);
let op = match_data_node!(node_by_id, params[1], FilterMemberOp);
let values =
match_data_node!(node_by_id, params[2], FilterMemberValues);
if !is_in_or && op == "inDateRange" {
let existing_time_dimensions: Vec<_> = query_time_dimensions
.iter_mut()
.filter_map(|td| {
if td.dimension == member && td.date_range.is_none() {
td.date_range = Some(json!(values));
Some(td)
} else {
None
}View on GitHub (pinned to 7d981676b3)
Solutions
- Simplify the WHERE clause into supported operators (=, <, >, AND, IN, etc.)
- Upgrade CubeSQL so the operator is supported
- File a Cube issue quoting the operator from the panic message
Example fix
// before WHERE a !~ 'pattern' // after WHERE NOT (a ~ 'pattern')
Defensive patterns
Strategy: validation
Validate before calling
// Whitelist operators before compiling a filter
fn validate_filter_op(op: &str) -> Result<(), String> {
const SUPPORTED: &[&str] = &["=", "!=", "<", ">", "<=", ">=", "and", "or", "in", "not in", "like", "not like", "is null", "is not null"];
if SUPPORTED.contains(&op.to_lowercase().as_str()) { Ok(()) }
else { Err(format!("operator '{}' may not be supported; simplify it", op)) }
} Try / catch
match compile_filter(query) {
Ok(plan) => plan,
Err(e) if e.message().contains("Unsupported filter operator") => respond_bad_request(e.message()),
Err(e) => respond_internal_error(e),
} Prevention
- Compose WHERE clauses only from common SQL operators
- Avoid exotic operators (!~, IS DISTINCT FROM, etc.) via the SQL API
- Catch OR-with-__user early — that path raises a distinct CubeError before this panic
When it happens
Trigger: A query filter compiles to an operator outside the supported set (the surrounding match handles specific operators and a __user OR guard returns a CubeError for OR with __user, everything else falls to this panic).
Common situations: Unusual WHERE clauses (exotic comparison or boolean operators) sent through the SQL API; schema/plugin-generated filters producing operator nodes the converter doesn't handle; version mismatch between query builder IR and converter.
Related errors
- Expected filter but found {:?}
- Unexpected join node: {:?}
- Unexpected logical plan node: {:?}
- This query doesnt have a plan, because it already has values
- Should be rewritten with UtcTimestamp function
AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02).
Data as JSON: /api/errors/f21d018c73a98d56.
Report an issue: GitHub.