clickhouse

package
v1.11.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Cluster = "cluster"
)

Variables

This section is empty.

Functions

func WithConfig

func WithConfig(h *Clickhouse, config *config.Config)

Types

type Clickhouse

type Clickhouse struct {
	DB            *sql.DB
	Namespace     string
	ObjectStorage string
	Warehouse     model.Warehouse
	Uploader      warehouseutils.Uploader

	ConnectTimeout              time.Duration
	Logger                      logger.Logger
	QueryDebugLogs              string
	BlockSize                   string
	PoolSize                    string
	ReadTimeout                 string
	WriteTimeout                string
	Compress                    bool
	DisableNullable             bool
	ExecTimeOutInSeconds        time.Duration
	CommitTimeOutInSeconds      time.Duration
	LoadTableFailureRetries     int
	NumWorkersDownloadLoadFiles int
	S3EngineEnabledWorkspaceIDs []string
	LoadFileDownloader          downloader.Downloader
	// contains filtered or unexported fields
}

func New added in v1.8.0

func New() *Clickhouse

func (*Clickhouse) AddColumns

func (ch *Clickhouse) AddColumns(ctx context.Context, tableName string, columnsInfo []warehouseutils.ColumnInfo) (err error)

func (*Clickhouse) AlterColumn

func (*Clickhouse) Cleanup

func (ch *Clickhouse) Cleanup(context.Context)

func (*Clickhouse) ColumnsWithDataTypes

func (ch *Clickhouse) ColumnsWithDataTypes(tableName string, columns model.TableSchema, notNullableColumns []string) string

ColumnsWithDataTypes creates columns and its datatype into sql format for creating table

func (*Clickhouse) Connect

func (ch *Clickhouse) Connect(_ context.Context, warehouse model.Warehouse) (client.Client, error)

func (*Clickhouse) CrashRecover

func (*Clickhouse) CrashRecover(context.Context)

func (*Clickhouse) CreateSchema

func (ch *Clickhouse) CreateSchema(ctx context.Context) (err error)

func (*Clickhouse) CreateTable

func (ch *Clickhouse) CreateTable(ctx context.Context, tableName string, columns model.TableSchema) (err error)

CreateTable creates table with engine ReplacingMergeTree(), this is used for dedupe event data and replace it will the latest data if duplicate data found. This logic is handled by clickhouse The engine differs from MergeTree in that it removes duplicate entries with the same sorting key value.

func (*Clickhouse) DeleteBy

func (*Clickhouse) DownloadIdentityRules

func (*Clickhouse) DownloadIdentityRules(context.Context, *misc.GZipWriter) (err error)

func (*Clickhouse) DropTable

func (ch *Clickhouse) DropTable(ctx context.Context, tableName string) (err error)

func (*Clickhouse) ErrorMappings

func (*Clickhouse) ErrorMappings() []model.JobError

func (*Clickhouse) FetchSchema

func (ch *Clickhouse) FetchSchema(ctx context.Context) (model.Schema, model.Schema, error)

FetchSchema queries clickhouse and returns the schema associated with provided namespace

func (*Clickhouse) GetLogIdentifier

func (ch *Clickhouse) GetLogIdentifier(args ...string) string

func (*Clickhouse) GetTotalCountInTable

func (ch *Clickhouse) GetTotalCountInTable(ctx context.Context, tableName string) (int64, error)

func (*Clickhouse) IsEmpty

func (*Clickhouse) IsEmpty(context.Context, model.Warehouse) (empty bool, err error)

func (*Clickhouse) LoadIdentityMappingsTable

func (*Clickhouse) LoadIdentityMappingsTable(context.Context) (err error)

func (*Clickhouse) LoadIdentityMergeRulesTable

func (*Clickhouse) LoadIdentityMergeRulesTable(context.Context) (err error)

func (*Clickhouse) LoadTable

func (ch *Clickhouse) LoadTable(ctx context.Context, tableName string) error

func (*Clickhouse) LoadTestTable

func (ch *Clickhouse) LoadTestTable(ctx context.Context, _, tableName string, payloadMap map[string]interface{}, _ string) (err error)

func (*Clickhouse) LoadUserTables

func (ch *Clickhouse) LoadUserTables(ctx context.Context) (errorMap map[string]error)

func (*Clickhouse) SetConnectionTimeout

func (ch *Clickhouse) SetConnectionTimeout(timeout time.Duration)

func (*Clickhouse) Setup

func (ch *Clickhouse) Setup(_ context.Context, warehouse model.Warehouse, uploader warehouseutils.Uploader) (err error)

func (*Clickhouse) TestConnection

func (ch *Clickhouse) TestConnection(ctx context.Context, _ model.Warehouse) error

TestConnection is used destination connection tester to test the clickhouse connection

func (*Clickhouse) UseS3CopyEngineForLoading

func (ch *Clickhouse) UseS3CopyEngineForLoading() bool

type Credentials

type Credentials struct {
	Host          string
	DBName        string
	User          string
	Password      string
	Port          string
	Secure        string
	SkipVerify    string
	TLSConfigName string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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