Skip to content

Commit ad21b48

Browse files
committed
fix types in databricks driver
1 parent 7a14430 commit ad21b48

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

packages/cubejs-databricks-jdbc-driver/src/DatabricksDriver.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ import {
1515
QuerySchemasResult,
1616
QueryTablesResult,
1717
UnloadOptions,
18-
GenericDataBaseType
18+
GenericDataBaseType,
19+
TableColumn,
20+
DatabaseStructure,
1921
} from '@cubejs-backend/base-driver';
2022
import {
2123
JDBCDriver,
@@ -392,10 +394,10 @@ export class DatabricksDriver extends JDBCDriver {
392394
/**
393395
* Returns tables meta data object.
394396
*/
395-
public override async tablesSchema(): Promise<Record<string, Record<string, object>>> {
397+
public override async tablesSchema(): Promise<DatabaseStructure> {
396398
const tables = await this.getTables();
397399

398-
const metadata: Record<string, Record<string, object>> = {};
400+
const metadata: DatabaseStructure = {};
399401

400402
await Promise.all(tables.map(async ({ database, tableName }) => {
401403
if (!(database in metadata)) {
@@ -499,7 +501,7 @@ export class DatabricksDriver extends JDBCDriver {
499501
/**
500502
* Returns table columns types.
501503
*/
502-
public override async tableColumnTypes(table: string): Promise<{ name: any; type: string; }[]> {
504+
public override async tableColumnTypes(table: string): Promise<TableColumn[]> {
503505
let tableFullName = '';
504506
const tableArray = table.split('.');
505507

@@ -538,6 +540,7 @@ export class DatabricksDriver extends JDBCDriver {
538540
result.push({
539541
name: column.col_name,
540542
type: this.toGenericType(column.data_type),
543+
attributes: [],
541544
});
542545
}
543546

0 commit comments

Comments
 (0)