{"record":{"id":"c97ba1bcdfc28dae","repo":"cube-js/cube","slug":"unexpected-logical-plan-node","errorCode":null,"errorMessage":"Unexpected logical plan node: {:?}","messagePattern":"Unexpected logical plan node: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rust/cubesql/cubesql/src/compile/rewrite/converter.rs","lineNumber":2466,"sourceCode":"                };\n\n                LogicalPlan::Union(Union {\n                    inputs,\n                    schema: Arc::new(schema),\n                    alias,\n                })\n            }\n            LogicalPlanLanguage::Distinct(params) => {\n                let input = Arc::new(self.to_logical_plan(params[0])?);\n\n                LogicalPlan::Distinct(Distinct { input })\n            }\n            LogicalPlanLanguage::Values(values) => {\n                let values = match_data_node!(node_by_id, values[0], ValuesValues);\n\n                LogicalPlanBuilder::values(values)?.build()?\n            }\n            x => panic!(\"Unexpected logical plan node: {:?}\", x),\n        })\n    }\n\n    fn have_ungrouped_cube_scan_inside(node: &LogicalPlan) -> bool {\n        match node {\n            LogicalPlan::Projection(Projection { input, .. })\n            | LogicalPlan::Filter(Filter { input, .. })\n            | LogicalPlan::Window(Window { input, .. })\n            | LogicalPlan::Aggregate(Aggregate { input, .. })\n            | LogicalPlan::Sort(Sort { input, .. })\n            | LogicalPlan::Repartition(Repartition { input, .. })\n            | LogicalPlan::Limit(Limit { input, .. }) => {\n                Self::have_ungrouped_cube_scan_inside(input)\n            }\n            LogicalPlan::Join(Join { left, right, .. })\n            | LogicalPlan::CrossJoin(CrossJoin { left, right, .. }) => {\n                Self::have_ungrouped_cube_scan_inside(left)\n                    || Self::have_ungrouped_cube_scan_inside(right)","sourceCodeStart":2448,"sourceCodeEnd":2484,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/rust/cubesql/cubesql/src/compile/rewrite/converter.rs#L2448-L2484","documentation":"Internal compiler error in cubesql's to_logical_plan converter: the egreedy/egg logical-plan expression tree contained a LogicalPlanLanguage node the converter has no arm for at this match position, so it cannot be lowered into a DataFusion LogicalPlan. This indicates an unhandled node kind in the Rust SQL planner rewrite layer, typically hit by an unsupported query shape.","triggerScenarios":"A query compiles to a LogicalPlanLanguage variant not handled in the match — e.g. unusual set operations, nested VALUES, or new IR nodes added upstream but not to this converter.","commonSituations":"Queries using rarely supported SQL features (INTERSECT/EXCEPT variants, nested VALUES clauses) through the SQL API; version skew between compiler components.","solutions":["Rewrite the query with more common constructs (e.g. UNION ALL, inline literals instead of VALUES)","Upgrade CubeSQL so the node is handled","Report the printed node variant to the Cube team to add a converter arm"],"exampleFix":"// before\nSELECT * FROM (VALUES (1),(2)) t(x)\n// after\nSELECT 1 AS x UNION ALL SELECT 2;","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"let res = std::panic::catch_unwind(AssertUnwindSafe(|| planner.plan(sql)));\nmatch res {\n    Ok(p) => p,\n    Err(_) => fallback_to_legacy_planner_or_return_unsupported(sql),\n}","preventionTips":["Stick to widely supported SQL constructs (standard SELECT/JOIN/GROUP BY/UNION ALL)","Replace nested VALUES and exotic set operations with equivalent common forms","Set CUBEJS_TESSERACT_SQL_PLANNER per project guidance if the legacy path supports the construct"],"tags":["rust","panic","logical-plan","sql-compilation"],"backgroundTag":"unsupported-plan-node","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}