File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed
packages/cubejs-redshift-driver/src Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -360,24 +360,24 @@ export class RedshiftDriver extends PostgresDriver<RedshiftDriverConfiguration>
360360 }
361361
362362 public override async tableColumnTypes ( table : string ) : Promise < TableStructure > {
363+ const columns : TableStructure = await super . tableColumnTypes ( table ) ;
364+
365+ if ( columns . length ) {
366+ return columns ;
367+ }
368+
369+ // It's possible that table is external Spectrum table, so we need to query it separately
363370 const [ schema , name ] = table . split ( '.' ) ;
364371
365372 // We might get table from Spectrum schema, so common request via `information_schema.columns`
366373 // won't return anything. `getColumnsForSpecificTables` is aware of Spectrum tables.
367- const columns = await this . getColumnsForSpecificTables ( [ {
368- schema_name : schema ,
369- table_name : name ,
370- } ] ) ;
374+ const columnRes = await this . columnsForExternalTable ( schema , name ) ;
371375
372- return columns . map ( c => ( { name : c . column_name , type : this . toGenericType ( c . data_type ) } ) ) ;
376+ return columnRes . map ( c => ( { name : c . column_name , type : this . toGenericType ( c . data_type ) } ) ) ;
373377 }
374378
375379 public async isUnloadSupported ( ) {
376- if ( this . config . exportBucket ) {
377- return true ;
378- }
379-
380- return false ;
380+ return ! ! this . config . exportBucket ;
381381 }
382382
383383 public async unload ( tableName : string , options : UnloadOptions ) : Promise < DownloadTableCSVData > {
You can’t perform that action at this time.
0 commit comments