{"record":{"id":"bc70f913769c8234","repo":"risingwavelabs/risingwave","slug":"parse-error-0-bc70f9","errorCode":null,"errorMessage":"Parse error: {0}","messagePattern":"Parse error: (.+?)","errorType":"exception","errorClass":"ExprError","httpStatus":null,"severity":"error","filePath":"src/expr/core/src/error.rs","lineNumber":70,"sourceCode":"    #[error(\"Unsupported cast: {0} to {1}\")]\n    UnsupportedCast(DataType, DataType),\n\n    #[error(\"Casting to {0} out of range\")]\n    CastOutOfRange(&'static str),\n\n    #[error(\"Numeric out of range\")]\n    NumericOutOfRange,\n\n    #[error(\"Numeric out of range: underflow\")]\n    NumericUnderflow,\n\n    #[error(\"Numeric out of range: overflow\")]\n    NumericOverflow,\n\n    #[error(\"Division by zero\")]\n    DivisionByZero,\n\n    #[error(\"Parse error: {0}\")]\n    // TODO(error-handling): should prefer use error types than strings.\n    Parse(Box<str>),\n\n    #[error(\"Invalid parameter {name}: {reason}\")]\n    // TODO(error-handling): should prefer use error types than strings.\n    InvalidParam {\n        name: &'static str,\n        reason: Box<str>,\n    },\n\n    #[error(\"Array error: {0}\")]\n    Array(\n        #[from]\n        #[backtrace]\n        ArrayError,\n    ),\n\n    #[error(\"More than one row returned by {0} used as an expression\")]","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/expr/core/src/error.rs#L52-L88","documentation":"ExprError::Parse(Box<str>) is thrown when parsing textual input into a typed value or expression fails. The Box<str> carries the free-form parse failure message. The source notes a TODO that string-based parsing errors should be replaced with structured error types, so the payload is unstructured and best used for display, not programmatic matching.","triggerScenarios":"Casting/parsing a string to a typed value (e.g. `'abc'::int`, `to_timestamp`, decimal parsing) inside expression evaluation; any expression-function that parses text and maps its internal parse failure into ExprError.","commonSituations":"Dirty input data feeding a cast, locale/format mismatches in date or numeric literals, ingestion of malformed strings that are later cast in a materialized view, version changes tightening strictness of type parsing.","solutions":["Validate/cleanse the input before it reaches the cast, or use a fallible cast pattern that returns NULL on bad input.","Fix the offending literal/data value indicated in the parse message.","Pre-cast at ingestion time with explicit handling of invalid rows (reject or default them)."],"exampleFix":"// before\nSELECT '12x3'::int;\n// after\nSELECT CASE WHEN '12x3' ~ '^[0-9]+$' THEN '12x3'::int ELSE NULL END;","handlingStrategy":"validation","validationCode":"-- pre-validate before cast\nSELECT CASE WHEN val ~ '^[0-9]+$' THEN val::int ELSE NULL END FROM t;","typeGuard":null,"tryCatchPattern":"// Treat as data-quality issue; catch and route to a dead-letter path\nmatch eval_result {\n    Err(e) if e.to_string().starts_with(\"Parse error\") => quarantine(row, e),\n    other => other?,\n}","preventionTips":["Validate string formats at ingestion, before casts run in queries.","Prefer explicit, strict literals in SQL; avoid casting raw user text inline.","Keep date/numeric parsing in a single well-tested helper expression."],"tags":["rust","parsing","cast"],"backgroundTag":"invalid-argument-format","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"}