clickhouse

package
v0.52.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseIntervalToMillis added in v0.52.0

func ParseIntervalToMillis(s string) (int64, bool)

ParseIntervalToMillis parses a ClickHouse INTERVAL string into milliseconds. ClickHouse currently returns INTERVALs as strings in the format "1 Month", "2 Minutes", etc. This function follows our current policy of treating months as 30 days when converting to milliseconds.

Types

type ModelInputProperties added in v0.45.0

type ModelInputProperties struct {
	SQL string `mapstructure:"sql"`
}

func (*ModelInputProperties) Validate added in v0.45.0

func (p *ModelInputProperties) Validate() error

type ModelOutputProperties added in v0.45.0

type ModelOutputProperties struct {
	Table               string                      `mapstructure:"table"`
	Materialize         *bool                       `mapstructure:"materialize"`
	UniqueKey           []string                    `mapstructure:"unique_key"`
	IncrementalStrategy drivers.IncrementalStrategy `mapstructure:"incremental_strategy"`
	// Typ to materialize the model into. Possible values include `TABLE`, `VIEW` or `DICTIONARY`. Optional.
	Typ string `mapstructure:"type"`
	// Columns sets the column names and data types. If unspecified these are detected from the select query by clickhouse.
	// It is also possible to set indexes with this property.
	// Example : (id UInt32, username varchar, email varchar, created_at datetime, INDEX idx1 username TYPE set(100) GRANULARITY 3)
	Columns string `mapstructure:"columns"`
	// EngineFull can be used to set the table parameters like engine, partition key in SQL format without setting individual properties.
	// It also allows creating dictionaries using a source.
	// Example:
	//  ENGINE = MergeTree
	//	PARTITION BY toYYYYMM(__time)
	//	ORDER BY __time
	//	TTL d + INTERVAL 1 MONTH DELETE
	EngineFull string `mapstructure:"engine_full"`
	// Engine sets the table engine. Default: MergeTree
	Engine string `mapstructure:"engine"`
	// OrderBy sets the order by clause. Default: tuple() for MergeTree and not set for other engines
	OrderBy string `mapstructure:"order_by"`
	// PartitionBy sets the partition by clause.
	PartitionBy string `mapstructure:"partition_by"`
	// PrimaryKey sets the primary key clause.
	PrimaryKey string `mapstructure:"primary_key"`
	// SampleBy sets the sample by clause.
	SampleBy string `mapstructure:"sample_by"`
	// TTL sets ttl for column and table.
	TTL string `mapstructure:"ttl"`
	// TableSettings set the table specific settings.
	TableSettings string `mapstructure:"table_settings"`
	// QuerySettings sets the settings clause used in insert/create table as select queries.
	QuerySettings string `mapstructure:"query_settings"`
	// DistributedSettings is table settings for distributed table.
	DistributedSettings string `mapstructure:"distributed.settings"`
	// DistributedShardingKey is the sharding key for distributed table.
	DistributedShardingKey string `mapstructure:"distributed.sharding_key"`
}

func (*ModelOutputProperties) Validate added in v0.45.0

type ModelResultProperties added in v0.45.0

type ModelResultProperties struct {
	Table         string `mapstructure:"table"`
	View          bool   `mapstructure:"view"`
	UsedModelName bool   `mapstructure:"used_model_name"`
}

Jump to

Keyboard shortcuts

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