Documentation ¶
Index ¶
Constants ¶
View Source
const ( DF_STORAGE_POLICY = "df_storage" DF_CLUSTER = "df_cluster" DF_REPLICATED_CLUSTER = "df_replicated_cluster" DF_TIMEZONE = "Asia/Shanghai" )
View Source
const ( METRICS_DB = "flow_metrics" LOCAL_SUBFFIX = "_local" )
View Source
const DEFAULT_COLUMN_COUNT = 256
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct {
// contains filtered or unexported fields
}
func (*Block) WriteDateTime ¶
type ColdStorage ¶
type ColdStorage struct { Enabled bool Type DiskType Name string TTLToMove int // after 'TTLToMove' hours, then move data to cold storage }
func GetColdStorage ¶
func GetColdStorage(coldStorages map[string]*ColdStorage, db, table string) *ColdStorage
type Column ¶
type Column struct { Name string // 列名 Type ColumnType // 数据类型 Codec CodecType // 压缩算法 Index IndexType // 二级索引 GroupBy bool // 在AggregatingMergeTree表中用于group by的字段 Comment string // 列注释 }
func NewColumn ¶
func NewColumn(name string, t ColumnType) *Column
func NewColumnWithGroupBy ¶
func NewColumnWithGroupBy(name string, t ColumnType) *Column
func NewColumns ¶
func NewColumns(names []string, t ColumnType) []*Column
func NewColumnsWithComment ¶
func NewColumnsWithComment(nameComments [][2]string, t ColumnType) []*Column
nameComments: 需要同时创建的列列表,列表元素是长度为2的字符串数组, 第一个元素是列名,第二个是注释内容
func (*Column) MakeModifyTimeZoneSQL ¶
func (*Column) SetComment ¶
func (*Column) SetGroupBy ¶
type ColumnType ¶
type ColumnType uint8
const ( UInt64 ColumnType = iota UInt64Nullable UInt32 UInt32Nullable UInt16 UInt16Nullable UInt8 UInt8Nullable Int64 Int64Nullable Int32 Int32Nullable Int16 Int16Nullable Int8 Int8Nullable Float64 Float64Nullable String IPv6 IPv4 ArrayString ArrayUInt8 ArrayUInt16 ArrayUInt32 ArrayInt64 ArrayFloat64 DateTime DateTime64 DateTime64ms DateTime64us FixString8 LowCardinalityString ArrayLowCardinalityString )
func (ColumnType) HasDFTimeZone ¶
func (t ColumnType) HasDFTimeZone() bool
func (ColumnType) String ¶
func (t ColumnType) String() string
type EngineType ¶
type EngineType uint8
const ( Distributed EngineType = iota MergeTree ReplicatedMergeTree AggregatingMergeTree ReplicatedAggregatingMergeTree ReplacingMergeTree SummingMergeTree )
func (EngineType) String ¶
func (t EngineType) String() string
type Table ¶
type Table struct { Version string // 表版本,用于表结构变更时,做自动更新 ID uint8 // id Database string // 所属数据库名 LocalName string // 本地表名 GlobalName string // 全局表名 Columns []*Column // 表列结构 TimeKey string // 时间字段名,用来设置partition和ttl SummingKey string // When using SummingMergeEngine, this field is used for Summing aggregation TTL int // 数据默认保留时长。 单位:小时 ColdStorage ColdStorage // 冷存储配置 PartitionFunc TimeFuncType // partition函数作用于Time, Cluster string // 对应的cluster StoragePolicy string // 存储策略 Engine EngineType // 表引擎 OrderKeys []string // 排序的key PrimaryKeyCount int // 一级索引的key的个数, 从orderKeys中数前n个, }
func (*Table) MakeGlobalTableCreateSQL ¶
func (*Table) MakeLocalTableCreateSQL ¶
func (*Table) MakePrepareTableInsertSQL ¶
type TimeFuncType ¶
type TimeFuncType uint8
const ( TimeFuncNone TimeFuncType = iota TimeFuncMinute TimeFuncTenMinute TimeFuncHour TimeFuncTwoHour TimeFuncFourHour TimeFuncTwelveHour TimeFuncDay TimeFuncWeek TimeFuncMonth TimeFuncYYYYMM TimeFuncYYYYMMDD )
func (TimeFuncType) String ¶
func (t TimeFuncType) String(timeKey string) string
Click to show internal directories.
Click to hide internal directories.