{"record":{"id":"16967768c5791c29","repo":"temporalio/temporal","slug":"only-comparison-and-and-expression-is-supported-169677","errorCode":null,"errorMessage":"only comparison and \"and\" expression is supported","messagePattern":"only comparison and \"and\" expression is supported","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/archiver/filestore/query_parser.go","lineNumber":84,"sourceCode":"\t\treturn nil, err\n\t}\n\treturn parsedQuery, nil\n}\n\nfunc (p *queryParser) convertWhereExpr(expr sqlparser.Expr, parsedQuery *parsedQuery) error {\n\tif expr == nil {\n\t\treturn errors.New(\"where expression is nil\")\n\t}\n\n\tswitch expr := expr.(type) {\n\tcase *sqlparser.ComparisonExpr:\n\t\treturn p.convertComparisonExpr(expr, parsedQuery)\n\tcase *sqlparser.AndExpr:\n\t\treturn p.convertAndExpr(expr, parsedQuery)\n\tcase *sqlparser.ParenExpr:\n\t\treturn p.convertParenExpr(expr, parsedQuery)\n\tdefault:\n\t\treturn errors.New(\"only comparison and \\\"and\\\" expression is supported\")\n\t}\n}\n\nfunc (p *queryParser) convertParenExpr(parenExpr *sqlparser.ParenExpr, parsedQuery *parsedQuery) error {\n\treturn p.convertWhereExpr(parenExpr.Expr, parsedQuery)\n}\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))","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/temporalio/temporal/blob/bde624efd13fbd3843654058db6d9c716166318b/common/archiver/filestore/query_parser.go#L66-L102","documentation":"Filestore variant of the unsupported-expression error, thrown by filestore queryParser.convertWhereExpr when the WHERE clause uses anything other than ComparisonExpr, AndExpr, or ParenExpr. The filestore visibility parser supports only this small SQL subset against the local filesystem blobstore.","triggerScenarios":"Parse(\"WorkflowId = 'x' OR RunId = 'y'\") (OrExpr), NOT expressions, LIKE/function expressions, or any other sqlparser node type reaching the default branch via Parse, convertParenExpr, or convertAndExpr.","commonSituations":"Users attempt OR filters or keyword searches against filestore archival visibility; queries written for Elasticsearch visibility pasted into a filestore-backed namespace.","solutions":["Rewrite using only equality/range comparisons joined with AND, e.g. `WorkflowId = 'my-workflow'`.","Split OR conditions into multiple queries and merge results client-side.","If richer query semantics are needed, switch the namespace visibility store to Elasticsearch or SQL.","Use parentheses freely — ParenExpr is supported and just recurses into the inner expression."],"exampleFix":"// before\nq := \"RunId = 'abc' OR WorkflowId = 'def'\" // error: only comparison and \"and\" expression is supported\n\n// after\nq := \"RunId = 'abc'\" // plus a second query for WorkflowId = 'def'","handlingStrategy":"validation","validationCode":"if strings.Contains(strings.ToLower(query), \" or \") {\n\treturn nil, errors.New(\"filestore archival visibility supports only comparisons joined by AND\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use only =, <, >, <=, >=, != with AND and parentheses in filestore queries.","Split OR conditions into multiple queries and union results in application code.","Consider Elasticsearch visibility if expressive queries are a requirement."],"tags":["archival","filestore","query-parsing","unsupported-operation"],"backgroundTag":"unsupported-query-expression","analyzedSha":"bde624efd13fbd3843654058db6d9c716166318b","analyzedAt":"2026-09-01T07:18:39.080Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}