mirror of
https://github.com/SigNoz/signoz.git
synced 2026-02-03 08:33:26 +00:00
fix: handle empty not() expression
This commit is contained in:
@@ -280,6 +280,11 @@ func (v *filterExpressionVisitor) VisitUnaryExpression(ctx *grammar.UnaryExpress
|
||||
|
||||
// Check if this is a NOT expression
|
||||
if ctx.NOT() != nil {
|
||||
// If the inner expression is empty (filtered out), return empty
|
||||
// to avoid generating invalid "not()" in ClickHouse
|
||||
if result == "" {
|
||||
return ""
|
||||
}
|
||||
return fmt.Sprintf("NOT (%s)", result)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user