diff --git a/packages/cubejs-schema-compiler/src/adapter/RedshiftQuery.ts b/packages/cubejs-schema-compiler/src/adapter/RedshiftQuery.ts index 3a81d0a391d7f..b50053f9faf24 100644 --- a/packages/cubejs-schema-compiler/src/adapter/RedshiftQuery.ts +++ b/packages/cubejs-schema-compiler/src/adapter/RedshiftQuery.ts @@ -12,6 +12,18 @@ export class RedshiftQuery extends PostgresQuery { return 'GETDATE()'; } + public hllInit(sql) { + return `HLL_CREATE_SKETCH(${sql})`; + } + + public hllMerge(sql) { + return `HLL_CARDINALITY(HLL_COMBINE(HLL_CREATE_SKETCH(${sql})))`; + } + + public countDistinctApprox(sql) { + return `APPROXIMATE COUNT(DISTINCT ${sql})`; + } + public sqlTemplates() { const templates = super.sqlTemplates(); templates.functions.DLOG10 = 'LOG(10, {{ args_concat }})';