risingwavelabs/risingwave · error · ConfigParallelismParseError

Parse error: {0}

Error message

Parse error: {0}

What it means

This variant wraps a std ParseIntError produced while parsing the numeric portion of a parallelism config value. When the input looks like a fixed-parallelism number (e.g. '12x' or 'abc' where a Bounded integer is expected), the conversion via #[from] ParseIntError produces "Parse error: <inner message>". It indicates the parallelism value's numeric part is not a valid integer.

Source

Thrown at src/common/src/session_config/parallelism.rs:58

pub const DEFAULT_TABLE_SOURCE_STREAMING_PARALLELISM: ConfigParallelism = bounded_parallelism(4);
pub const DEFAULT_SINK_STREAMING_PARALLELISM: ConfigParallelism = bounded_parallelism(8);

#[derive(Copy, Debug, Clone, PartialEq, Default)]
pub enum ConfigParallelism {
    #[default]
    Default,
    Fixed(NonZeroU64),
    Adaptive,
    Bounded(NonZeroU64),
    Ratio(f32),
}

#[derive(Error, Debug)]
pub enum ConfigParallelismParseError {
    #[error("Unsupported parallelism: {0}")]
    UnsupportedParallelism(String),

    #[error("Parse error: {0}")]
    ParseIntError(#[from] ParseIntError),

    #[error(transparent)]
    StrategyParseError(#[from] ParallelismStrategyParseError),
}

impl FromStr for ConfigParallelism {
    type Err = ConfigParallelismParseError;

    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s.to_ascii_lowercase().as_str() {
            KEYWORD_DEFAULT => return Ok(ConfigParallelism::Default),
            KEYWORD_ADAPTIVE | KEYWORD_AUTO => return Ok(ConfigParallelism::Adaptive),
            _ => {}
        }

        match parse_strategy(s) {
            Ok(AdaptiveParallelismStrategy::Auto | AdaptiveParallelismStrategy::Full) => {

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Provide a plain positive integer (e.g. '8') without decimals, separators, or units.
  2. If you want a fractional setting, use the 'ratio(0.5)' strategy form instead of a bare float.
  3. Ensure the number fits in u64/NonZeroU64 range.

Example fix

// before
SET streaming_parallelism = '8.5';
// after
SET streaming_parallelism = 'ratio(0.5)';
Defensive patterns

Strategy: validation

Validate before calling

// Ensure the value is a plain positive integer before parsing
fn valid_int_parallelism(v: &str) -> Result<u64, String> {
    let n: u64 = v.trim().parse().map_err(|e| format("invalid integer '{v}': {e}"))?;
    if n == 0 { return Err("parallelism must be positive".into()); }
    Ok(n)
}

Try / catch

match result {
    Err(ConfigParallelismParseError::ParseIntError(e)) => {
        eprintln!("parallelism must be a plain integer: {e}");
    }
    other => other?,
}

Prevention

When it happens

Trigger: Setting a parallelism config to a string whose numeric component fails i64/u64 parsing, e.g. 'set streaming_parallelism = 8.5' or 'parallelism = ten' — the parser attempts integer parse and the underlying ParseIntError bubbles up through #[from].

Common situations: Passing a decimal fraction where an integer is required; passing a very large number overflowing u64; locale-formatted numbers with separators like '1_000' or '1,000'.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


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