{"record":{"id":"1cee4bc8ab991ce5","repo":"cube-js/cube","slug":"unable-to-import-as-stream-in-cube-store-empty","errorCode":null,"errorMessage":"Unable to import (as stream) in Cube Store: empty columns. Most probably, introspection has failed.","messagePattern":"Unable to import \\(as stream\\) in Cube Store: empty columns\\. Most probably, introspection has failed\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cubejs-cubestore-driver/src/CubeStoreDriver.ts","lineNumber":351,"sourceCode":"      aggregations\n    };\n    if (files.length > 0) {\n      options.inputFormat = tableData.csvNoHeader ? 'csv_no_header' : 'csv';\n      if (tableData.csvDelimiter) {\n        options.delimiter = tableData.csvDelimiter;\n      }\n      if (tableData.csvDisableQuoting) {\n        options.disableQuoting = tableData.csvDisableQuoting;\n      }\n      options.files = files;\n    }\n\n    return this.createTableWithOptions(table, columns, options, queryTracingObj);\n  }\n\n  private async importStream(columns: Column[], tableData: StreamTableData, table: string, indexes: string, aggregations: string, queryTracingObj?: any) {\n    if (!columns || columns.length === 0) {\n      throw new Error('Unable to import (as stream) in Cube Store: empty columns. Most probably, introspection has failed.');\n    }\n\n    const tempFiles: string[] = [];\n    try {\n      const pipelinePromises: Promise<any>[] = [];\n      const filePromises: Promise<string>[] = [];\n      let currentFileStream: { stream: NodeJS.WritableStream, tempFile: string } | null = null;\n\n      const options: CreateTableOptions = {\n        buildRangeEnd: queryTracingObj?.buildRangeEnd,\n        indexes,\n        aggregations\n      };\n\n      const { baseUrl } = this;\n      let fileCounter = 0;\n\n      this.createTableSql(table, columns);","sourceCodeStart":333,"sourceCodeEnd":369,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-cubestore-driver/src/CubeStoreDriver.ts#L333-L369","documentation":"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.","triggerScenarios":"uploadTable with tableData.streamingSource but columns=[] or null.","commonSituations":"Streaming source (e.g. Kafka) whose schema discovery yielded no fields; mismatched driver versions; misconfigured streamingSource credentials causing failed metadata fetch.","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."],"exampleFix":"// before\nawait driver.uploadTable(table, [], { streamingSource });\n// after\nawait driver.uploadTable(table, columnsFromSource, { streamingSource });","handlingStrategy":"validation","validationCode":"if (!Array.isArray(columns) || columns.length === 0) {\n  throw new Error('Refusing streaming import: no columns from introspection');\n}\nawait driver.uploadTable(table, columns, { streamingSource });","typeGuard":"function hasColumns(c: unknown): c is Array<{ name: string; type: string }> {\n  return Array.isArray(c) && c.length > 0 && c.every(col => typeof (col as any).name === 'string');\n}","tryCatchPattern":"try {\n  await driver.uploadTable(table, columns, { streamingSource });\n} catch (e) {\n  if (e.message.includes('as stream') && e.message.includes('empty columns')) {\n    console.error('Streaming source introspection failed: check connectivity, credentials, and source schema');\n  }\n  throw e;\n}","preventionTips":["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."],"tags":["cubestore","introspection","streaming"],"backgroundTag":"empty-columns-introspection-failed","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}