cube-js/cube · error · Error

Unload is not supported

Error message

Unload is not supported

What it means

FireboltDriver.unload() implements the DownloadTableCSV interface but Firebolt does not support the UNLOAD mechanism this interface relies on, so the method unconditionally throws 'Unload is not supported'.

Source

Thrown at packages/cubejs-firebolt-driver/src/FireboltDriver.ts:269

      return {
        rowStream,
        types,
      };
    } catch (error) {
      if ((<any>error).status === 401 && retry) {
        this.connection = null;
        return this.streamResponse(query, parameters, false);
      }
      if ((<any>error).status === 404 && retry) {
        await this.ensureEngineRunning();
        return this.streamResponse(query, parameters, false);
      }
      throw error;
    }
  }

  public async unload(): Promise<DownloadTableCSVData> {
    throw new Error('Unload is not supported');
  }

  private async ensureEngineRunning() {
    if (this.config.connection.engineName) {
      const engine = await this.firebolt.resourceManager.engine.getByName(this.config.connection.engineName);
      await engine.startAndWait();
    }
  }

  private async queryResponse(query: string, parameters?: unknown[], retry = true): Promise<{
    data: Row[];
    meta: Meta[];
  }> {
    try {
      const connection = await this.getConnection();

      const statement = await connection.execute(query, {
        settings: { output_format: OutputFormat.JSON, statement_timeout: this.config.requestTimeout },

View on GitHub (pinned to 7d981676b3)

Solutions

  1. Do not use unload()/CSV-table-export with Firebolt; use query()+downloadQueryResults to fetch data instead.
  2. Configure exportBucket with a supported driver if CSV export is required.
  3. Intercept calls in a wrapper driver and route them to query-based extraction.

Example fix

// before
const csv = await driver.unload();
// after
const { rows } = await driver.downloadQueryResults('SELECT * FROM t', [], {});
Defensive patterns

Strategy: fallback

Validate before calling

function supportsUnload(driver) {
  // Firebolt's unload always throws
  return driver.constructor.name !== 'FireboltDriver';
}
const csv = supportsUnload(driver)
  ? await driver.unload()
  : await driver.downloadQueryResults('SELECT * FROM t', [], {});

Try / catch

try {
  return await driver.unload();
} catch (e) {
  if (e.message === 'Unload is not supported') {
    return await driver.downloadQueryResults('SELECT * FROM t', [], {});
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling driver.unload() directly, or Cube flows that export a table to CSV via the driver's unload capability (e.g. export-bucket based pre-aggregation downloads) targeting a Firebolt datasource.

Common situations: Configuring downloadQueryResults/exportBucket flows that assume unload support; copying generic driver-dependent code from BigQuery/Snowflake setups to Firebolt.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02). Data as JSON: /api/errors/d10d5856b7bd17a0. Report an issue: GitHub.