parser

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const UnspecifiedCapacity int64 = -1

Variables

This section is empty.

Functions

func New

func New() *bqlParser

Types

type AliasAST

type AliasAST struct {
	Expr  Expression
	Alias string
}

func (AliasAST) Foldable

func (a AliasAST) Foldable() bool

func (AliasAST) ReferencedRelations

func (a AliasAST) ReferencedRelations() map[string]bool

func (AliasAST) RenameReferencedRelation

func (a AliasAST) RenameReferencedRelation(from, to string) Expression

func (AliasAST) String

func (a AliasAST) String() string

type AliasedStreamWindowAST

type AliasedStreamWindowAST struct {
	StreamWindowAST
	Alias string
}

type ArrayAST

type ArrayAST struct {
	ExpressionsAST
}

func (ArrayAST) Foldable

func (a ArrayAST) Foldable() bool

func (ArrayAST) ReferencedRelations

func (a ArrayAST) ReferencedRelations() map[string]bool

func (ArrayAST) RenameReferencedRelation

func (a ArrayAST) RenameReferencedRelation(from, to string) Expression

func (ArrayAST) String

func (a ArrayAST) String() string

type BinaryKeyword

type BinaryKeyword int
const (
	UnspecifiedKeyword BinaryKeyword = iota
	Yes
	No
)

func (BinaryKeyword) String

func (k BinaryKeyword) String() string

type BinaryOpAST

type BinaryOpAST struct {
	Op    Operator
	Left  Expression
	Right Expression
}

func (BinaryOpAST) Foldable

func (b BinaryOpAST) Foldable() bool

func (BinaryOpAST) ReferencedRelations

func (b BinaryOpAST) ReferencedRelations() map[string]bool

func (BinaryOpAST) RenameReferencedRelation

func (b BinaryOpAST) RenameReferencedRelation(from, to string) Expression

func (BinaryOpAST) String

func (b BinaryOpAST) String() string

type BoolLiteral

type BoolLiteral struct {
	Value bool
}

func NewBoolLiteral

func NewBoolLiteral(b bool) BoolLiteral

func (BoolLiteral) Foldable

func (l BoolLiteral) Foldable() bool

func (BoolLiteral) ReferencedRelations

func (l BoolLiteral) ReferencedRelations() map[string]bool

func (BoolLiteral) RenameReferencedRelation

func (l BoolLiteral) RenameReferencedRelation(from, to string) Expression

func (BoolLiteral) String

func (l BoolLiteral) String() string

type ConditionCaseAST

type ConditionCaseAST struct {
	Checks []WhenThenPairAST
	Else   Expression
}

func (ConditionCaseAST) Foldable

func (c ConditionCaseAST) Foldable() bool

func (ConditionCaseAST) ReferencedRelations

func (c ConditionCaseAST) ReferencedRelations() map[string]bool

func (ConditionCaseAST) RenameReferencedRelation

func (c ConditionCaseAST) RenameReferencedRelation(from, to string) Expression

func (ConditionCaseAST) String

func (c ConditionCaseAST) String() string

type CreateSinkStmt

type CreateSinkStmt struct {
	Name StreamIdentifier
	Type SourceSinkType
	SourceSinkSpecsAST
}

func (CreateSinkStmt) String

func (s CreateSinkStmt) String() string

type CreateSourceStmt

type CreateSourceStmt struct {
	Paused BinaryKeyword
	Name   StreamIdentifier
	Type   SourceSinkType
	SourceSinkSpecsAST
}

func (CreateSourceStmt) String

func (s CreateSourceStmt) String() string

type CreateStateStmt

type CreateStateStmt struct {
	Name StreamIdentifier
	Type SourceSinkType
	SourceSinkSpecsAST
}

func (CreateStateStmt) String

func (s CreateStateStmt) String() string

type CreateStreamAsSelectStmt

type CreateStreamAsSelectStmt struct {
	Name   StreamIdentifier
	Select SelectStmt
}

func (CreateStreamAsSelectStmt) String

func (s CreateStreamAsSelectStmt) String() string

type CreateStreamAsSelectUnionStmt

type CreateStreamAsSelectUnionStmt struct {
	Name StreamIdentifier
	SelectUnionStmt
}

func (CreateStreamAsSelectUnionStmt) String

type DropSinkStmt

type DropSinkStmt struct {
	Sink StreamIdentifier
}

func (DropSinkStmt) String

func (s DropSinkStmt) String() string

type DropSourceStmt

type DropSourceStmt struct {
	Source StreamIdentifier
}

func (DropSourceStmt) String

func (s DropSourceStmt) String() string

type DropStateStmt

type DropStateStmt struct {
	State StreamIdentifier
}

func (DropStateStmt) String

func (s DropStateStmt) String() string

type DropStreamStmt

type DropStreamStmt struct {
	Stream StreamIdentifier
}

