semantics

package
v0.10.4 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2021 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Gen4NotSupportedF

func Gen4NotSupportedF(format string, args ...interface{}) error

Gen4NotSupportedF returns a common error for shortcomings in the gen4 planner

Types

type SemTable

type SemTable struct {
	Tables []table
	// contains filtered or unexported fields
}

SemTable contains semantic analysis information about the query.

func Analyse

func Analyse(statement sqlparser.Statement) (*SemTable, error)

Analyse analyzes the parsed query.

func NewSemTable

func NewSemTable() *SemTable

NewSemTable creates a new empty SemTable

func (*SemTable) Dependencies

func (st *SemTable) Dependencies(expr sqlparser.Expr) TableSet

Dependencies return the table dependencies of the expression.

func (*SemTable) TableSetFor

func (st *SemTable) TableSetFor(t table) TableSet

TableSetFor returns the bitmask for this particular tableshoe

type TableSet

type TableSet uint64 // we can only join 64 tables with this underlying data type

TableSet is how a set of tables is expressed. Tables get unique bits assigned in the order that they are encountered during semantic analysis

func (TableSet) Constituents

func (ts TableSet) Constituents() (result []TableSet)

Constituents returns an slice with all the individual tables in their own TableSet identifier

func (TableSet) IsOverlapping

func (ts TableSet) IsOverlapping(b TableSet) bool

IsOverlapping returns true if at least one table exists in both sets

func (TableSet) IsSolvedBy

func (ts TableSet) IsSolvedBy(b TableSet) bool

IsSolvedBy returns true if all of `ts` is contained in `b`

func (TableSet) Merge

func (ts TableSet) Merge(other TableSet) TableSet

Merge creates a TableSet that contains both inputs

func (TableSet) NumberOfTables

func (ts TableSet) NumberOfTables() int

NumberOfTables returns the number of bits set

Jump to

Keyboard shortcuts

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