Skip to content

Commit

Permalink
WIP.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 committed Sep 27, 2024
1 parent dbf812b commit ad19087
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 5 deletions.
54 changes: 54 additions & 0 deletions clients/databricks/store.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package databricks

import (
"github.com/artie-labs/transfer/lib/config"
"github.com/artie-labs/transfer/lib/db"
"github.com/artie-labs/transfer/lib/destination/types"
"github.com/artie-labs/transfer/lib/kafkalib"
"github.com/artie-labs/transfer/lib/optimization"
"github.com/artie-labs/transfer/lib/sql"
)

type Store struct {
db.Store
cfg config.Config
}

func (s Store) Merge(tableData *optimization.TableData) error {
//TODO implement me
panic("implement me")
}

func (s Store) Append(tableData *optimization.TableData, useTempTable bool) error {
//TODO implement me
panic("implement me")
}

func (s Store) IdentifierFor(topicConfig kafkalib.TopicConfig, table string) sql.TableIdentifier {
//TODO implement me
panic("implement me")
}

func (s Store) Dialect() sql.Dialect {
//TODO implement me
panic("implement me")
}

func (s Store) Dedupe(tableID sql.TableIdentifier, primaryKeys []string, includeArtieUpdatedAt bool) error {
//TODO implement me
panic("implement me")
}

func (s Store) GetTableConfig(tableData *optimization.TableData) (*types.DwhTableConfig, error) {
//TODO implement me
panic("implement me")
}

func (s Store) PrepareTemporaryTable(tableData *optimization.TableData, tableConfig *types.DwhTableConfig, tempTableID sql.TableIdentifier, parentTableID sql.TableIdentifier, additionalSettings types.AdditionalSettings, createTempTable bool) error {
//TODO implement me
panic("implement me")
}

func LoadStore(cfg config.Config) (Store, error) {
return Store{cfg: cfg}, nil
}
12 changes: 7 additions & 5 deletions lib/config/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,15 @@ const (
type DestinationKind string

const (
BigQuery DestinationKind = "bigquery"
MSSQL DestinationKind = "mssql"
Redshift DestinationKind = "redshift"
S3 DestinationKind = "s3"
Snowflake DestinationKind = "snowflake"
BigQuery DestinationKind = "bigquery"
Databricks DestinationKind = "databricks"
MSSQL DestinationKind = "mssql"
Redshift DestinationKind = "redshift"
S3 DestinationKind = "s3"
Snowflake DestinationKind = "snowflake"
)

// TODO: Add Databricks here when it's live.
var ValidDestinations = []DestinationKind{
BigQuery,
MSSQL,
Expand Down
9 changes: 9 additions & 0 deletions lib/destination/utils/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package utils
import (
"fmt"

"github.com/artie-labs/transfer/clients/databricks"

"github.com/artie-labs/transfer/clients/bigquery"
"github.com/artie-labs/transfer/clients/mssql"
"github.com/artie-labs/transfer/clients/redshift"
Expand Down Expand Up @@ -63,6 +65,13 @@ func LoadDataWarehouse(cfg config.Config, store *db.Store) (destination.DataWare
return nil, fmt.Errorf("failed to clean up Redshift: %w", err)
}
return s, nil
case constants.Databricks:
store, err := databricks.LoadStore(cfg)
if err != nil {
return nil, fmt.Errorf("failed to load Databricks: %w", err)
}

return store, nil
}

return nil, fmt.Errorf("invalid data warehouse output source specified: %q", cfg.Output)
Expand Down

0 comments on commit ad19087

Please sign in to comment.