diff --git a/lib/config/constants/constants.go b/lib/config/constants/constants.go index 33be18b66..3d1bf1010 100644 --- a/lib/config/constants/constants.go +++ b/lib/config/constants/constants.go @@ -77,6 +77,7 @@ const ( // TODO: Add Databricks here when it's live. var ValidDestinations = []DestinationKind{ + Databricks, BigQuery, MSSQL, Redshift, diff --git a/lib/config/destination_types.go b/lib/config/destination_types.go index 680f7ffa2..44d16a3a0 100644 --- a/lib/config/destination_types.go +++ b/lib/config/destination_types.go @@ -53,10 +53,11 @@ type Snowflake struct { } type Databricks struct { - Host string `yaml:"host"` - Port int `yaml:"port"` - Username string `yaml:"username"` - Password string `yaml:"password"` - Database string `yaml:"database"` - Protocol string `yaml:"protocol"` + Host string `yaml:"host"` + Port int `yaml:"port"` + PersonalAccessToken string `yaml:"personalAccessToken"` + Database string `yaml:"database"` + Protocol string `yaml:"protocol"` + CatalogName string `yaml:"catalogName"` + SchemaName string `yaml:"schemaName"` } diff --git a/lib/config/destinations.go b/lib/config/destinations.go index b164290b1..77aa0d2f8 100644 --- a/lib/config/destinations.go +++ b/lib/config/destinations.go @@ -74,12 +74,15 @@ func (s Snowflake) ToConfig() (*gosnowflake.Config, error) { } func (d Databricks) DSN() string { - return fmt.Sprintf("%s://%s:%s@%s:%d/%s", - d.Protocol, - url.QueryEscape(d.Username), - url.QueryEscape(d.Password), - d.Host, - d.Port, - d.Database, - ) + query := url.Values{} + query.Add("catalog", d.CatalogName) + query.Add("schema", d.SchemaName) + u := &url.URL{ + Scheme: "databricks", + User: url.UserPassword("token", d.PersonalAccessToken), + Host: fmt.Sprintf("%s:%d", d.Host, d.Port), + RawQuery: query.Encode(), + } + + return u.String() }