func (DropStreamStmt) String

func (s DropStreamStmt) String() string

type Emitter

type Emitter int
const (
	UnspecifiedEmitter Emitter = iota
	Istream
	Dstream
	Rstream
)

func (Emitter) String

func (e Emitter) String() string

type EmitterAST

type EmitterAST struct {
	EmitterType    Emitter
	EmitterOptions []interface{}
}

type EmitterLimit

type EmitterLimit struct {
	Limit int64
}

type EmitterSampling

type EmitterSampling struct {
	Value float64
	Type  EmitterSamplingType
}

type EmitterSamplingType

type EmitterSamplingType int
const (
	UnspecifiedSamplingType EmitterSamplingType = iota
	CountBasedSampling
	RandomizedSampling
	TimeBasedSampling
)

func (EmitterSamplingType) String

func (est EmitterSamplingType) String() string

type EvalStmt

type EvalStmt struct {
	Expr  Expression
	Input *MapAST
}

func (EvalStmt) String

func (s EvalStmt) String() string

type Expression

type Expression interface {
	ReferencedRelations() map[string]bool
	RenameReferencedRelation(string, string) Expression
	Foldable() bool
	String() string
}

type ExpressionCaseAST

type ExpressionCaseAST struct {
	Expr Expression
	ConditionCaseAST
}

func (ExpressionCaseAST) Foldable

func (c ExpressionCaseAST) Foldable() bool

func (ExpressionCaseAST) ReferencedRelations

func (c ExpressionCaseAST) ReferencedRelations() map[string]bool

func (ExpressionCaseAST) RenameReferencedRelation

func (c ExpressionCaseAST) RenameReferencedRelation(from, to string) Expression

func (ExpressionCaseAST) String

func (c ExpressionCaseAST) String() string

type ExpressionsAST

type ExpressionsAST struct {
	Expressions []Expression
}

type FilterAST

type FilterAST struct {
	Filter Expression
}

type FloatLiteral

type FloatLiteral struct {
	Value float64
}

func NewFloatLiteral

func NewFloatLiteral(s string) FloatLiteral

func (FloatLiteral) Foldable

func (l FloatLiteral) Foldable() bool

func (FloatLiteral) ReferencedRelations

func (l FloatLiteral) ReferencedRelations() map[string]bool

func (FloatLiteral) RenameReferencedRelation

func (l FloatLiteral) RenameReferencedRelation(from, to string) Expression

func (FloatLiteral) String

func (l FloatLiteral) String() string

type FuncAppAST

type FuncAppAST struct {
	Function FuncName
	ExpressionsAST
	Ordering []SortedExpressionAST
}

func (FuncAppAST) Foldable

func (f FuncAppAST) Foldable() bool

func (FuncAppAST) ReferencedRelations

func (f FuncAppAST) ReferencedRelations() map[string]bool

func (FuncAppAST) RenameReferencedRelation

func (f FuncAppAST) RenameReferencedRelation(from, to string) Expression

func (FuncAppAST) String

func (f FuncAppAST) String() string

type FuncName

type FuncName string

type GroupingAST

type GroupingAST struct {
	GroupList []Expression
}

type HavingAST

type HavingAST struct {
	Having Expression
}

type Identifier

type Identifier string

type InsertIntoFromStmt

type InsertIntoFromStmt struct {
	Sink  StreamIdentifier
	Input StreamIdentifier
}

func (InsertIntoFromStmt) String

func (s InsertIntoFromStmt) String() string

type IntervalAST

type IntervalAST struct {
	FloatLiteral
	Unit IntervalUnit
}

type IntervalUnit

type IntervalUnit int
const (
	UnspecifiedIntervalUnit IntervalUnit = iota
	Tuples
	Seconds
	Milliseconds
)

func (IntervalUnit) String

func (i IntervalUnit) String() string

type KeyValuePairAST

type KeyValuePairAST struct {
	Key   string
	Value Expression
}

type LoadStateOrCreateStmt

type LoadStateOrCreateStmt struct {
	Name        StreamIdentifier
	Type        SourceSinkType
	Tag         string
	LoadSpecs   SourceSinkSpecsAST
	CreateSpecs SourceSinkSpecsAST
}

func (LoadStateOrCreateStmt) String

func (s LoadStateOrCreateStmt) String() string

type LoadStateStmt

type LoadStateStmt struct {
	Name StreamIdentifier
	Type SourceSinkType
	Tag  string
	SourceSinkSpecsAST
}

func (LoadStateStmt) String

func (s LoadStateStmt) String() string

type MapAST

type MapAST struct {
	Entries []KeyValuePairAST
}

func (MapAST) Foldable

func (m MapAST) Foldable() bool

func (MapAST) ReferencedRelations

func (m MapAST) ReferencedRelations() map[string]bool

