schema

package
v2.23.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DimensionField

type DimensionField struct {
	KeyBitSize                  int
	KeyBitPositionInCompoundKey int
	MaxDimensionSetSize         uint32
	Transform                   *DimensionTransformFunction
	CollapsingLevel             *limits.CollapsingLevel
}

DimensionField defines dimension field specific information KeyBitSize specifies the size of the key which will be used in the staging table to represent dimension value MaxDimensionSetSize specifies max unique dimension which will be stored in staging table

if max size will be reaches all new unique dimensions will be transformed to AGGR value

type DimensionTransformFunction

type DimensionTransformFunction struct {
	FromDataToLookupCode  func([]byte) (int, error)
	FromLookupCodeToValue func(int) (string, error)
}

type Field

type Field struct {
	Name string
	Type FieldType

	DimensionField
	// contains filtered or unexported fields
}

Field defines attributes of input field for StagingTable

func NewDimensionField

func NewDimensionField(name string, maxDimensionSetSize uint32, opts ...FieldOption) *Field

func NewMetricField

func NewMetricField(name string) *Field

func (*Field) Index

func (f *Field) Index() FieldIndex

func (*Field) ShouldCollapse

func (f *Field) ShouldCollapse(level limits.CollapsingLevel) bool

type FieldIndex

type FieldIndex = int

type FieldOption

type FieldOption func(f *Field)

func WithKeyBitSize

func WithKeyBitSize(keyBitSize int) FieldOption

func WithLevel

func WithLevel(level limits.CollapsingLevel) FieldOption

func WithTransformFunction

func WithTransformFunction(t *DimensionTransformFunction) FieldOption

type FieldType

type FieldType int
const (
	FieldTypeDimension FieldType = iota
	FieldTypeMetric
)

type Schema

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

func NewSchema

func NewSchema(fields ...*Field) *Schema

func (*Schema) Dimension

func (s *Schema) Dimension(i int) *Field

func (*Schema) DimensionKeyPartSizes

func (s *Schema) DimensionKeyPartSizes() []int

func (*Schema) Dimensions

func (s *Schema) Dimensions() []*Field

func (*Schema) Field

func (s *Schema) Field(i int) *Field

func (*Schema) Fields

func (s *Schema) Fields() []*Field

func (*Schema) KeySize

func (s *Schema) KeySize() int

func (*Schema) Metric

func (s *Schema) Metric(i int) *Field

func (*Schema) Metrics

func (s *Schema) Metrics() []*Field

func (*Schema) NumDimensions

func (s *Schema) NumDimensions() int

func (*Schema) NumMetrics

func (s *Schema) NumMetrics() int

Jump to

Keyboard shortcuts

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