{"record":{"id":"78ed3aba6aa1cb25","repo":"cube-js/cube","slug":"unsupported-node-type","errorCode":null,"errorMessage":"Unsupported node type: {:?}","messagePattern":"Unsupported node type: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rust/cubesql/cubesql/src/compile/rewrite/converter.rs","lineNumber":575,"sourceCode":"                        add_expr_data_node!(graph, GroupingSetType::Rollup, GroupingSetExprType);\n                    graph.add(LogicalPlanLanguage::GroupingSetExpr([members, expr_type]))\n                }\n                GroupingSet::Cube(members) => {\n                    let members = add_binary_expr_list_node!(\n                        graph,\n                        members,\n                        query_params,\n                        GroupingSetExprMembers,\n                        false\n                    );\n                    let expr_type =\n                        add_expr_data_node!(graph, GroupingSetType::Cube, GroupingSetExprType);\n                    graph.add(LogicalPlanLanguage::GroupingSetExpr([members, expr_type]))\n                }\n                _ => unimplemented!(\"Unsupported grouping set type: {:?}\", expr),\n            },\n            // TODO: Support all\n            _ => unimplemented!(\"Unsupported node type: {:?}\", expr),\n        })\n    }\n\n    pub fn add_logical_plan(&mut self, plan: &LogicalPlan) -> Result<Id, CubeError> {\n        self.add_logical_plan_replace_params(\n            plan,\n            &mut None,\n            &LogicalPlanToLanguageContext::default(),\n        )\n    }\n\n    pub fn add_logical_plan_replace_params(\n        &mut self,\n        plan: &LogicalPlan,\n        query_params: &mut Option<HashMap<usize, ScalarValue>>,\n        ctx: &LogicalPlanToLanguageContext,\n    ) -> Result<Id, CubeError> {\n        Ok(match plan {","sourceCodeStart":557,"sourceCodeEnd":593,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/rust/cubesql/cubesql/src/compile/rewrite/converter.rs#L557-L593","documentation":"In the same converter, any LogicalPlan::Expr node type not handled by the preceding match arms in add_expr_replace_params reaches the catch-all unimplemented!(\"Unsupported node type: {:?}\") and panics with the debug dump of the expression. This marks expression kinds the CubeSQL rewrite/conversion layer (with parameter replacement) does not support.","triggerScenarios":"Compiling a SQL query whose plan contains an expression node type missing from add_expr_replace_params' match (e.g. newer DataFusion expression variants, unsupported window/aggregate/between forms) while the plan is being converted with replace-params semantics.","commonSituations":"Using advanced SQL constructs (window frames, exotic operators, newly added DataFusion expressions) through Cube's SQL API; version upgrades where DataFusion expression enums grew and the converter wasn't updated.","solutions":["Rewrite the query using simpler/supported expression forms that the converter handles","Upgrade Cube so the converter covers the expression type, or add a match arm for the printed expression in rust/cubesql/cubesql/src/compile/rewrite/converter.rs:575","Try the Tesseract SQL planner (CUBEJS_TESSERACT_SQL_PLANNER=true) which does not use this legacy converter path"],"exampleFix":"// before\n_ => unimplemented!(\"Unsupported node type: {:?}\", expr),\n// after\nother => Err(CubeError::internal(format!(\n    \"Unsupported expression node in query rewrite: {:?}; simplify the query or add converter support\",\n    other\n))),","handlingStrategy":"try-catch","validationCode":"// Fail fast on exotic SQL constructs the legacy converter does not support\nconst unsupported = [/\\bFILTER\\s*\\(/i, /\\bWITHIN\\s+GROUP/i, /OVER\\s*\\(.*\\bROWS\\s+BETWEEN/i];\nif (unsupported.some(re => re.test(sql))) {\n  throw new Error('Query uses constructs unsupported by the CubeSQL converter; simplify or use Tesseract planner');\n}","typeGuard":"function usesOnlySupportedExprs(sql, supportedPatterns = [/^SELECT/i, /\\bSUM\\(/i, /\\bCOUNT\\(/i, /\\bAVG\\(/i]) {\n  return supportedPatterns.some(re => re.test(sql)) && !/\\bFILTER\\s*\\(/i.test(sql);\n}","tryCatchPattern":"try {\n  return await connection.query(sql);\n} catch (e) {\n  if (/Unsupported node type/i.test(String(e.message))) {\n    console.error('CubeSQL converter rejected expression; simplify query or switch planner', e.message);\n    return await connection.query(simplify(sql));\n  }\n  throw e;\n}","preventionTips":["Set CUBEJS_TESSERACT_SQL_PLANNER=true to bypass the legacy converter when using advanced SQL","Simplify exotic expressions (FILTER, complex window frames) before sending to Cube SQL API","Pin and upgrade Cube versions together so converter support matches DataFusion expression enums","Capture the panic message (it prints the exact expression) when filing a support issue"],"tags":["rust","cubesql","unimplemented","query-rewrite","expression"],"backgroundTag":"unsupported-plan-node","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}