risingwavelabs/risingwave · error · ArrayError

Convert to arrow error: {0}

Error message

Convert to arrow error: {0}

What it means

ArrayError::ToArrow wraps a boxed error raised when converting a RisingWave array into an Apache Arrow array fails — typically because the RW value is not representable in the target Arrow type (e.g. overflow of decimal precision, unsupported type mapping). The arrow::error::ArrowError is preserved as the source.

Source

Thrown at src/common/src/array/error.rs:46

    #[error("I/O error: {0}")]
    Io(#[from] std::io::Error),

    #[error(transparent)]
    Internal(
        #[from]
        #[backtrace]
        anyhow::Error,
    ),

    #[error("Convert from arrow error: {0}")]
    FromArrow(
        #[source]
        #[backtrace]
        BoxedError,
    ),

    #[error("Convert to arrow error: {0}")]
    ToArrow(
        #[source]
        #[backtrace]
        BoxedError,
    ),
}

impl From<PbFieldNotFound> for ArrayError {
    fn from(err: PbFieldNotFound) -> Self {
        anyhow!("Failed to decode prost: field not found `{}`", err.0).into()
    }
}

impl From<Infallible> for ArrayError {
    fn from(err: Infallible) -> Self {
        unreachable!("Infallible error: {:?}", err)
    }
}

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Read the wrapped source error for the exact Arrow-side failure
  2. Widen the target Arrow type (increase precision) or clamp/adjust values before conversion
  3. Align the sink schema with the RW column types so the mapping is representable
Defensive patterns

Strategy: validation

Validate before calling

fn ensure_arrow_representable(v: &Decimal, target_precision: u32) -> bool {
    v.abs() < num_traits::Pow::pow(&10_i128, &(target_precision as usize))
}

Try / catch

match result {
    Err(ArrayError::ToArrow(src)) => {
        log::error!("RW->arrow conversion failed: {src}");
        // widen target arrow type or clamp values, then retry
    }
    other => other,
}

Prevention

When it happens

Trigger: Converting RW arrays to Arrow for export (e.g. to Iceberg sink, Arrow flight, or Parquet write) where the target Arrow type cannot represent the values, such as decimals exceeding the target precision.

Common situations: Sinking RW decimal values larger than the Arrow decimal precision allows; type mapping changes between RW and Arrow; writing special values into a stricter target schema.

Understand the failure class

Background: Type mismatch errors: IllegalArgumentException, TypeError and type guards across 150 open-source libraries — this error's family across 150 libraries.

Related errors


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