cube-js/cube · error · Error

${this.constructor} driver supports only rows upload

Error message

${this.constructor} driver supports only rows upload

What it means

A capability guard in AuroraServerlessMySqlDriver.uploadTableWithIndexes: the Aurora Data API cannot perform bulk file/stream loads (no LOAD DATA), so table upload only supports the rows path (tableData.rows). Throwing when tableData.rows is absent (e.g. a CSV-file-based load was requested) prevents an unsupported upload strategy. The input at fault is a TableData carrying something other than row arrays, such as an export-bucket CSV reference.

Source

Thrown at packages/cubejs-mysql-aurora-serverless-driver/driver/AuroraServerlessMySqlDriver.js:166

  toColumnValue(value, genericType) {
    if (genericType === 'timestamp' && typeof value === 'string') {
      return value && value.replace('Z', '');
    }
    if (genericType === 'boolean' && typeof value === 'string') {
      if (value.toLowerCase() === 'true') {
        return true;
      }
      if (value.toLowerCase() === 'false') {
        return false;
      }
    }
    return super.toColumnValue(value, genericType);
  }

  async uploadTableWithIndexes(table, columns, tableData, indexesSql) {
    if (!tableData.rows) {
      throw new Error(`${this.constructor} driver supports only rows upload`);
    }
    await this.createTable(table, columns);
    try {
      const batchSize = 1000; // TODO make dynamic?
      for (let j = 0; j < Math.ceil(tableData.rows.length / batchSize); j++) {
        const currentBatchSize = Math.min(tableData.rows.length - j * batchSize, batchSize);
        const indexArray = Array.from({ length: currentBatchSize }, (v, i) => i);
        const valueParamPlaceholders =
          indexArray.map(i => `(${columns.map((c, paramIndex) => this.param(paramIndex + i * columns.length)).join(', ')})`).join(', ');
        const params = indexArray.map(i => columns
          .map(c => this.toColumnValue(tableData.rows[i + j * batchSize][c.name], c.type)))
          .reduce((a, b) => a.concat(b), []);

        await this.query(
          `INSERT INTO ${table}
            (${columns.map(c => this.quoteIdentifier(c.name)).join(', ')})
          VALUES ${valueParamPlaceholders}`,
          params

View on GitHub (pinned to 7d981676b3)

Solutions

  1. Provide tableData.rows (an in-memory rows array) instead of a CSV/stream when uploading to Aurora Serverless MySQL
  2. Generate the rows payload upstream (e.g. from a query result set) since this driver cannot stream-upload via CSV
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/cubejs-mysql-aurora-serverless-driver/driver/AuroraServerlessMySqlDriver.js:166 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/275eb416d361ceda. Report an issue: GitHub.