Skip to content

Commit

Permalink
Adding DropTable scaffold (artie-labs#1118)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 authored and stitch-marinus committed Jan 30, 2025
1 parent f0b3785 commit 4366c19
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions clients/bigquery/bigquery.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ type Store struct {
db.Store
}

func (s *Store) DropTable(_ context.Context, _ sql.TableIdentifier) error {
return fmt.Errorf("not supported")
}

func (s *Store) Append(ctx context.Context, tableData *optimization.TableData, useTempTable bool) error {
if !useTempTable {
return shared.Append(ctx, s, tableData, types.AdditionalSettings{
Expand Down
4 changes: 4 additions & 0 deletions clients/databricks/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ type Store struct {
configMap *types.DwhToTablesConfigMap
}

func (s Store) DropTable(_ context.Context, _ sql.TableIdentifier) error {
return fmt.Errorf("not supported")
}

func (s Store) Merge(ctx context.Context, tableData *optimization.TableData) error {
return shared.Merge(ctx, s, tableData, types.MergeOpts{})
}
Expand Down
5 changes: 5 additions & 0 deletions clients/mssql/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package mssql

import (
"context"
"fmt"
"strings"

_ "github.com/microsoft/go-mssqldb"
Expand Down Expand Up @@ -31,6 +32,10 @@ func getSchema(schema string) string {
return schema
}

func (s *Store) DropTable(_ context.Context, _ sql.TableIdentifier) error {
return fmt.Errorf("not supported")
}

func (s *Store) Dialect() sql.Dialect {
return s.dialect()
}
Expand Down
4 changes: 4 additions & 0 deletions clients/redshift/redshift.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ type Store struct {
db.Store
}

func (s *Store) DropTable(_ context.Context, _ sql.TableIdentifier) error {
return fmt.Errorf("not supported")
}

func (s *Store) Append(ctx context.Context, tableData *optimization.TableData, _ bool) error {
return shared.Append(ctx, s, tableData, types.AdditionalSettings{})
}
Expand Down
4 changes: 4 additions & 0 deletions clients/snowflake/snowflake.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ func (s *Store) IdentifierFor(topicConfig kafkalib.TopicConfig, table string) sq
return dialect.NewTableIdentifier(topicConfig.Database, topicConfig.Schema, table)
}

func (s *Store) DropTable(_ context.Context, _ sql.TableIdentifier) error {
return fmt.Errorf("not supported")
}

func (s *Store) GetTableConfig(tableID sql.TableIdentifier, dropDeletedColumns bool) (*types.DwhTableConfig, error) {
return shared.GetTableCfgArgs{
Dwh: s,
Expand Down
3 changes: 3 additions & 0 deletions lib/destination/dwh.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ type DataWarehouse interface {
// Helper functions for merge
GetTableConfig(tableID sqllib.TableIdentifier, dropDeletedColumns bool) (*types.DwhTableConfig, error)
PrepareTemporaryTable(ctx context.Context, tableData *optimization.TableData, tableConfig *types.DwhTableConfig, tempTableID sqllib.TableIdentifier, parentTableID sqllib.TableIdentifier, additionalSettings types.AdditionalSettings, createTempTable bool) error

// Helper function for multi-step merge
DropTable(ctx context.Context, tableID sqllib.TableIdentifier) error
}

type Baseline interface {
Expand Down

0 comments on commit 4366c19

Please sign in to comment.