clickhouse

package
v0.11.151 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewColumnCheckOperator

func NewColumnCheckOperator(manager connectionFetcher) *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 connectionFetcher, extractor queryExtractor, materializer materializer) *BasicOperator

func (BasicOperator) Run

func (BasicOperator) RunTask

type ClickHouseClient

type ClickHouseClient interface {
	RunQueryWithoutResult(ctx context.Context, query *query.Query) error
	Select(ctx context.Context, query *query.Query) ([][]interface{}, error)
	Ping(ctx context.Context) error
	SelectWithSchema(ctx context.Context, queryObj *query.Query) (*query.QueryResult, error)
}

type ClickHouseConfig

type ClickHouseConfig interface {
	ToClickHouseOptions() *click_house.Options
	GetIngestrURI() string
}

type Client

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

func NewClient

func NewClient(c ClickHouseConfig) (*Client, error)

func (*Client) GetIngestrURI

func (c *Client) GetIngestrURI() (string, error)

func (*Client) Ping

func (c *Client) Ping(ctx context.Context) error

Test runs a simple query (SELECT 1) to validate the connection.

func (*Client) RunQueryWithoutResult

func (c *Client) RunQueryWithoutResult(ctx context.Context, query *query.Query) error

func (*Client) Select

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

Select runs a query and returns the results.

func (*Client) SelectWithSchema

func (c *Client) SelectWithSchema(ctx context.Context, queryObj *query.Query) (*query.QueryResult, error)

type Config

type Config struct {
	Username string
	Password string
	Host     string
	Port     int
	Database string
	HTTPPort int
	Secure   *int
}

func (*Config) GetIngestrURI

func (c *Config) GetIngestrURI() string

func (*Config) ToClickHouseOptions

func (c *Config) ToClickHouseOptions() *click_house.Options

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 athena we need to create a different materializer that returns a slice of strings, since athena server requires us to send separate batches for certain things.

func NewMaterializer

func NewMaterializer(fullRefresh bool) *Materializer

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)

type RowScanner

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

Rowscanner exists since clickhouse library requires us to scan either to a specific type or an implementor of the interface sql.Scanner, cannot scan directly to interface{}.

func (*RowScanner) Scan

func (s *RowScanner) Scan(src any) error

func (*RowScanner) SetValues

func (s *RowScanner) SetValues(values []any)

Jump to

Keyboard shortcuts

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