cube-js/cube · error · UserError
Not implemented yet
Error message
Not implemented yet
What it means
CrateDB adapter inherits Postgres but does not implement HLL (HyperLogLog) initialization SQL, so hllInit unconditionally throws 'Not implemented yet'. Approximate distinct counting that requires HLL init on the source dialect cannot run on CrateDB.
Source
Thrown at packages/cubejs-schema-compiler/src/adapter/CrateQuery.ts:6
import { PostgresQuery } from './PostgresQuery';
import { UserError } from '../compiler/UserError';
export class CrateQuery extends PostgresQuery {
public hllInit(_sql): string {
throw new UserError('Not implemented yet');
}
public hllMerge(_sql): string {
throw new UserError('Not implemented yet');
}
public countDistinctApprox(sql: string): string {
return `hyperloglog_distinct(${sql})`;
}
public sqlTemplates() {
const templates = super.sqlTemplates();
delete templates.functions.WIDTH_BUCKET;
return templates;
}
}
View on GitHub (pinned to 7d981676b3)
Solutions
- Use exact distinct count instead of the approximate variant (plain `type: 'countDistinct'`).
- Use CrateDB's native `hyperloglog_distinct` path via countDistinctApprox which is implemented (hllMerge/hllInit are not).
- Contribute an implementation of hllInit in a custom query subclass extending CrateQuery.
Example fix
// before
measures: { users: { type: 'countDistinctApprox', sql: `${CUBE}.userId` } }
// after
measures: { users: { type: 'countDistinct', sql: `${CUBE}.userId` } } Defensive patterns
Strategy: fallback
Validate before calling
if (dbType === 'cratedb' && measure.type === 'countDistinctApprox') {
console.warn('HLL init not implemented for CrateDB; use countDistinct');
} Try / catch
try { await cube.load(q) } catch (e) { if (/Not implemented yet/.test(e.message)) { return cube.load({ ...q, measures: exactMeasures }); } throw e; } Prevention
- Check dialect support for approximate counts before adopting countDistinctApprox
- Use exact countDistinct on CrateDB
- Review adapter subclass overrides before porting schemas
When it happens
Trigger: Calling countDistinctApprox-adjacent SQL generation that routes to hllInit on a CrateDB datasource — typically when an approximate distinct measure (approximateUnique style) triggers HLL aggregation in a sub-query.
Common situations: Using approximate distinct count measures in a project pointed at CrateDB; porting a Postgres schema using HLL extensions to CrateDB.
Related errors
- Driver's .streamQuery() method is not implemented yet.
- Distributed approximate distinct count is not supported by t
- Not implemented
- not implemented
AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02).
Data as JSON: /api/errors/730f618c93997bfb.
Report an issue: GitHub.