{"record":{"id":"94dda92dc14fc182","repo":"risingwavelabs/risingwave","slug":"proctime-now-number-or-string","errorCode":null,"errorMessage":"proctime(), now(), number or string","messagePattern":"proctime\\(\\), now\\(\\), number or string","errorType":"validation","errorClass":"ParserError","httpStatus":null,"severity":"error","filePath":"src/sqlparser/src/parser.rs","lineNumber":4508,"sourceCode":"                        (\n                            Self::parse_identifier.verify(|ident| ident.real_value() == \"now\"),\n                            cut_err(Token::LParen),\n                            cut_err(Token::RParen),\n                        )\n                            .value(AsOf::ProcessTimeWithInterval((\n                                \"0\".to_owned(),\n                                DateTimeField::Second,\n                            ))),\n                        (\n                            Self::parse_identifier.verify(|ident| ident.real_value() == \"proctime\"),\n                            cut_err(Token::LParen),\n                            cut_err(Token::RParen),\n                        )\n                            .value(AsOf::ProcessTime),\n                        literal_i64.map(AsOf::TimestampNum),\n                        single_quoted_string.map(AsOf::TimestampString),\n                    ))\n                    .expect(\"proctime(), now(), number or string\"),\n                ),\n            ),\n            preceded(\n                (Keyword::SYSTEM_VERSION, Keyword::AS, Keyword::OF),\n                cut_err(\n                    alt((\n                        literal_i64.map(AsOf::VersionNum),\n                        single_quoted_string.map(AsOf::VersionString),\n                    ))\n                    .expect(\"number or string\"),\n                ),\n            ),\n        ))\n        .parse_next(self)\n    }\n\n    /// Parse a possibly qualified, possibly quoted identifier, e.g.\n    /// `foo` or `myschema.\"table\"","sourceCodeStart":4490,"sourceCodeEnd":4526,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/sqlparser/src/parser.rs#L4490-L4526","documentation":"Raised while parsing a temporal filter `FOR SYSTEM_TIME AS OF ...` clause: after AS OF, the parser accepts proctime(), now(), an integer literal, or a single-quoted string; anything else fails `.expect(\"proctime(), now(), number or string\")`. It indicates the AS OF timestamp expression is not one of the supported forms.","triggerScenarios":"Parsing `... FOR SYSTEM_TIME AS OF <expr>` where expr is a column reference, a function other than proctime()/now(), a double-quoted string, or missing entirely.","commonSituations":"Joins against a table written with dynamic timestamp expressions from application code; porting temporal-query syntax from other engines; templated SQL where the timestamp placeholder was substituted with an unsupported expression.","solutions":["Replace the expression with one of: `proctime()`, `now()`, an integer timestamp literal, or a single-quoted timestamp string.","Compute complex timestamps in the client and inline them as literals.","Check the AS OF clause is present and not truncated after SYSTEM_TIME."],"exampleFix":"// before\nSELECT * FROM t JOIN s FOR SYSTEM_TIME AS OF t.ts;\n// after\nSELECT * FROM t JOIN s FOR SYSTEM_TIME AS OF '2024-01-01 00:00:00';","handlingStrategy":"validation","validationCode":"function validAsOf(expr) {\n  return /^(proctime\\(\\)|now\\(\\))$/.test(expr) || /^\\d+$/.test(expr) || (/^'.*'$/.test(expr));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Inline timestamps as literals; never reference columns in AS OF.","Use proctime()/now() for dynamic time instead of expressions.","Render timestamps with single quotes in generated SQL."],"tags":["sql","parser","temporal-filter","syntax"],"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-23T08:17:48.524Z"}