Skip to content

Commit

Permalink
fix: create schema before even fetching for deltalake (#3971)
Browse files Browse the repository at this point in the history
  • Loading branch information
achettyiitr authored Oct 13, 2023
1 parent b7590d2 commit 50f9758
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions warehouse/integrations/deltalake/deltalake.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,12 @@ func (d *Deltalake) dropTable(ctx context.Context, table string) error {

// FetchSchema fetches the schema from the warehouse
func (d *Deltalake) FetchSchema(ctx context.Context) (model.Schema, model.Schema, error) {
// Since error handling is not so good with the Databricks driver we need to verify the exact string in the error.
// Therefore, creating the schema every time before we fetch it. Also, creating the schema is idempotent.
if err := d.CreateSchema(ctx); err != nil {
return nil, nil, fmt.Errorf("creating schema: %w", err)
}

schema := make(model.Schema)
unrecognizedSchema := make(model.Schema)
tableNames, err := d.fetchTables(ctx, nonRudderStagingTableRegex)
Expand Down

0 comments on commit 50f9758

Please sign in to comment.