cube-js/cube · error
Unable to import (as stream) in Cube Store: empty columns. M
Error message
Unable to import (as stream) in Cube Store: empty columns. Most probably, introspection has failed.
What it means
For streaming imports, importStream validates the columns array before creating the table in Cube Store. Empty columns again signals introspection failure — the driver cannot define the target table schema.
Source
Thrown at packages/cubejs-cubestore-driver/src/CubeStoreDriver.ts:351
aggregations
};
if (files.length > 0) {
options.inputFormat = tableData.csvNoHeader ? 'csv_no_header' : 'csv';
if (tableData.csvDelimiter) {
options.delimiter = tableData.csvDelimiter;
}
if (tableData.csvDisableQuoting) {
options.disableQuoting = tableData.csvDisableQuoting;
}
options.files = files;
}
return this.createTableWithOptions(table, columns, options, queryTracingObj);
}
private async importStream(columns: Column[], tableData: StreamTableData, table: string, indexes: string, aggregations: string, queryTracingObj?: any) {
if (!columns || columns.length === 0) {
throw new Error('Unable to import (as stream) in Cube Store: empty columns. Most probably, introspection has failed.');
}
const tempFiles: string[] = [];
try {
const pipelinePromises: Promise<any>[] = [];
const filePromises: Promise<string>[] = [];
let currentFileStream: { stream: NodeJS.WritableStream, tempFile: string } | null = null;
const options: CreateTableOptions = {
buildRangeEnd: queryTracingObj?.buildRangeEnd,
indexes,
aggregations
};
const { baseUrl } = this;
let fileCounter = 0;
this.createTableSql(table, columns);View on GitHub (pinned to 7d981676b3)
Solutions
- Ensure the streaming source is reachable and its schema introspection succeeds (check credentials/connectivity).
- Pass explicit columns to uploadTable.
- Inspect streamingSource.name/config for typos.
- Upgrade driver and orchestrator to matching versions.
Example fix
// before
await driver.uploadTable(table, [], { streamingSource });
// after
await driver.uploadTable(table, columnsFromSource, { streamingSource }); Defensive patterns
Strategy: validation
Validate before calling
if (!Array.isArray(columns) || columns.length === 0) {
throw new Error('Refusing streaming import: no columns from introspection');
}
await driver.uploadTable(table, columns, { streamingSource }); Type guard
function hasColumns(c: unknown): c is Array<{ name: string; type: string }> {
return Array.isArray(c) && c.length > 0 && c.every(col => typeof (col as any).name === 'string');
} Try / catch
try {
await driver.uploadTable(table, columns, { streamingSource });
} catch (e) {
if (e.message.includes('as stream') && e.message.includes('empty columns')) {
console.error('Streaming source introspection failed: check connectivity, credentials, and source schema');
}
throw e;
} Prevention
- Verify the streaming source is reachable and credentials are valid before building.
- Pass explicit columns when the streaming schema is known.
- Check source name/typo configuration in cube.js.
- Align driver and orchestrator versions.
When it happens
Trigger: uploadTable with tableData.streamingSource but columns=[] or null.
Common situations: Streaming source (e.g. Kafka) whose schema discovery yielded no fields; mismatched driver versions; misconfigured streamingSource credentials causing failed metadata fetch.
Related errors
- Unable to import (as rows) in Cube Store: empty columns. Mos
- Unable to import (as csv) in Cube Store: empty columns. Most
- Stream init error
- Older version of orchestrator is being used with newer versi
- options.stream must be a function
AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02).
Data as JSON: /api/errors/1cee4bc8ab991ce5.
Report an issue: GitHub.