{"record":{"id":"9bec33a34b783450","repo":"risingwavelabs/risingwave","slug":"unspecified-type-of-windowframe","errorCode":null,"errorMessage":"unspecified type of `WindowFrame`","messagePattern":"unspecified type of `WindowFrame`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/expr/core/src/window_function/call.rs","lineNumber":93,"sourceCode":"    }\n\n    pub fn rows_with_exclusion(\n        start: RowsFrameBound,\n        end: RowsFrameBound,\n        exclusion: FrameExclusion,\n    ) -> Self {\n        Self {\n            bounds: FrameBounds::Rows(RowsFrameBounds { start, end }),\n            exclusion,\n        }\n    }\n}\n\nimpl Frame {\n    pub fn from_protobuf(frame: &PbWindowFrame) -> Result<Self> {\n        use risingwave_pb::expr::window_frame::PbType;\n        let bounds = match frame.get_type()? {\n            PbType::Unspecified => bail!(\"unspecified type of `WindowFrame`\"),\n            #[expect(deprecated)]\n            PbType::RowsLegacy => {\n                #[expect(deprecated)]\n                {\n                    let start = FrameBound::<usize>::from_protobuf_legacy(frame.get_start()?)?;\n                    let end = FrameBound::<usize>::from_protobuf_legacy(frame.get_end()?)?;\n                    FrameBounds::Rows(RowsFrameBounds { start, end })\n                }\n            }\n            PbType::Rows => {\n                let bounds = must_match!(frame.get_bounds()?, PbBounds::Rows(bounds) => bounds);\n                FrameBounds::Rows(RowsFrameBounds::from_protobuf(bounds)?)\n            }\n            PbType::Range => {\n                let bounds = must_match!(frame.get_bounds()?, PbBounds::Range(bounds) => bounds);\n                FrameBounds::Range(RangeFrameBounds::from_protobuf(bounds)?)\n            }\n            PbType::Session => {","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/expr/core/src/window_function/call.rs#L75-L111","documentation":"`Frame::from_protobuf` deserializes a window frame from its protobuf representation. The protobuf `Type` enum includes an `Unspecified` placeholder which is not a valid frame type, so it is explicitly rejected when building the frame.","triggerScenarios":"A `PbWindowFrame` message with `type: Unspecified` is passed to `Frame::from_protobuf` — typically when a plan fragment serialized by a frontend lacking frame-type info (or a version-mismatched frontend) is deserialized by the stream/batch engine.","commonSituations":"Mixed-version deployment where an older frontend omits the frame type; a hand-crafted or corrupted plan protobuf; a frontend bug that fails to set Rows/RowsLegacy/Range/Groups before serialization.","solutions":["Ensure the frontend always sets `WindowFrame.type` (Rows/Range/Groups) when building `PbWindowFrame`.","Check for version skew between frontend and compute nodes and redeploy with matching versions.","If you construct plan protobufs in tests/tools, populate the frame type field explicitly."],"exampleFix":"// before\nlet frame = PbWindowFrame { start: Some(start), end: Some(end), ..Default::default() }; // type Unspecified\n// after\nlet frame = PbWindowFrame {\n    start: Some(start),\n    end: Some(end),\n    r#type: PbType::Rows as i32,\n    ..Default::default()\n};","handlingStrategy":"validation","validationCode":"# protobuf producer side (Rust pseudo)\nassert_ne!(frame.get_type().unwrap(), PbType::Unspecified, \"frame type must be set\");","typeGuard":"fn frame_type_is_set(f: &PbWindowFrame) -> bool { f.r#type != PbType::Unspecified as i32 }","tryCatchPattern":"match Frame::from_protobuf(&pb_frame) {\n    Ok(frame) => frame,\n    Err(e) if e.to_string().contains(\"unspecified type\") => bail!(\"plan corruption: WindowFrame type missing\"),\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Always set `r#type` when constructing PbWindowFrame","Keep frontend and compute node versions aligned","Add round-trip serialization tests for WindowFrame"],"tags":["window-function","protobuf","deserialization","rust"],"backgroundTag":"invalid-enum-value","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}