fix: handle empty not() expression

This commit is contained in:
Tushar Vats
2026-02-03 04:24:19 +05:30
committed by GitHub
parent afdb674068
commit 7d943923e5

View File

@@ -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)
}