cube-js/cube · error
compareDateRange drillDown query is not currently supported
Error message
compareDateRange drillDown query is not currently supported
What it means
ResultSet.drillDown() builds the underlying detail query for a clicked cell, but drill-down for compareDateRange queries (multiple date ranges compared in one query) has no single unambiguous source query, so the method explicitly refuses and throws. This is a deliberate 'not implemented' guard, not a runtime failure of your data or config.
Source
Thrown at packages/cubejs-client-core/src/ResultSet.ts:202
* // An example for React
* const drillDownResponse = useCubeQuery(
* {
* ...drillDownQuery,
* limit: 30,
* order: {
* 'Orders.ts': 'desc'
* }
* },
* {
* skip: !drillDownQuery
* }
* );
* ```
* @returns Drill down query
*/
public drillDown(drillDownLocator: DrillDownLocator, pivotConfig?: PivotConfig): Query | null {
if (this.queryType === QUERY_TYPE.COMPARE_DATE_RANGE_QUERY) {
throw new Error('compareDateRange drillDown query is not currently supported');
}
if (this.queryType === QUERY_TYPE.BLENDING_QUERY) {
throw new Error('Data blending drillDown query is not currently supported');
}
const { query } = this.loadResponses[0];
const xValues = drillDownLocator?.xValues ?? [];
const yValues = drillDownLocator?.yValues ?? [];
const normalizedPivotConfig = this.normalizePivotConfig(pivotConfig);
const values: string[][] = [];
normalizedPivotConfig?.x.forEach((member, currentIndex) => values.push([member, xValues[currentIndex]]));
normalizedPivotConfig?.y.forEach((member, currentIndex) => values.push([member, yValues[currentIndex]]));
const { filters: parentFilters = [], segments = [] } = this.query();
const { measures, timeDimensions: timeDimensionsAnnotation } = this.loadResponses[0].annotation;
let [, measureName] = values.find(([member]) => member === 'measures') || [];
View on GitHub (pinned to 7d981676b3)
Solutions
- Disable/omit the drillDown handler for charts whose query uses compareDateRange.
- Restructure the comparison as two separate regular queries (one per date range) so drillDown works on each ResultSet.
- Implement the drill-down query manually: derive measure/dimension members from the pivot and apply the specific date-range filter yourself.
- Track Cube client releases for compareDateRange drillDown support before relying on it.
Example fix
// before
onClick={() => {
const q = resultSet.drillDown({ xValues, yValues }); // throws for compareDateRange
if (q) runDrill(q);
}}
// after
onClick={() => {
if (resultSet.queryType === 'compareDateRange') return; // skip drill-down
const q = resultSet.drillDown({ xValues, yValues });
if (q) runDrill(q);
}} Defensive patterns
Strategy: validation
Validate before calling
function canDrillDown(resultSet) {
const unsupported = ['compareDateRange', 'blending'];
return resultSet && !unsupported.includes(resultSet.queryType);
}
// usage
onClick={() => { if (canDrillDown(resultSet)) { const q = resultSet.drillDown(loc); } }} Type guard
function isDrillable(rs: ResultSet): boolean {
return rs.queryType !== 'compareDateRange' && rs.queryType !== 'blending';
} Try / catch
let drillQuery = null;
try {
drillQuery = resultSet.drillDown({ xValues, yValues }, pivotConfig);
} catch (e) {
if (/drillDown query is not currently supported/.test(e.message)) {
drillQuery = null; // hide drill-down UI for unsupported query types
} else { throw e; }
} Prevention
- Gate drill-down UI (cell click handlers) on resultSet.queryType === 'regular'.
- Wrap drillDown calls in a shared helper that returns null for unsupported query types.
- Prefer two separate regular queries over compareDateRange when drill-down is required.
- For blended charts, attach drill-down to the underlying per-query ResultSets instead.
- Re-check client changelogs for drill-down support of compareDateRange/blending.
When it happens
Trigger: Calling resultSet.drillDown(locator, pivotConfig) on a ResultSet whose queryType is 'compareDateRange' (returned by the server for a multi-range timeDimension comparison), e.g. the user clicks a chart cell in a period-over-period comparison wired to drillDown.
Common situations: Dashboard libraries that attach drill-down handlers generically to every ResultSet; an app that recently switched a chart from a single date range to compareDateRange without removing the drillDown handler.
Related errors
- Data blending drillDown query is not currently supported
- Method is not supported for a '${this.queryType}' query type
- Unable to create schema, Druid does not support it
- Unload is not supported
- Distributed approximate distinct count is not supported by t
AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02).
Data as JSON: /api/errors/a314453c82891991.
Report an issue: GitHub.