{"record":{"id":"0c3964c7e78614c3","repo":"cube-js/cube","slug":"unsupported-table-data-passed-to-this-constructo","errorCode":null,"errorMessage":"Unsupported table data passed to ${this.constructor}","messagePattern":"Unsupported table data passed to (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cubejs-cubestore-driver/src/CubeStoreDriver.ts","lineNumber":281,"sourceCode":"    const indexes = createTableIndexes?.length ? createTableIndexes.map(this.createIndexString).join(' ') : '';\n\n    let hasAggregatingIndexes = false;\n    if (createTableIndexes?.length) {\n      hasAggregatingIndexes = createTableIndexes.some((index) => index.type === 'aggregate');\n    }\n\n    const aggregations = hasAggregatingIndexes && aggregationsColumns?.length ? ` AGGREGATIONS (${aggregationsColumns.join(', ')})` : '';\n\n    if (tableData.rowStream) {\n      await this.importStream(columns, tableData, table, indexes, aggregations, queryTracingObj);\n    } else if (tableData.csvFile) {\n      await this.importCsvFile(tableData, table, columns, indexes, aggregations, queryTracingObj);\n    } else if (tableData.streamingSource) {\n      await this.importStreamingSource(columns, tableData, table, indexes, uniqueKeyColumns, queryTracingObj, externalOptions?.sealAt);\n    } else if (tableData.rows) {\n      await this.importRows(table, columns, indexes, aggregations, tableData, queryTracingObj);\n    } else {\n      throw new Error(`Unsupported table data passed to ${this.constructor}`);\n    }\n  }\n\n  private createIndexString(index: CreateTableIndex) {\n    const prefix = {\n      regular: '',\n      aggregate: 'AGGREGATE '\n    }[index.type] || '';\n    return `${prefix}INDEX ${index.indexName} (${index.columns.join(',')})`;\n  }\n\n  private async importRows(table: string, columns: Column[], indexesSql: any, aggregations: any, tableData: DownloadTableMemoryData, queryTracingObj?: any) {\n    if (!columns || columns.length === 0) {\n      throw new Error('Unable to import (as rows) in Cube Store: empty columns. Most probably, introspection has failed.');\n    }\n\n    await this.createTableWithOptions(table, columns, { indexes: indexesSql, aggregations, buildRangeEnd: queryTracingObj?.buildRangeEnd }, queryTracingObj);\n    try {","sourceCodeStart":263,"sourceCodeEnd":299,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-cubestore-driver/src/CubeStoreDriver.ts#L263-L299","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nawait driver.uploadTable(table, columns, { data: result }); // unsupported shape\n// after\nawait driver.uploadTable(table, columns, { rows: result });","handlingStrategy":"validation","validationCode":"if (!tableData || (!tableData.rows && !tableData.csvFile && !tableData.streamingSource)) {\n  throw new Error('tableData must contain rows, csvFile, or streamingSource');\n}\nawait driver.uploadTable(table, columns, tableData);","typeGuard":"function isSupportedTableData(d: any): boolean {\n  return !!d && (Array.isArray(d.rows) || !!d.csvFile || !!d.streamingSource);\n}","tryCatchPattern":"try {\n  await driver.uploadTable(table, columns, tableData);\n} catch (e) {\n  if (e.message.includes('Unsupported table data passed to')) {\n    console.error('tableData shape not recognized:', Object.keys(tableData || {}));\n  }\n  throw e;\n}","preventionTips":["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."],"tags":["cubestore","pre-aggregation","data-format"],"backgroundTag":"unsupported-table-data","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}