{"record":{"id":"0b5d364a324dc895","repo":"risingwavelabs/risingwave","slug":"expr-error-0","errorCode":null,"errorMessage":"Expr error: {0}","messagePattern":"Expr error: (.+?)","errorType":"error_code","errorClass":"BatchError","httpStatus":null,"severity":"error","filePath":"src/batch/src/error.rs","lineNumber":57,"sourceCode":"pub trait Error = std::error::Error + Send + Sync + 'static;\n\n#[derive(Error, Debug, Construct)]\npub enum BatchError {\n    #[error(\"Storage error: {0}\")]\n    Storage(\n        #[backtrace]\n        #[from]\n        StorageError,\n    ),\n\n    #[error(\"Array error: {0}\")]\n    Array(\n        #[from]\n        #[backtrace]\n        ArrayError,\n    ),\n\n    #[error(\"Expr error: {0}\")]\n    Expr(\n        #[from]\n        #[backtrace]\n        ExprError,\n    ),\n\n    #[error(\"Serialize/deserialize error: {0}\")]\n    Serde(\n        #[source]\n        #[backtrace]\n        BoxedError,\n    ),\n\n    #[error(\"Failed to send result to channel\")]\n    SenderError,\n\n    #[error(transparent)]\n    Internal(","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/batch/src/error.rs#L39-L75","documentation":"BatchError::Expr converts an ExprError into the batch error type via #[from], displaying as \"Expr error: {0}\". It is raised when evaluating an expression during batch query execution fails — e.g. unsupported function/operation, invalid arguments, or evaluation errors on a value.","triggerScenarios":"A batch executor evaluates a BoxedExpression whose compute returns Err(ExprError), converted automatically with `?` — e.g. division by zero paths, unsupported operations, bad function arguments at evaluation time.","commonSituations":"Queries calling functions with unsupported argument types or nullability assumptions; expression evaluation on data that violates expected invariants; using features whose batch expression support is incomplete.","solutions":["Read the wrapped ExprError message to find the failing expression/operation.","Fix the query: use supported argument types/operations, add explicit casts, or guard NULL/edge values (CASE/COALESCE).","Check RisingWave docs/function support for the operator used in the batch path.","If the expression should be supported, report a bug with the SQL and inner ExprError."],"exampleFix":"// before: unsupported implicit cast in expression\nSELECT int_col + varchar_col FROM t;\n// after: explicit cast / supported operation\nSELECT int_col + varchar_col::INT FROM t;","handlingStrategy":"try-catch","validationCode":"// SQL: guard risky expressions before execution\nSELECT CASE WHEN denom = 0 THEN NULL ELSE num / denom END FROM t;","typeGuard":null,"tryCatchPattern":"match result {\n    Err(BatchError::Expr(expr_err)) => {\n        // map expr_err to a user-facing SQL error with the failing expression\n    }\n    other => other,\n}","preventionTips":["Check function/operator support for the batch engine before use.","Add explicit casts for mixed-type expressions.","Use COALESCE/CASE to guard NULL and edge-case inputs.","Add tests covering expression evaluation on boundary values."],"tags":["batch","expression","evaluation","rust"],"backgroundTag":"unsupported-operation","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"}