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>
360
360
}
361
361
362
362
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
363
370
const [ schema , name ] = table . split ( '.' ) ;
364
371
365
372
// We might get table from Spectrum schema, so common request via `information_schema.columns`
366
373
// 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 ) ;
371
375
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 ) } ) ) ;
373
377
}
374
378
375
379
public async isUnloadSupported ( ) {
376
- if ( this . config . exportBucket ) {
377
- return true ;
378
- }
379
-
380
- return false ;
380
+ return ! ! this . config . exportBucket ;
381
381
}
382
382
383
383
public async unload ( tableName : string , options : UnloadOptions ) : Promise < DownloadTableCSVData > {
You can’t perform that action at this time.
0 commit comments