Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding DropTable scaffold #1118

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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