clickhouse

package
v0.0.0-...-205417f Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CHSettingMinVersions = map[CHSetting]chproto.Version{
	SettingJsonTypeEscapeDotsInKeys:    {Major: 25, Minor: 8, Patch: 0},
	SettingTypeJsonSkipDuplicatedPaths: {Major: 24, Minor: 8, Patch: 0},
	SettingMaxTableSizeToDrop:          {Major: 23, Minor: 12, Patch: 0},
}

CHSettingMinVersions maps setting names to their minimum required ClickHouse versions that PeerDB supports. If minimum version is not specified, we assume the setting is available to all ClickHouse versions

Functions

func GetMinVersion

func GetMinVersion(name CHSetting) (chproto.Version, bool)

func NewCHSettingsString

func NewCHSettingsString(version *chproto.Version, key CHSetting, val string) string

NewCHSettingsString is a one-liner method to generate an immutable settings string

Types

type CHSetting

type CHSetting string
const (
	SettingAllowNullableKey                   CHSetting = "allow_nullable_key"
	SettingJsonTypeEscapeDotsInKeys           CHSetting = "json_type_escape_dots_in_keys"
	SettingTypeJsonSkipDuplicatedPaths        CHSetting = "type_json_skip_duplicated_paths"
	SettingThrowOnMaxPartitionsPerInsertBlock CHSetting = "throw_on_max_partitions_per_insert_block"
	SettingParallelDistributedInsertSelect    CHSetting = "parallel_distributed_insert_select"
	SettingMaxTableSizeToDrop                 CHSetting = "max_table_size_to_drop"
)

When adding a new clickhouse setting to this list, check when the setting is introduced to ClickHouse and if applicable, add a corresponding minimum supported version below to ensure queries on older versions of ClickHouse servers are not impacted. Important: if the setting causes breaking changes to existing PeerDB flows (not just ClickHouse compatibility), it must also be gated by PeerDB's internal version.

type CHSettingEntry

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

type CHSettings

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

func NewCHSettings

func NewCHSettings(version *chproto.Version, settings ...CHSettingEntry) *CHSettings

func (*CHSettings) Add

func (sg *CHSettings) Add(key CHSetting, val string) *CHSettings

func (*CHSettings) String

func (sg *CHSettings) String() string

String generates settings string ' SETTINGS <key1> = <val1>, <key2> = <val2>, ...'; If ClickHouse version is set in the CHSettings, settings that do not meet CH version requirement will be filtered out. Otherwise, all settings are included.

Jump to

Keyboard shortcuts

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