{"record":{"id":"a9184e6364a70abe","repo":"risingwavelabs/risingwave","slug":"convert-to-arrow-error-0","errorCode":null,"errorMessage":"Convert to arrow error: {0}","messagePattern":"Convert to arrow error: (.+?)","errorType":"error_code","errorClass":"ArrayError","httpStatus":null,"severity":"error","filePath":"src/common/src/array/error.rs","lineNumber":46,"sourceCode":"\n    #[error(\"I/O error: {0}\")]\n    Io(#[from] std::io::Error),\n\n    #[error(transparent)]\n    Internal(\n        #[from]\n        #[backtrace]\n        anyhow::Error,\n    ),\n\n    #[error(\"Convert from arrow error: {0}\")]\n    FromArrow(\n        #[source]\n        #[backtrace]\n        BoxedError,\n    ),\n\n    #[error(\"Convert to arrow error: {0}\")]\n    ToArrow(\n        #[source]\n        #[backtrace]\n        BoxedError,\n    ),\n}\n\nimpl From<PbFieldNotFound> for ArrayError {\n    fn from(err: PbFieldNotFound) -> Self {\n        anyhow!(\"Failed to decode prost: field not found `{}`\", err.0).into()\n    }\n}\n\nimpl From<Infallible> for ArrayError {\n    fn from(err: Infallible) -> Self {\n        unreachable!(\"Infallible error: {:?}\", err)\n    }\n}","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/common/src/array/error.rs#L28-L64","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Read the wrapped source error for the exact Arrow-side failure","Widen the target Arrow type (increase precision) or clamp/adjust values before conversion","Align the sink schema with the RW column types so the mapping is representable"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"fn ensure_arrow_representable(v: &Decimal, target_precision: u32) -> bool {\n    v.abs() < num_traits::Pow::pow(&10_i128, &(target_precision as usize))\n}","typeGuard":null,"tryCatchPattern":"match result {\n    Err(ArrayError::ToArrow(src)) => {\n        log::error!(\"RW->arrow conversion failed: {src}\");\n        // widen target arrow type or clamp values, then retry\n    }\n    other => other,\n}","preventionTips":["Size Arrow decimal precision to accommodate RW decimal ranges before sinking","Review sink schema mappings whenever column types change","Clamp or reject out-of-range values at pipeline entry rather than at export time"],"tags":["arrow","conversion","type-mismatch"],"backgroundTag":"type-mismatch","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"}