Skip to content

Commit 6b1fadb

Browse files
authored
feat(duckdb-driver): Support countDistinctApprox (#6409)
1 parent 918fa56 commit 6b1fadb

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

packages/cubejs-duckdb-driver/src/DuckDBQuery.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,8 @@ export class DuckDBQuery extends BaseQuery {
2626
public timeGroupedColumn(granularity: string, dimension: string) {
2727
return GRANULARITY_TO_INTERVAL[granularity](dimension);
2828
}
29+
30+
public countDistinctApprox(sql: string) {
31+
return `approx_count_distinct(${sql})`;
32+
}
2933
}

packages/cubejs-schema-compiler/src/adapter/BaseQuery.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2029,18 +2029,15 @@ class BaseQuery {
20292029
return evaluateSql;
20302030
}
20312031

2032-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
2033-
hllInit(sql) {
2032+
hllInit(_sql) {
20342033
throw new UserError('Distributed approximate distinct count is not supported by this DB');
20352034
}
20362035

2037-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
2038-
hllMerge(sql) {
2036+
hllMerge(_sql) {
20392037
throw new UserError('Distributed approximate distinct count is not supported by this DB');
20402038
}
20412039

2042-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
2043-
hllCardinality(sql) {
2040+
hllCardinality(_sql) {
20442041
throw new UserError('Distributed approximate distinct count is not supported by this DB');
20452042
}
20462043

0 commit comments

Comments
 (0)