Help us shape the future of Go! Take the 2026 Go Developer Survey

databricks

package
v0.11.796 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewColumnCheckOperator

func NewColumnCheckOperator(manager config.ConnectionGetter) *ansisql.ColumnCheckOperator

Types

type AcceptedValuesCheck

type AcceptedValuesCheck struct {
	// contains filtered or unexported fields
}

func (*AcceptedValuesCheck) Check

type BasicOperator

type BasicOperator struct {
	// contains filtered or unexported fields
}

func NewBasicOperator

func NewBasicOperator(conn config.ConnectionGetter, extractor query.QueryExtractor, materializer materializer, parser *sqlparser.SQLParser) *BasicOperator

func (BasicOperator) Run

func (BasicOperator) RunTask

type Client

type Client interface {
	RunQueryWithoutResult(ctx context.Context, query *query.Query) error
	Select(ctx context.Context, query *query.Query) ([][]interface{}, error)
	SelectWithSchema(ctx context.Context, query *query.Query) (*query.QueryResult, error)
	Ping(ctx context.Context) error
	CreateSchemaIfNotExist(ctx context.Context, asset *pipeline.Asset, pipelineName string) error
}

type Config

type Config struct {
	// Token is the Databricks Personal API token (used for PAT authentication)
	Token string
	Host  string
	Port  int
	// Path will determine cluster or sql warehouse. See https://docs.databricks.com/en/dev-tools/go-sql-driver.html#connect-with-a-dsn-connection-string
	Path    string
	Catalog string
	Schema  string
	// ClientID and ClientSecret are used for OAuth M2M (machine-to-machine) authentication
	// When both are provided, OAuth M2M authentication is used instead of PAT
	ClientID     string
	ClientSecret string
}

func (*Config) GetIngestrURI added in v0.11.394

func (c *Config) GetIngestrURI() string

GetIngestrURI returns the connection URI for ingestr. For PAT: databricks://token:<access_token>@<server_hostname>?http_path=<http_path>&catalog=<catalog>&schema=<schema> For OAuth M2M: databricks://<server_hostname>?http_path=<http_path>&catalog=<catalog>&schema=<schema>&client_id=<id>&client_secret=<secret> See: https://getbruin.com/docs/ingestr/supported-sources/databricks.html

func (*Config) ToDBConnectionURI

func (c *Config) ToDBConnectionURI() string

func (*Config) UseOAuthM2M added in v0.11.409

func (c *Config) UseOAuthM2M() bool

UseOAuthM2M returns true if OAuth M2M authentication should be used.

type DB

type DB struct {
	// contains filtered or unexported fields
}

func NewDB

func NewDB(c *Config) (*DB, error)

func (*DB) BuildTableExistsQuery added in v0.11.296

func (db *DB) BuildTableExistsQuery(tableName string) (string, error)

func (*DB) CreateSchemaIfNotExist added in v0.11.397

func (db *DB) CreateSchemaIfNotExist(ctx context.Context, asset *pipeline.Asset, pipelineName string) error

func (*DB) GetColumns added in v0.11.247

func (db *DB) GetColumns(ctx context.Context, databaseName, tableName string) ([]*ansisql.DBColumn, error)

func (*DB) GetDatabaseSummary added in v0.11.242

func (db *DB) GetDatabaseSummary(ctx context.Context) (*ansisql.DBDatabase, error)

func (*DB) GetDatabases added in v0.11.247

func (db *DB) GetDatabases(ctx context.Context) ([]string, error)

func (*DB) GetIngestrURI added in v0.11.394

func (db *DB) GetIngestrURI() (string, error)

func (*DB) GetTables added in v0.11.247

func (db *DB) GetTables(ctx context.Context, databaseName string) ([]string, error)

func (*DB) Ping added in v0.11.106

func (db *DB) Ping(ctx context.Context) error

func (*DB) RunQueryWithoutResult

func (db *DB) RunQueryWithoutResult(ctx context.Context, query *query.Query) error

func (*DB) Select

func (db *DB) Select(ctx context.Context, query *query.Query) ([][]interface{}, error)

func (*DB) SelectWithSchema added in v0.11.325

func (db *DB) SelectWithSchema(ctx context.Context, queryObj *query.Query) (*query.QueryResult, error)

type Materializer

type Materializer struct {
	MaterializationMap AssetMaterializationMap
	// contains filtered or unexported fields
}

The other packages all use a materializer that renders the query to a single string. Due to the quirks of databricks we need to create a different materializer that returns a slice of strings, since databricks server requires us to send separate batches for certain things.

func NewMaterializer

func NewMaterializer(fullRefresh bool) *Materializer

func (*Materializer) LogIfFullRefreshAndDDL added in v0.11.222

func (m *Materializer) LogIfFullRefreshAndDDL(writer interface{}, asset *pipeline.Asset) error

func (*Materializer) Render

func (m *Materializer) Render(asset *pipeline.Asset, query string) ([]string, error)

type MaterializerFunc

type MaterializerFunc func(task *pipeline.Asset, query string) ([]string, error)

type PatternCheck

type PatternCheck struct {
	// contains filtered or unexported fields
}

func (*PatternCheck) Check

type Renderer

type Renderer struct {
	// contains filtered or unexported fields
}

func NewRenderer

func NewRenderer(fullRefresh bool) *Renderer

func (*Renderer) Render

func (r *Renderer) Render(asset *pipeline.Asset, query string) (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL