risingwavelabs/risingwave · error

unspecified type of `FrameExclusion`

Error message

unspecified type of `FrameExclusion`

What it means

When deserializing a FrameExclusion from its protobuf representation, an Unspecified exclusion type carries no information, so from_protobuf refuses to guess and returns an error instead of defaulting silently.

Source

Thrown at src/expr/core/src/window_function/call.rs:280

            UnboundedFollowing => UnboundedPreceding,
        }
    }
}

#[derive(Display, Debug, Copy, Clone, Eq, PartialEq, Hash, Default, EnumAsInner)]
#[display("EXCLUDE {}", style = "TITLE CASE")]
pub enum FrameExclusion {
    CurrentRow,
    // Group,
    // Ties,
    #[default]
    NoOthers,
}

impl FrameExclusion {
    fn from_protobuf(exclusion: PbExclusion) -> Result<Self> {
        let excl = match exclusion {
            PbExclusion::Unspecified => bail!("unspecified type of `FrameExclusion`"),
            PbExclusion::CurrentRow => Self::CurrentRow,
            PbExclusion::NoOthers => Self::NoOthers,
        };
        Ok(excl)
    }

    fn to_protobuf(self) -> PbExclusion {
        match self {
            Self::CurrentRow => PbExclusion::CurrentRow,
            Self::NoOthers => PbExclusion::NoOthers,
        }
    }
}

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Set the frame exclusion explicitly (CurrentRow or NoOthers) when building the WindowFunction protobuf in the frontend.
  2. Upgrade the frontend so it always fills the exclusion field before sending the plan.
  3. Inspect the incoming protobuf plan for a missing/unset exclusion field.

Example fix

// before (protobuf builder)
frame.set_exclusion(PbExclusion::Unspecified);
// after
frame.set_exclusion(PbExclusion::NoOthers);
Defensive patterns

Strategy: validation

Validate before calling

fn exclusion_is_set(e: PbExclusion) -> bool { !matches!(e, PbExclusion::Unspecified) }

Type guard

fn is_specified(e: &PbExclusion) -> bool { !matches!(e, PbExclusion::Unspecified) }

Try / catch

match FrameExclusion::from_protobuf(pb_exclusion) {
    Ok(excl) => excl,
    Err(e) => { log::warn!("frame exclusion unset, defaulting to NoOthers: {}", e); FrameExclusion::NoOthers }
}

Prevention

When it happens

Trigger: A WindowFunction protobuf message arrives with frame exclusion set to PbExclusion::Unspecified, and WindowFuncCall::from_protobuf calls FrameExclusion::from_protobuf on it.

Common situations: A producer (frontend or an older/other RisingWave version) omitted the exclusion field in the protobuf, or a hand-crafted/mutated proto message lacking the exclusion variant.

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/b6aea3a917a14e13. Report an issue: GitHub.