func (MapAST) RenameReferencedRelation

func (m MapAST) RenameReferencedRelation(from, to string) Expression

func (MapAST) String

func (m MapAST) String() string

type MetaInformation

type MetaInformation int
const (
	UnknownMeta MetaInformation = iota
	TimestampMeta
	NowMeta
)

func (MetaInformation) String

func (m MetaInformation) String() string

type Missing

type Missing struct {
}

func NewMissing

func NewMissing() Missing

func (Missing) Foldable

func (l Missing) Foldable() bool

func (Missing) ReferencedRelations

func (l Missing) ReferencedRelations() map[string]bool

func (Missing) RenameReferencedRelation

func (l Missing) RenameReferencedRelation(from, to string) Expression

func (Missing) String

func (l Missing) String() string

type NullLiteral

type NullLiteral struct {
}

func NewNullLiteral

func NewNullLiteral() NullLiteral

func (NullLiteral) Foldable

func (l NullLiteral) Foldable() bool

func (NullLiteral) ReferencedRelations

func (l NullLiteral) ReferencedRelations() map[string]bool

func (NullLiteral) RenameReferencedRelation

func (l NullLiteral) RenameReferencedRelation(from, to string) Expression

func (NullLiteral) String

func (l NullLiteral) String() string

type NumericLiteral

type NumericLiteral struct {
	Value int64
}

func NewNumericLiteral

func NewNumericLiteral(s string) NumericLiteral

func (NumericLiteral) Foldable

func (l NumericLiteral) Foldable() bool

func (NumericLiteral) ReferencedRelations

func (l NumericLiteral) ReferencedRelations() map[string]bool

func (NumericLiteral) RenameReferencedRelation

func (l NumericLiteral) RenameReferencedRelation(from, to string) Expression

func (NumericLiteral) String

func (l NumericLiteral) String() string

type Operator

type Operator int
const (
	// Operators are defined in precedence order (increasing). These
	// values can be compared using the hasHigherPrecedenceThan method.
	UnknownOperator Operator = iota
	Or
	And
	Not
	Equal
	Less
	LessOrEqual
	Greater
	GreaterOrEqual
	NotEqual
	Concat
	Is
	IsNot
	Plus
	Minus
	Multiply
	Divide
	Modulo
	UnaryMinus
)

func (Operator) String

func (o Operator) String() string

type ParsedComponent

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

ParsedComponent is an element of the parse stack that represents a section of the input string that was successfully parsed.

type PauseSourceStmt

type PauseSourceStmt struct {
	Source StreamIdentifier
}

func (PauseSourceStmt) String

func (s PauseSourceStmt) String() string

type ProjectionsAST

type ProjectionsAST struct {
	Projections []Expression
}

type Raw

type Raw struct {
	Expr string
}

func NewRaw

func NewRaw(s string) Raw

type ResumeSourceStmt

type ResumeSourceStmt struct {
	Source StreamIdentifier
}

func (ResumeSourceStmt) String

func (s ResumeSourceStmt) String() string

type RewindSourceStmt

type RewindSourceStmt struct {
	Source StreamIdentifier
}

func (RewindSourceStmt) String

func (s RewindSourceStmt) String() string

type RowMeta

type RowMeta struct {
	Relation string
	MetaType MetaInformation
}

func NewRowMeta

func NewRowMeta(s string, t MetaInformation) RowMeta

func (RowMeta) Foldable

func (rm RowMeta) Foldable() bool

func (RowMeta) ReferencedRelations

func (rm RowMeta) ReferencedRelations() map[string]bool

func (RowMeta) RenameReferencedRelation

func (rm RowMeta) RenameReferencedRelation(from, to string) Expression

func (RowMeta) String

func (rm RowMeta) String() string

type RowValue

type RowValue struct {
	Relation string
	Column   string
}

func NewRowValue

func NewRowValue(s string) RowValue

func (RowValue) Foldable

func (rv RowValue) Foldable() bool

func (RowValue) ReferencedRelations

func (rv RowValue) ReferencedRelations() map[string]bool

func (RowValue) RenameReferencedRelation

func (rv RowValue) RenameReferencedRelation(from, to string) Expression

func (RowValue) String

func (rv RowValue) String() string

type SaveStateStmt

type SaveStateStmt struct {
	Name StreamIdentifier
	Tag  string
}

func (SaveStateStmt) String

func (s SaveStateStmt) String() string

type SelectStmt

func (SelectStmt) String

func (s SelectStmt) String() string

type SelectUnionStmt

type SelectUnionStmt struct {
	Selects []SelectStmt
}

func (SelectUnionStmt) String

func (s SelectUnionStmt) String() string

type SheddingOption

type SheddingOption int
const (
	UnspecifiedSheddingOption SheddingOption = iota
	Wait
	DropOldest
	DropNewest
)

func (SheddingOption) String

