preludiometa

package module
v0.0.0-...-46d105a Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: MIT Imports: 2 Imported by: 1

README

Preludio-Meta

The only purpose of this repository is to store the code used both by Preludio and Gandalff. In particular, the type system and other input/output related code.

Documentation

Index

Constants

View Source
const (
	SYMBOL_NA    = "na"
	SYMBOL_TRUE  = "true"
	SYMBOL_FALSE = "false"
	SYMBOL_IN    = "in"
	SYMBOL_REV   = "rev"

	SYMBOL_INDEXING  = "@"
	SYMBOL_FUNC_CALL = "$"
	SYMBOL_RANGE     = ".."
	SYMBOL_COLON     = ":"
	SYMBOL_LBRACE    = "{"
	SYMBOL_RBRACE    = "}"

	SYMBOL_BINARY_MUL      = "*"
	SYMBOL_BINARY_DIV      = "/"
	SYMBOL_BINARY_MOD      = "%"
	SYMBOL_BINARY_EXP      = "^"
	SYMBOL_BINARY_ADD      = "+"
	SYMBOL_BINARY_SUB      = "-"
	SYMBOL_BINARY_EQ       = "=="
	SYMBOL_BINARY_NE       = "!="
	SYMBOL_BINARY_GE       = ">="
	SYMBOL_BINARY_LE       = "<="
	SYMBOL_BINARY_GT       = ">"
	SYMBOL_BINARY_LT       = "<"
	SYMBOL_BINARY_AND      = "not"
	SYMBOL_BINARY_OR       = "or"
	SYMBOL_BINARY_MODEL    = "~"
	SYMBOL_BINARY_COALESCE = "??"

	SYMBOL_UNARY_ADD = "+"
	SYMBOL_UNARY_SUB = "-"
	SYMBOL_UNARY_NOT = "not"

	SYMBOL_DURATION_MICROSECOND_SHORT = "us"
	SYMBOL_DURATION_MILLISECOND_SHORT = "ms"
	SYMBOL_DURATION_SECOND_SHORT      = "s"
	SYMBOL_DURATION_MINUTE_SHORT      = "m"
	SYMBOL_DURATION_HOUR_SHORT        = "h"
	SYMBOL_DURATION_DAY_SHORT         = "d"
	SYMBOL_DURATION_MONTH_SHORT       = "M"
	SYMBOL_DURATION_YEAR_SHORT        = "y"
	SYMBOL_DURATION_MICROSECOND       = "microseconds"
	SYMBOL_DURATION_MILLISECOND       = "milliseconds"
	SYMBOL_DURATION_SECOND            = "seconds"
	SYMBOL_DURATION_MINUTE            = "minutes"
	SYMBOL_DURATION_HOUR              = "hours"
	SYMBOL_DURATION_DAY               = "days"
	SYMBOL_DURATION_MONTH             = "months"
	SYMBOL_DURATION_YEAR              = "years"
)
View Source
const PRELUDIO_INSTRUCTION_SIZE = 6

Variables

This section is empty.

Functions

func GoToPreludioTypeString

func GoToPreludioTypeString(t interface{}) string

Types

type BOOL

type BOOL []bool

type BaseType

type BaseType uint8
const (
	NullType BaseType = iota
	BoolType
	IntType
	// Int32Type
	Int64Type
	Float32Type
	Float64Type
	StringType
	TimeType
	DurationType
	AnyType
	ErrorType
	NonBaseType
)

func (BaseType) CanCoerceTo

func (bt BaseType) CanCoerceTo(other BaseType) bool

func (BaseType) GetDefaultJustification

func (bt BaseType) GetDefaultJustification() JustificationType

Get the default justification for a given base type

func (BaseType) ToGoType

func (bt BaseType) ToGoType() string

func (BaseType) ToString

func (bt BaseType) ToString() string

type BaseTypeCard

type BaseTypeCard struct {
	Base BaseType
	Card int
}

func (BaseTypeCard) ToString

func (btc BaseTypeCard) ToString() string

type Columnar

type Columnar struct {
	Name         string   `json:"name"`
	Type         string   `json:"type"`
	ActualLength int      `json:"actualLength"` // actual length of the column
	Data         []string `json:"data"`
	Nulls        []bool   `json:"nulls"`
}

type FLOAT32

type FLOAT32 []float32

type FLOAT64

type FLOAT64 []float64

type INT16

type INT16 []int16

type INT32

type INT32 []int32

type INT64

type INT64 []int64

type JustificationType

