{"record":{"id":"f21d018c73a98d56","repo":"cube-js/cube","slug":"unsupported-filter-operator","errorCode":null,"errorMessage":"Unsupported filter operator: {}","messagePattern":"Unsupported filter operator: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rust/cubesql/cubesql/src/compile/rewrite/converter.rs","lineNumber":1895,"sourceCode":"                                                    .map(|f| serde_json::json!(f))\n                                                    .collect(),\n                                            ),\n                                            and: None,\n                                        });\n                                        if !segments.is_empty() {\n                                            return Err(CubeError::rewrite(\n                                                \"Can't use OR operator with segments\".to_string(),\n                                            ));\n                                        }\n\n                                        if change_user.is_some() {\n                                            return Err(CubeError::rewrite(\n                                                \"Can't use OR operator with __user column\"\n                                                    .to_string(),\n                                            ));\n                                        }\n                                    }\n                                    x => panic!(\"Unsupported filter operator: {}\", x),\n                                }\n                            }\n                            LogicalPlanLanguage::FilterMember(params) => {\n                                let member =\n                                    match_data_node!(node_by_id, params[0], FilterMemberMember);\n                                let op = match_data_node!(node_by_id, params[1], FilterMemberOp);\n                                let values =\n                                    match_data_node!(node_by_id, params[2], FilterMemberValues);\n                                if !is_in_or && op == \"inDateRange\" {\n                                    let existing_time_dimensions: Vec<_> = query_time_dimensions\n                                        .iter_mut()\n                                        .filter_map(|td| {\n                                            if td.dimension == member && td.date_range.is_none() {\n                                                td.date_range = Some(json!(values));\n                                                Some(td)\n                                            } else {\n                                                None\n                                            }","sourceCodeStart":1877,"sourceCodeEnd":1913,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/rust/cubesql/cubesql/src/compile/rewrite/converter.rs#L1877-L1913","documentation":"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'.","triggerScenarios":"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).","commonSituations":"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.","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"],"exampleFix":"// before\nWHERE a !~ 'pattern'\n// after\nWHERE NOT (a ~ 'pattern')","handlingStrategy":"validation","validationCode":"// Whitelist operators before compiling a filter\nfn validate_filter_op(op: &str) -> Result<(), String> {\n    const SUPPORTED: &[&str] = &[\"=\", \"!=\", \"<\", \">\", \"<=\", \">=\", \"and\", \"or\", \"in\", \"not in\", \"like\", \"not like\", \"is null\", \"is not null\"];\n    if SUPPORTED.contains(&op.to_lowercase().as_str()) { Ok(()) }\n    else { Err(format!(\"operator '{}' may not be supported; simplify it\", op)) }\n}","typeGuard":null,"tryCatchPattern":"match compile_filter(query) {\n    Ok(plan) => plan,\n    Err(e) if e.message().contains(\"Unsupported filter operator\") => respond_bad_request(e.message()),\n    Err(e) => respond_internal_error(e),\n}","preventionTips":["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"],"tags":["rust","panic","filter-operator","sql-compilation"],"backgroundTag":"unsupported-filter-operator","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}