{"record":{"id":"cfb5174f082e545e","repo":"temporalio/temporal","slug":"invalid-value-s","errorCode":null,"errorMessage":"invalid value: %s","messagePattern":"invalid value: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/archiver/gcloud/query_parser.go","lineNumber":115,"sourceCode":"}\n\nfunc (p *queryParser) convertAndExpr(andExpr *sqlparser.AndExpr, parsedQuery *parsedQuery) error {\n\tif err := p.convertWhereExpr(andExpr.Left, parsedQuery); err != nil {\n\t\treturn err\n\t}\n\treturn p.convertWhereExpr(andExpr.Right, parsedQuery)\n}\n\nfunc (p *queryParser) convertComparisonExpr(compExpr *sqlparser.ComparisonExpr, parsedQuery *parsedQuery) error {\n\tcolName, ok := compExpr.Left.(*sqlparser.ColName)\n\tif !ok {\n\t\treturn fmt.Errorf(\"invalid filter name: %s\", sqlparser.String(compExpr.Left))\n\t}\n\tcolNameStr := sqlparser.String(colName)\n\top := compExpr.Operator\n\tvalExpr, ok := compExpr.Right.(*sqlparser.SQLVal)\n\tif !ok {\n\t\treturn fmt.Errorf(\"invalid value: %s\", sqlparser.String(compExpr.Right))\n\t}\n\tvalStr := sqlparser.String(valExpr)\n\n\tswitch colNameStr {\n\tcase WorkflowID:\n\t\tval, err := sqlquery.ExtractStringValue(valStr)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif op != \"=\" {\n\t\t\treturn fmt.Errorf(\"only operation = is support for %s\", WorkflowID)\n\t\t}\n\t\tif parsedQuery.workflowID != nil && *parsedQuery.workflowID != val {\n\t\t\tparsedQuery.emptyResult = true\n\t\t\treturn nil\n\t\t}\n\t\tparsedQuery.workflowID = new(val)\n\tcase RunID:","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/temporalio/temporal/blob/bde624efd13fbd3843654058db6d9c716166318b/common/archiver/gcloud/query_parser.go#L97-L133","documentation":"convertComparisonExpr requires the right side of a comparison to be a sqlparser.SQLVal (a literal string/number). If the right operand is any other SQL expression — a column, function, or computed value — it returns 'invalid value: %s'. The archiver query language only supports column = literal comparisons.","triggerScenarios":"Queries like `WHERE WorkflowId = RunId`, `WHERE CloseTime > NOW()`, or `WHERE WorkflowId = CONCAT('a','b')` where the right side is not a literal value.","commonSituations":"Translating relational-SQL queries to the archiver search syntax; users expecting full SQL semantics in the archive search bar.","solutions":["Replace the right-hand expression with a quoted literal, e.g. WorkflowId = 'mywf'","Compute values (dates, concatenated IDs) in the client before building the query","Avoid column-to-column comparisons — they are unsupported in archive queries"],"exampleFix":"// before\nWHERE WorkflowId = RunId\n// after\nWHERE WorkflowId = 'my-workflow-id'","handlingStrategy":"validation","validationCode":"// Right side must be a quoted literal:\n// valid:   WorkflowId = 'abc'\n// invalid: WorkflowId = RunId / NOW() / CONCAT(...)\nif !literalRe.MatchString(rightOperand) {\n  return errors.New(\"right-hand side must be a quoted literal\")\n}\nvar literalRe = regexp.MustCompile(`^'[^']*'$`)","typeGuard":"func isQuotedLiteral(s string) bool { return len(s) >= 2 && strings.HasPrefix(s, \"'\") && strings.HasSuffix(s, \"'\") }","tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"invalid value\") {\n  return fmt.Errorf(\"archive query right-hand side must be a literal: %w\", err)\n}","preventionTips":["Always quote literal values in archive queries","Precompute dates/IDs client-side instead of using SQL functions","Do not compare column to column in archive queries"],"tags":["go","archiver","gcloud","query-parser"],"backgroundTag":"invalid-query-filter-value","analyzedSha":"bde624efd13fbd3843654058db6d9c716166318b","analyzedAt":"2026-09-01T07:18:39.080Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}