aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/query
diff options
context:
space:
mode:
authorJP Appel <jeanpierre.appel01@gmail.com>2025-08-10 20:39:00 -0400
committerJP Appel <jeanpierre.appel01@gmail.com>2025-08-10 20:39:00 -0400
commit49a2d76d2be793f9aeddd9997ae8abba4a7f03f2 (patch)
tree1e831080aed8ba488706ba3484c01dcd5489cbb6 /pkg/query
parent92de2b63b6bd0642b92e7ca1c6110bab7f3a2e6b (diff)
Fix approximate queries on nullable categories
Diffstat (limited to 'pkg/query')
-rw-r--r--pkg/query/compiler.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/query/compiler.go b/pkg/query/compiler.go
index dc6f93a..7d24b10 100644
--- a/pkg/query/compiler.go
+++ b/pkg/query/compiler.go
@@ -146,6 +146,8 @@ func (s Statements) buildCompile(b *strings.Builder, delim string) ([]any, error
b.WriteString(") ")
} else if cat.IsSet() && op == OP_AP {
b.WriteString("( ")
+ b.WriteString(catStr)
+ b.WriteString("IS NOT NULL AND ")
idx := 0
for _, stmt := range opStmts {
b.WriteString(catStr)
@@ -188,6 +190,11 @@ func (s Statements) buildCompile(b *strings.Builder, delim string) ([]any, error
}
} else {
idx := 0
+ if op == OP_AP {
+ b.WriteString("( ")
+ b.WriteString(catStr)
+ b.WriteString("IS NOT NULL AND ")
+ }
for _, stmt := range opStmts {
if stmt.Negated {
b.WriteString("NOT ")
@@ -206,6 +213,9 @@ func (s Statements) buildCompile(b *strings.Builder, delim string) ([]any, error
idx++
sCount++
}
+ if op == OP_AP {
+ b.WriteString(") ")
+ }
}
if sCount != len(s) {