{"record":{"id":"d2288e354a5883f9","repo":"risingwavelabs/risingwave","slug":"expression-error-0","errorCode":null,"errorMessage":"Expression error: {0}","messagePattern":"Expression error: (.+?)","errorType":"error_code","errorClass":"StreamError","httpStatus":null,"severity":"error","filePath":"src/stream/src/error.rs","lineNumber":47,"sourceCode":"\n/// The error type for streaming tasks.\n#[derive(\n    thiserror::Error,\n    thiserror_ext::ReportDebug,\n    thiserror_ext::Arc,\n    thiserror_ext::ContextInto,\n    thiserror_ext::Construct,\n)]\n#[thiserror_ext(newtype(name = StreamError, backtrace))]\npub enum ErrorKind {\n    #[error(\"Storage error: {0}\")]\n    Storage(\n        #[backtrace]\n        #[from]\n        StorageError,\n    ),\n\n    #[error(\"Expression error: {0}\")]\n    Expression(\n        #[from]\n        #[backtrace]\n        ExprError,\n    ),\n\n    #[error(\"Executor error: {0}\")]\n    Executor(\n        #[from]\n        #[backtrace]\n        StreamExecutorError,\n    ),\n\n    #[error(\"Actor {actor_id} exited unexpectedly: {source}\")]\n    UnexpectedExit {\n        actor_id: ActorId,\n        #[backtrace]\n        source: StreamError,","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/stream/src/error.rs#L29-L65","documentation":"This is the Expression variant of the stream engine ErrorKind: an ExprError from evaluating a scalar/aggregate expression inside a streaming operator is wrapped as `Expression error: {0}`. The underlying ExprError carries the real cause (type mismatch, unsupported function, constant evaluation failure, etc.).","triggerScenarios":"Any expression evaluation failure in the stream path — e.g. a projector, filter, or aggregate calling an expression that returns Err(ExprError) — converted via `#[from] ExprError`.","commonSituations":"Query uses a function with unsupported argument types at runtime; NULL handling mismatches; user data triggers a division-by-zero or cast failure inside a streaming expression.","solutions":["Read the inner ExprError for the failing expression and reason","Fix the query: correct argument types, add NULL guards, or cast explicitly","Replace unsupported functions with supported equivalents","Update RisingWave if the expression should be supported (check the function support matrix)"],"exampleFix":"// before: may divide by zero at runtime\nCREATE MATERIALIZED VIEW mv AS SELECT a / b FROM t;\n// after\nCREATE MATERIALIZED VIEW mv AS SELECT CASE WHEN b = 0 THEN NULL ELSE a / b END FROM t;","handlingStrategy":"try-catch","validationCode":"// validate query expressions in a dry-run before creating the MV:\n// EXPLAIN CREATE MATERIALIZED VIEW ... / test expressions in psql first","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if matches!(e.root_cause_downcast_ref::<ExprError>(), Some(_)) => {\n        log::error!(\"expression failed: {e}\");\n        // fix query or skip datum\n    }\n    other => other,\n}","preventionTips":["Add NULL guards and explicit casts in queries","Verify function signatures against RisingWave's supported functions","Test expressions against representative data before streaming"],"tags":["rust","streaming","expression","sql"],"backgroundTag":"invalid-argument-value","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"}