risingwavelabs/risingwave · error

no such window function type

Error message

no such window function type

What it means

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.

Source

Thrown at src/expr/core/src/window_function/kind.rs:55

    Aggregate(AggType),
}

impl WindowFuncKind {
    pub fn from_protobuf(
        window_function_type: &risingwave_pb::expr::window_function::PbType,
    ) -> Result<Self> {
        use risingwave_pb::expr::agg_call::PbKind as PbAggKind;
        use risingwave_pb::expr::window_function::{PbGeneralType, PbType};

        let kind = match window_function_type {
            PbType::General(typ) => match PbGeneralType::try_from(*typ) {
                Ok(PbGeneralType::Unspecified) => bail!("Unspecified window function type"),
                Ok(PbGeneralType::RowNumber) => Self::RowNumber,
                Ok(PbGeneralType::Rank) => Self::Rank,
                Ok(PbGeneralType::DenseRank) => Self::DenseRank,
                Ok(PbGeneralType::Lag) => Self::Lag,
                Ok(PbGeneralType::Lead) => Self::Lead,
                Err(_) => bail!("no such window function type"),
            },
            #[expect(deprecated)]
            PbType::Aggregate(kind) => Self::Aggregate(AggType::from_protobuf_flatten(
                PbAggKind::try_from(*kind).context("no such aggregate function type")?,
                None,
                None,
            )?),
            PbType::Aggregate2(agg_type) => Self::Aggregate(AggType::from_protobuf(agg_type)?),
        };
        Ok(kind)
    }
}

impl WindowFuncKind {
    pub fn is_numbering(&self) -> bool {
        matches!(self, Self::RowNumber | Self::Rank | Self::DenseRank)
    }
}

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Upgrade the RisingWave binary so its generated PbAggKind includes the aggregate kind present in the plan.
  2. Ensure meta node and frontend/compute nodes run compatible versions.
  3. Validate the kind integer against the current proto enum before sending.

Example fix

// sender uses a kind unknown to this binary -> upgrade binary, or pin plan generation:
let kind = PbAggKind::try_from(raw_kind).ok()?; // fails on old binary for new agg kinds
Defensive patterns

Strategy: try-catch

Try / catch

let kind = match PbAggKind::try_from(raw_kind) {
    Ok(k) => k,
    Err(_) => return Err(anyhow!("aggregate kind {} not supported by this binary; upgrade RisingWave", raw_kind)),
};

Prevention

When it happens

Trigger: Deserializing a WindowFunction with PbType::Aggregate whose i32 kind does not match any PbAggKind variant — typically an aggregate function unknown to this RisingWave version.

Common situations: 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.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11). Data as JSON: /api/errors/229d8844059a63f9. Report an issue: GitHub.