{"record":{"id":"69ea5e261f71f70c","repo":"risingwavelabs/risingwave","slug":"convert-from-arrow-error-0","errorCode":null,"errorMessage":"Convert from arrow error: {0}","messagePattern":"Convert from arrow error: (.+?)","errorType":"error_code","errorClass":"ArrayError","httpStatus":null,"severity":"error","filePath":"src/common/src/array/error.rs","lineNumber":39,"sourceCode":"\nuse crate::error::BoxedError;\n\n#[derive(Error, Debug, Construct)]\npub enum ArrayError {\n    #[error(\"Pb decode error: {0}\")]\n    PbDecode(#[from] prost::DecodeError),\n\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    }","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/common/src/array/error.rs#L21-L57","documentation":"ArrayError::FromArrow wraps a boxed error produced when converting an Apache Arrow array into a RisingWave array failed — for example unsupported Arrow types, negative decimal scale, or nullability issues. The original arrow::arrow_err is preserved as the source.","triggerScenarios":"Any TryFrom<&dyn ArrowArray>-style conversion from Arrow to RW arrays that returns arrow::error::ArrowError, converted into ArrayError::FromArrow.","commonSituations":"Reading data sources (Iceberg, Parquet, external tables) whose Arrow types are unsupported or out of range for RW types; decimal precision/scale mismatches; invalid UTF-8 in string arrays.","solutions":["Read the wrapped source error for the specific Arrow failure","Cast or sanitize the Arrow data to a supported type before conversion (e.g. fix decimal scale/precision)","Ensure the source schema matches the expected RW column types"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"fn ensure_arrow_convertible(dt: &arrow::datatypes::DataType) -> Result<(), String> {\n    use arrow::datatypes::DataType::*;\n    match dt {\n        Decimal128(p, s) if *s < 0 => Err(\"negative-scale decimal not convertible\".into()),\n        Decimal128(p, _) if *p > 38 => Err(\"precision > 38 not convertible\".into()),\n        _ => Ok(()),\n    }\n}","typeGuard":null,"tryCatchPattern":"match result {\n    Err(ArrayError::FromArrow(src)) => {\n        log::error!(\"arrow->RW conversion failed: {src}\");\n        // cast the arrow data to a supported type and retry\n    }\n    other => other,\n}","preventionTips":["Validate Arrow schemas against supported RW type mappings before ingestion","Sanitize invalid UTF-8 and out-of-range decimals upstream","Keep source schema changes reviewed against the converter's supported types"],"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"}