cube-js/cube · error
Unsupported table data passed to ${this.constructor}
Error message
Unsupported table data passed to ${this.constructor} What it means
CubeStoreDriver.uploadTableWithIndexes dispatches on the shape of tableData: csvFile, streamingSource, or rows. If none of these properties is present, the table data object is not a recognized DownloadTableData variant and the driver throws.
Source
Thrown at packages/cubejs-cubestore-driver/src/CubeStoreDriver.ts:281
const indexes = createTableIndexes?.length ? createTableIndexes.map(this.createIndexString).join(' ') : '';
let hasAggregatingIndexes = false;
if (createTableIndexes?.length) {
hasAggregatingIndexes = createTableIndexes.some((index) => index.type === 'aggregate');
}
const aggregations = hasAggregatingIndexes && aggregationsColumns?.length ? ` AGGREGATIONS (${aggregationsColumns.join(', ')})` : '';
if (tableData.rowStream) {
await this.importStream(columns, tableData, table, indexes, aggregations, queryTracingObj);
} else if (tableData.csvFile) {
await this.importCsvFile(tableData, table, columns, indexes, aggregations, queryTracingObj);
} else if (tableData.streamingSource) {
await this.importStreamingSource(columns, tableData, table, indexes, uniqueKeyColumns, queryTracingObj, externalOptions?.sealAt);
} else if (tableData.rows) {
await this.importRows(table, columns, indexes, aggregations, tableData, queryTracingObj);
} else {
throw new Error(`Unsupported table data passed to ${this.constructor}`);
}
}
private createIndexString(index: CreateTableIndex) {
const prefix = {
regular: '',
aggregate: 'AGGREGATE '
}[index.type] || '';
return `${prefix}INDEX ${index.indexName} (${index.columns.join(',')})`;
}
private async importRows(table: string, columns: Column[], indexesSql: any, aggregations: any, tableData: DownloadTableMemoryData, queryTracingObj?: any) {
if (!columns || columns.length === 0) {
throw new Error('Unable to import (as rows) in Cube Store: empty columns. Most probably, introspection has failed.');
}
await this.createTableWithOptions(table, columns, { indexes: indexesSql, aggregations, buildRangeEnd: queryTracingObj?.buildRangeEnd }, queryTracingObj);
try {View on GitHub (pinned to 7d981676b3)
Solutions
- Log/inspect the tableData object before upload to confirm it has rows, csvFile, or streamingSource.
- Ensure the source database driver returns a supported DownloadTableData structure.
- Check that cubejs-cubestore-driver and cubejs-query-orchestrator versions match.
- If data is in another format, convert to { rows: [...] } before calling uploadTable.
Example fix
// before
await driver.uploadTable(table, columns, { data: result }); // unsupported shape
// after
await driver.uploadTable(table, columns, { rows: result }); Defensive patterns
Strategy: validation
Validate before calling
if (!tableData || (!tableData.rows && !tableData.csvFile && !tableData.streamingSource)) {
throw new Error('tableData must contain rows, csvFile, or streamingSource');
}
await driver.uploadTable(table, columns, tableData); Type guard
function isSupportedTableData(d: any): boolean {
return !!d && (Array.isArray(d.rows) || !!d.csvFile || !!d.streamingSource);
} Try / catch
try {
await driver.uploadTable(table, columns, tableData);
} catch (e) {
if (e.message.includes('Unsupported table data passed to')) {
console.error('tableData shape not recognized:', Object.keys(tableData || {}));
}
throw e;
} Prevention
- Only pass DownloadTableMemoryData, DownloadTableCSVData, or streaming-source shaped objects.
- Convert custom data formats to { rows: [...] } before upload.
- Keep orchestrator and driver versions aligned.
- Log tableData keys before upload when debugging pre-aggregation builds.
When it happens
Trigger: uploadTable passed a tableData object that lacks rows, csvFile, and streamingSource — e.g. an empty object, a wrong type from a custom driver, or an orchestrator/driver version mismatch producing an unexpected data shape.
Common situations: Custom data source returning an unsupported table format; passing a result set from a DB driver that Cube Store driver doesn't understand; upgrading cubejs-server-core without updating the driver pipeline.
Related errors
- Unable to import (as rows) in Cube Store: empty columns. Mos
- Unable to detect column types for pre-aggregation on empty v
- Create table failed: ${e}
- Unable to import (as csv) in Cube Store: empty columns. Most
- Unable to import (as stream) in Cube Store: empty columns. M
AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02).
Data as JSON: /api/errors/0c3964c7e78614c3.
Report an issue: GitHub.