Documentation ¶
Index ¶
- func Gen4NotSupportedF(format string, args ...interface{}) error
- type FakeSI
- type SchemaInformation
- type SemTable
- func (st *SemTable) AddExprs(tbl *sqlparser.AliasedTableExpr, cols sqlparser.SelectExprs)
- func (st *SemTable) Dependencies(expr sqlparser.Expr) TableSet
- func (st *SemTable) GetSelectTables(node *sqlparser.Select) []*TableInfo
- func (st *SemTable) TableInfoFor(id TableSet) (*TableInfo, error)
- func (st *SemTable) TableSetFor(t *sqlparser.AliasedTableExpr) TableSet
- type TableInfo
- type TableSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Gen4NotSupportedF ¶
Gen4NotSupportedF returns a common error for shortcomings in the gen4 planner
Types ¶
type FakeSI ¶ added in v0.11.0
FakeSI is a fake SchemaInformation for testing
func (*FakeSI) FindTableOrVindex ¶ added in v0.11.0
func (s *FakeSI) FindTableOrVindex(tablename sqlparser.TableName) (*vindexes.Table, vindexes.Vindex, string, topodatapb.TabletType, key.Destination, error)
FindTableOrVindex implements the SchemaInformation interface
type SchemaInformation ¶ added in v0.11.0
type SchemaInformation interface {
FindTableOrVindex(tablename sqlparser.TableName) (*vindexes.Table, vindexes.Vindex, string, topodatapb.TabletType, key.Destination, error)
}
SchemaInformation is used tp provide table information from Vschema.
type SemTable ¶
type SemTable struct { Tables []*TableInfo // ProjectionErr stores the error that we got during the semantic analysis of the SelectExprs. // This is only a real error if we are unable to plan the query as a single route ProjectionErr error // contains filtered or unexported fields }
SemTable contains semantic analysis information about the query.
func Analyze ¶ added in v0.11.0
func Analyze(statement sqlparser.Statement, currentDb string, si SchemaInformation) (*SemTable, error)
Analyze analyzes the parsed query.
func (*SemTable) AddExprs ¶ added in v0.11.0
func (st *SemTable) AddExprs(tbl *sqlparser.AliasedTableExpr, cols sqlparser.SelectExprs)
AddExprs adds new select exprs to the SemTable.
func (*SemTable) Dependencies ¶
Dependencies return the table dependencies of the expression.
func (*SemTable) GetSelectTables ¶ added in v0.11.0
GetSelectTables returns the table in the select.
func (*SemTable) TableInfoFor ¶ added in v0.11.0
TableInfoFor returns the table info for the table set. It should contains only single table.
func (*SemTable) TableSetFor ¶
func (st *SemTable) TableSetFor(t *sqlparser.AliasedTableExpr) TableSet
TableSetFor returns the bitmask for this particular tableshoe
type TableInfo ¶ added in v0.11.0
type TableInfo struct { ASTNode *sqlparser.AliasedTableExpr Table *vindexes.Table // contains filtered or unexported fields }
TableInfo contains the alias table expr and vindex table
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 ¶
Constituents returns an slice with all the individual tables in their own TableSet identifier
func (TableSet) IsOverlapping ¶
IsOverlapping returns true if at least one table exists in both sets
func (TableSet) IsSolvedBy ¶
IsSolvedBy returns true if all of `ts` is contained in `b`
func (TableSet) NumberOfTables ¶
NumberOfTables returns the number of bits set
func (TableSet) TableOffset ¶ added in v0.11.0
TableOffset returns the offset in the Tables array from TableSet