func (t SheddingOption) String() string

type SortedExpressionAST

type SortedExpressionAST struct {
	Expr      Expression
	Ascending BinaryKeyword
}

func (SortedExpressionAST) Foldable

func (s SortedExpressionAST) Foldable() bool

func (SortedExpressionAST) ReferencedRelations

func (s SortedExpressionAST) ReferencedRelations() map[string]bool

func (SortedExpressionAST) RenameReferencedRelation

func (s SortedExpressionAST) RenameReferencedRelation(from, to string) Expression

func (SortedExpressionAST) String

func (s SortedExpressionAST) String() string

type SourceSinkParamAST

type SourceSinkParamAST struct {
	Key   SourceSinkParamKey
	Value data.Value
}

type SourceSinkParamKey

type SourceSinkParamKey string

type SourceSinkSpecsAST

type SourceSinkSpecsAST struct {
	Params []SourceSinkParamAST
}

type SourceSinkType

type SourceSinkType string

type Stream

type Stream struct {
	Type   StreamType
	Name   string
	Params []Expression
}

It seems not possible in Go to have a variable that says "this is either struct A or struct B or struct C", so we build one struct that serves both for "real" streams (as in `FROM x`) and stream- generating functions (as in `FROM series(1, 5)`).

func NewStream

func NewStream(s string) Stream

type StreamIdentifier

type StreamIdentifier string

type StreamType

type StreamType int
const (
	UnknownStreamType StreamType = iota
	ActualStream
	UDSFStream
)

func (StreamType) String

func (st StreamType) String() string

type StreamWindowAST

type StreamWindowAST struct {
	Stream
	IntervalAST
	Capacity int64
	Shedding SheddingOption
}

type StringLiteral

type StringLiteral struct {
	Value string
}

func NewStringLiteral

func NewStringLiteral(s string) StringLiteral

func (StringLiteral) Foldable

func (l StringLiteral) Foldable() bool

func (StringLiteral) ReferencedRelations

func (l StringLiteral) ReferencedRelations() map[string]bool

func (StringLiteral) RenameReferencedRelation

func (l StringLiteral) RenameReferencedRelation(from, to string) Expression

func (StringLiteral) String

func (l StringLiteral) String() string

type Type

type Type int
const (
	UnknownType Type = iota
	Bool
	Int
	Float
	String
	Blob
	Timestamp
	Array
	Map
)

func (Type) String

func (t Type) String() string

type TypeCastAST

type TypeCastAST struct {
	Expr   Expression
	Target Type
}

func (TypeCastAST) Foldable

func (u TypeCastAST) Foldable() bool

func (TypeCastAST) ReferencedRelations

func (u TypeCastAST) ReferencedRelations() map[string]bool

func (TypeCastAST) RenameReferencedRelation

func (u TypeCastAST) RenameReferencedRelation(from, to string) Expression

func (TypeCastAST) String

func (u TypeCastAST) String() string

type UnaryOpAST

type UnaryOpAST struct {
	Op   Operator
	Expr Expression
}

func (UnaryOpAST) Foldable

func (u UnaryOpAST) Foldable() bool

func (UnaryOpAST) ReferencedRelations

func (u UnaryOpAST) ReferencedRelations() map[string]bool

func (UnaryOpAST) RenameReferencedRelation

func (u UnaryOpAST) RenameReferencedRelation(from, to string) Expression

func (UnaryOpAST) String

func (u UnaryOpAST) String() string

type UpdateSinkStmt

type UpdateSinkStmt struct {
	Name StreamIdentifier
	SourceSinkSpecsAST
}

func (UpdateSinkStmt) String

func (s UpdateSinkStmt) String() string

type UpdateSourceStmt

type UpdateSourceStmt struct {
	Name StreamIdentifier
	SourceSinkSpecsAST
}

func (UpdateSourceStmt) String

func (s UpdateSourceStmt) String() string

type UpdateStateStmt

type UpdateStateStmt struct {
	Name StreamIdentifier
	SourceSinkSpecsAST
}

func (UpdateStateStmt) String

func (s UpdateStateStmt) String() string

type WhenThenPairAST

type WhenThenPairAST struct {
	When Expression
	Then Expression
}

type Wildcard

type Wildcard struct {
	Relation string
}

func NewWildcard

func NewWildcard(relation string) Wildcard

func (Wildcard) Foldable

func (w Wildcard) Foldable() bool

func (Wildcard) ReferencedRelations

func (w Wildcard) ReferencedRelations() map[string]bool

func (Wildcard) RenameReferencedRelation

func (w Wildcard) RenameReferencedRelation(from, to string) Expression

func (Wildcard) String

func (w Wildcard) String() string

type WindowedFromAST

type WindowedFromAST struct {
	Relations []AliasedStreamWindowAST
}

Jump to

Keyboard shortcuts

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