temporalio/temporal · error
only comparison and "and" expression is supported
Error message
only comparison and "and" expression is supported
What it means
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.
Source
Thrown at common/archiver/filestore/query_parser.go:84
return nil, err
}
return parsedQuery, nil
}
func (p *queryParser) convertWhereExpr(expr sqlparser.Expr, parsedQuery *parsedQuery) error {
if expr == nil {
return errors.New("where expression is nil")
}
switch expr := expr.(type) {
case *sqlparser.ComparisonExpr:
return p.convertComparisonExpr(expr, parsedQuery)
case *sqlparser.AndExpr:
return p.convertAndExpr(expr, parsedQuery)
case *sqlparser.ParenExpr:
return p.convertParenExpr(expr, parsedQuery)
default:
return errors.New("only comparison and \"and\" expression is supported")
}
}
func (p *queryParser) convertParenExpr(parenExpr *sqlparser.ParenExpr, parsedQuery *parsedQuery) error {
return p.convertWhereExpr(parenExpr.Expr, parsedQuery)
}
func (p *queryParser) convertAndExpr(andExpr *sqlparser.AndExpr, parsedQuery *parsedQuery) error {
if err := p.convertWhereExpr(andExpr.Left, parsedQuery); err != nil {
return err
}
return p.convertWhereExpr(andExpr.Right, parsedQuery)
}
func (p *queryParser) convertComparisonExpr(compExpr *sqlparser.ComparisonExpr, parsedQuery *parsedQuery) error {
colName, ok := compExpr.Left.(*sqlparser.ColName)
if !ok {
return fmt.Errorf("invalid filter name: %s", sqlparser.String(compExpr.Left))View on GitHub (pinned to bde624efd1)
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.
Example fix
// before q := "RunId = 'abc' OR WorkflowId = 'def'" // error: only comparison and "and" expression is supported // after q := "RunId = 'abc'" // plus a second query for WorkflowId = 'def'
Defensive patterns
Strategy: validation
Validate before calling
if strings.Contains(strings.ToLower(query), " or ") {
return nil, errors.New("filestore archival visibility supports only comparisons joined by AND")
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: Users attempt OR filters or keyword searches against filestore archival visibility; queries written for Elasticsearch visibility pasted into a filestore-backed namespace.
Related errors
- only comparison and "and" expression is supported
- where expression is nil
- SearchPrecision is required when searching for a StartTime o
- where expression is nil
- unknown archiver scheme
AI-assisted analysis of temporalio/temporal@bde624efd1 (2026-09-01).
Data as JSON: /api/errors/16967768c5791c29.
Report an issue: GitHub.