{"record":{"id":"229d8844059a63f9","repo":"risingwavelabs/risingwave","slug":"no-such-window-function-type","errorCode":null,"errorMessage":"no such window function type","messagePattern":"no such window function type","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/expr/core/src/window_function/kind.rs","lineNumber":55,"sourceCode":"    Aggregate(AggType),\n}\n\nimpl WindowFuncKind {\n    pub fn from_protobuf(\n        window_function_type: &risingwave_pb::expr::window_function::PbType,\n    ) -> Result<Self> {\n        use risingwave_pb::expr::agg_call::PbKind as PbAggKind;\n        use risingwave_pb::expr::window_function::{PbGeneralType, PbType};\n\n        let kind = match window_function_type {\n            PbType::General(typ) => match PbGeneralType::try_from(*typ) {\n                Ok(PbGeneralType::Unspecified) => bail!(\"Unspecified window function type\"),\n                Ok(PbGeneralType::RowNumber) => Self::RowNumber,\n                Ok(PbGeneralType::Rank) => Self::Rank,\n                Ok(PbGeneralType::DenseRank) => Self::DenseRank,\n                Ok(PbGeneralType::Lag) => Self::Lag,\n                Ok(PbGeneralType::Lead) => Self::Lead,\n                Err(_) => bail!(\"no such window function type\"),\n            },\n            #[expect(deprecated)]\n            PbType::Aggregate(kind) => Self::Aggregate(AggType::from_protobuf_flatten(\n                PbAggKind::try_from(*kind).context(\"no such aggregate function type\")?,\n                None,\n                None,\n            )?),\n            PbType::Aggregate2(agg_type) => Self::Aggregate(AggType::from_protobuf(agg_type)?),\n        };\n        Ok(kind)\n    }\n}\n\nimpl WindowFuncKind {\n    pub fn is_numbering(&self) -> bool {\n        matches!(self, Self::RowNumber | Self::Rank | Self::DenseRank)\n    }\n}","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/expr/core/src/window_function/kind.rs#L37-L73","documentation":"When the protobuf window function carries a deprecated PbType::Aggregate kind, the raw i32 is converted to PbAggKind. An unrecognized discriminant yields Err, which is mapped to \"no such window function type\" during from_protobuf.","triggerScenarios":"Deserializing a WindowFunction with PbType::Aggregate whose i32 kind does not match any PbAggKind variant — typically an aggregate function unknown to this RisingWave version.","commonSituations":"Plan serialized by a newer RisingWave with a newly added aggregate function, then deserialized by an older binary; or corrupted proto payload with an out-of-range kind integer.","solutions":["Upgrade the RisingWave binary so its generated PbAggKind includes the aggregate kind present in the plan.","Ensure meta node and frontend/compute nodes run compatible versions.","Validate the kind integer against the current proto enum before sending."],"exampleFix":"// sender uses a kind unknown to this binary -> upgrade binary, or pin plan generation:\nlet kind = PbAggKind::try_from(raw_kind).ok()?; // fails on old binary for new agg kinds","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"let kind = match PbAggKind::try_from(raw_kind) {\n    Ok(k) => k,\n    Err(_) => return Err(anyhow!(\"aggregate kind {} not supported by this binary; upgrade RisingWave\", raw_kind)),\n};","preventionTips":["Run matching RisingWave versions across meta/frontend/compute nodes.","Regenerate proto bindings whenever the .proto enum changes.","Avoid deserializing plans produced by newer binaries."],"tags":["window-function","protobuf","enum","version-skew"],"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"}