We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d75e1fa commit ebe9c82Copy full SHA for ebe9c82
lib/clients/ValueCounts.ts
@@ -68,16 +68,20 @@ export class ValueCounts extends MosaicClient {
68
}
69
70
override query(filter: Array<ExprNode> = []): Query {
71
+ let col = column(this.#column);
72
let counts = Query
73
.from({ source: this.#table })
74
.select({
75
value: sql`CASE
- WHEN ${column(this.#column)} IS NULL THEN '__quak_null__'
76
- ELSE ${column(this.#column)}
+ WHEN ${col} IS NULL THEN '__quak_null__'
77
+ ELSE CAST(${col} AS VARCHAR)
78
END`,
79
count: count(),
80
})
- .groupby("value")
81
+ .groupby(sql`CASE
82
83
84
+ END`)
85
.where(filter);
86
return Query
87
.with({ counts })
0 commit comments