type JustificationType uint8
const (
	JUSTIFY_LEFT JustificationType = iota
	JUSTIFY_RIGHT
	JUSTIFY_CENTER
)

type LogEnty

type LogEnty struct {
	LogType LogType `json:"logType"`
	Level   uint8   `json:"level"`
	Message string  `json:"message"`
}

type LogType

type LogType uint8
const (
	LOG_INFO LogType = iota
	LOG_WARNING
	LOG_ERROR
	LOG_DEBUG
)

type OPCODE

type OPCODE uint8
const (
	OP_START_STMT OPCODE = iota
	OP_END_STMT
	OP_START_PIPELINE
	OP_END_PIPELINE
	OP_START_FUNC_CALL
	OP_MAKE_FUNC_CALL
	OP_START_LIST
	OP_START_VECTOR
	OP_END_LIST
	OP_ADD_FUNC_PARAM
	OP_ADD_EXPR_TERM
	OP_PUSH_NAMED_PARAM
	OP_PUSH_ASSIGN_IDENT
	OP_PUSH_TERM
	OP_END_CHUNCK
	OP_VAR_DECL
	OP_VAR_ASSIGN
	OP_INDEXING
	OP_HELP
	OP_GOTO

	OP_BINARY_MUL
	OP_BINARY_DIV
	OP_BINARY_MOD
	OP_BINARY_ADD
	OP_BINARY_SUB
	OP_BINARY_EXP

	OP_BINARY_EQ
	OP_BINARY_NE
	OP_BINARY_GE
	OP_BINARY_LE
	OP_BINARY_GT
	OP_BINARY_LT

	OP_BINARY_AND
	OP_BINARY_OR
	OP_BINARY_XOR
	OP_BINARY_COALESCE
	OP_BINARY_IN
	OP_BINARY_MODEL

	OP_BINARY_LSHIFT
	OP_BINARY_RSHIFT

	OP_UNARY_REV
	OP_UNARY_ADD
	OP_UNARY_SUB
	OP_UNARY_NOT

	NO_OP = 255
)

func (OPCODE) CommuteOperands

func (op OPCODE) CommuteOperands(lop, rop Primitive) (Primitive, Primitive)

func (OPCODE) GetBinaryOpResultSize

func (op OPCODE) GetBinaryOpResultSize(lop, rop Primitive) int

func (OPCODE) GetBinaryOpResultType

func (op OPCODE) GetBinaryOpResultType(lop, rop Primitive) Primitive

func (OPCODE) IsBinaryOp

func (op OPCODE) IsBinaryOp() bool

func (OPCODE) IsCommutative

func (op OPCODE) IsCommutative() bool

func (OPCODE) IsUnaryOp

func (op OPCODE) IsUnaryOp() bool

func (OPCODE) ToCodeString

func (op OPCODE) ToCodeString() string

func (OPCODE) ToString

func (op OPCODE) ToString() string

type PARAM1

type PARAM1 uint8
const (
	TERM_NULL PARAM1 = iota
	TERM_BOOLEAN
	TERM_INTEGER
	TERM_RANGE
	TERM_FLOAT
	TERM_STRING
	TERM_STRING_RAW
	TERM_STRING_PATH
	TERM_REGEX
	TERM_DATE
	TERM_DURATION_MICROSECOND
	TERM_DURATION_MILLISECOND
	TERM_DURATION_SECOND
	TERM_DURATION_MINUTE
	TERM_DURATION_HOUR
	TERM_DURATION_DAY
	TERM_DURATION_MONTH
	TERM_DURATION_YEAR
	TERM_LIST
	TERM_PIPELINE
	TERM_SYMBOL
)

type PreludioOutput

type PreludioOutput struct {
	Log  []LogEnty    `json:"log"`
	Data [][]Columnar `json:"data"`
}

type Primitive

type Primitive struct {
	Nullable bool
	Name     string
	Base     BaseType
	Size     int
	Schema   Schema
}

func (*Primitive) GetName

func (p *Primitive) GetName() string

func (*Primitive) IsBaseType

func (p *Primitive) IsBaseType() bool

type STRING

type STRING []string

type Schema

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

func InitSchema

func InitSchema() Schema

func (*Schema) AddPrimitive

func (s *Schema) AddPrimitive(p Primitive)

func (*Schema) GetDataTypes

func (s *Schema) GetDataTypes() []BaseType

func (*Schema) IsEqual

func (s *Schema) IsEqual(o Schema) bool

Jump to

Keyboard shortcuts

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