schema

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendCSVHeader

func AppendCSVHeader(dst []byte, mapping SchemaMapping) []byte

func AppendNormalizeAdxIdentifier

func AppendNormalizeAdxIdentifier(dst, s []byte) []byte

NormalizeAdxIdentifier sanitizes a table or database name for use in ADX and appends it to dst. This does not do ProperCase transformations for metrics, only removes invalid characters See https://learn.microsoft.com/en-us/kusto/query/schema-entities/entity-names?view=microsoft-fabric#identifier-naming-rules

func AppendNormalizeMetricName

func AppendNormalizeMetricName(dst, s []byte) []byte

AppendNormalizeMetricName converts a metrics name to a ProperCase table name and appends it to dst.

func NormalizeAdxIdentifier

func NormalizeAdxIdentifier(s string) string

NormalizeAdxIdentifier sanitizes a table or database name for use in ADX This does not do ProperCase transformations for metrics, only removes invalid characters See https://learn.microsoft.com/en-us/kusto/query/schema-entities/entity-names?view=microsoft-fabric#identifier-naming-rules

func NormalizeMetricName

func NormalizeMetricName(s []byte) []byte

NormalizeMetricName converts a metrics name to a ProperCase table name

func SchemaHash

func SchemaHash(mapping SchemaMapping) uint64

Types

type CSVMapping

type CSVMapping struct {
	Column     string `json:"Column"`
	DataType   string `json:"DataType"`
	Properties struct {
		Ordinal    string `json:"Ordinal,omitempty"`
		ConstValue string `json:"ConstValue,omitempty"`
	} `json:"Properties"`
}

type SchemaMapping

type SchemaMapping []CSVMapping
var (
	DefaultMetricsMapping SchemaMapping = NewMetricsSchema()
	DefaultLogsMapping    SchemaMapping = NewLogsSchema()
)

func NewLogsSchema

func NewLogsSchema() SchemaMapping

func NewMetricsSchema

func NewMetricsSchema() SchemaMapping

func UnmarshalSchema

func UnmarshalSchema(data string) (SchemaMapping, error)

func (SchemaMapping) AddConstMapping

func (m SchemaMapping) AddConstMapping(col, value string) SchemaMapping

func (SchemaMapping) AddStringMapping

func (m SchemaMapping) AddStringMapping(col string) SchemaMapping

Jump to

Keyboard shortcuts

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