cube-js/cube · error
Unload query is missed.
Error message
Unload query is missed.
What it means
Guard inside SnowflakeDriver's unloadWithSql path: the options/config for unloading data to an export bucket did not include the SQL query to run. It fires when exportBucket is configured and the driver is asked to export a table via UNLOAD but no source query was provided (e.g. an empty/missing query option in UnloadOptions), so there is nothing for Snowflake's COPY INTO <location> to unload.
Source
Thrown at packages/cubejs-snowflake-driver/src/SnowflakeDriver.ts:596
bucketName = `${bucketName}/${pathArr[0]}`;
exportPrefix = pathArr.length > 1 ? `${pathArr.slice(1).join('/')}/${tableName}` : tableName;
} else {
({ bucketName, path } = this.parseBucketUrl(this.config.exportBucket!.bucketName));
exportPrefix = path ? `${path}/${tableName}` : tableName;
}
return `${bucketType}://${bucketName}/${exportPrefix}/`;
}
/**
* Unload data from a SQL query to an export bucket.
*/
private async unloadWithSql(
tableName: string,
options: UnloadOptions,
): Promise<{ types: TableStructure, exportedCount: number }> {
if (!options.query) {
throw new Error('Unload query is missed.');
} else {
const types = await this.queryColumnTypes(options.query.sql, options.query.params);
const connection = await this.getConnection();
const bucketUrl = this.buildBucketUrl(tableName);
const unloadSql = `
COPY INTO '${bucketUrl}'
FROM (${options.query.sql})
${this.exportOptionsClause(options)}`;
const result = await this.execute<UnloadResponse[]>(
connection,
unloadSql,
options.query.params,
false,
);
if (!result) {
throw new Error('Missing `COPY INTO` query result.');
}View on GitHub (pinned to 7d981676b3)
Solutions
- Ensure the pre-aggregation plan passes a loadSql/query with sql and params in UnloadOptions
- Regenerate or refresh the pre-aggregation so a valid query is planned
- Upgrade cubejs-server-core / query-orchestrator if the caller is not populating options.query
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/cubejs-snowflake-driver/src/SnowflakeDriver.ts:596 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02).
Data as JSON: /api/errors/7b6eed96a22d7f87.
Report an issue: GitHub.