plan

package
v0.0.0-...-261b5b0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2016 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Plan structures, converts AST into a plan, with a DAG of tasks that comprise that plan, the planner is pluggable. The plan tasks are converted to executeable plan in exec.

Package plan is a generated protocol buffer package.

It is generated from these files:
	plan.proto

It has these top-level messages:
	PlanPb
	SelectPb
	ContextPb
	SourcePb
	WherePb
	GroupByPb
	HavingPb
	JoinMergePb
	JoinKeyPb

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotImplemented = fmt.Errorf("QLBridge.plan: not implemented")
	ErrNoDataSource   = fmt.Errorf("QLBridge.plan:  No datasource found")
)
View Source
var (
	ErrInvalidLengthPlan = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowPlan   = fmt.Errorf("proto: integer overflow")
)

Functions

func RewriteDescribeAsSelect

func RewriteDescribeAsSelect(stmt *rel.SqlDescribe, ctx *Context) (*rel.SqlSelect, error)

func RewriteShowAsSelect

func RewriteShowAsSelect(stmt *rel.SqlShow, ctx *Context) (*rel.SqlSelect, error)

RewriteShowAsSelect Rewrite Schema SHOW Statements AS SELECT statements

so we only need a Select Planner, not separate planner for show statements

Types

type Command

type Command struct {
	*PlanBase
	Ctx  *Context
	Stmt *rel.SqlCommand
}

func (*Command) Walk

func (m *Command) Walk(p Planner) error

type Context

type Context struct {

	// Stateful Fields that are transported to participate across network/nodes
	context.Context        // Cross-boundry net context
	SchemaName      string // schema name to load schema with

	Raw        string           // Raw sql statement
	Stmt       rel.SqlStatement // Original Statement
	Projection *Projection      // Projection for this context optional

	// Local in-memory helpers not transported across network
	Session expr.ContextReadWriter // Session for this connection
	Schema  *schema.Schema         // this schema for this connection
	Funcs   expr.FuncResolver      // Local/Dialect specific functions

	// From configuration
	DisableRecover bool

	// Local State
	Errors []error
	// contains filtered or unexported fields
}

Context for Plan/Execution of a Relational task - may be transported across network boundaries to particpate in dag of tasks - holds references to in-mem data structures for schema - holds references to original statement - holds task specific state for errors, ids, etc (net.context) - manages Recover() - to persist/transport state

func NewContext

func NewContext(query string) *Context

NewContext plan context

func NewContextFromPb

func NewContextFromPb(pb *ContextPb) *Context

func (*Context) Equal

func (m *Context) Equal(c *Context) bool

func (*Context) Recover

func (m *Context) Recover()

called by go routines/tasks to ensure any recovery panics are captured

func (*Context) ToPB

func (m *Context) ToPB() *ContextPb

called by go routines/tasks to ensure any recovery panics are captured

type ContextPb

type ContextPb struct {
	Schema           string `protobuf:"bytes,1,req,name=schema" json:"schema"`
	Id               uint64 `protobuf:"varint,2,req,name=id" json:"id"`
	Fingerprint      uint64 `protobuf:"varint,3,req,name=fingerprint" json:"fingerprint"`
	XXX_unrecognized []byte `json:"-"`
}

Context

func (*ContextPb) Descriptor

func (*ContextPb) Descriptor() ([]byte, []int)

func (*ContextPb) Marshal

func (m *ContextPb) Marshal() (data []byte, err error)

func (*ContextPb) MarshalTo

func (m *ContextPb) MarshalTo(data []byte) (int, error)

func (*ContextPb) ProtoMessage

func (*ContextPb) ProtoMessage()

func (*ContextPb) Reset

func (m *ContextPb) Reset()

func (*ContextPb) Size

func (m *ContextPb) Size() (n int)

func (*ContextPb) String

func (m *ContextPb) String() string

func (*ContextPb) Unmarshal

func (m *ContextPb) Unmarshal(data []byte) error

type Delete

type Delete struct {
	*PlanBase
	Stmt   *rel.SqlDelete
	Source schema.ConnDeletion
}

func (*Delete) Walk

func (m *Delete) Walk(p Planner) error

type GroupBy

type GroupBy struct {
	*PlanBase
	Stmt    *rel.SqlSelect
	Partial bool
}

func GroupByFromPB

func GroupByFromPB(pb *PlanPb) *GroupBy

func NewGroupBy

func NewGroupBy(stmt *rel.SqlSelect) *GroupBy

func (*GroupBy) Equal

func (m *GroupBy) Equal(t Task) bool

func (*GroupBy) ToPb

func (m *GroupBy) ToPb() (*PlanPb, error)

type GroupByPb

type GroupByPb struct {
	Select           *rel.SqlSelectPb `protobuf:"bytes,1,opt,name=select" json:"select,omitempty"`
	XXX_unrecognized []byte           `json:"-"`
}

Group By Plan

func (*GroupByPb) Descriptor

func (*GroupByPb) Descriptor() ([]byte, []int)

func (*GroupByPb) Marshal

func (m *GroupByPb) Marshal() (data []byte, err error)

func (*GroupByPb) MarshalTo

func (m *GroupByPb) MarshalTo(data []byte) (int, error)

func (*GroupByPb) ProtoMessage

func (*GroupByPb) ProtoMessage()

func (*GroupByPb) Reset

func (m *GroupByPb) Reset()

func (*GroupByPb) Size

func (m *GroupByPb) Size() (n int)

func (*GroupByPb) String

func (m *GroupByPb) String() string

func (*GroupByPb) Unmarshal

func (m *GroupByPb) Unmarshal(data []byte) error

type Having

type Having struct {
	*PlanBase
	Stmt *rel.SqlSelect
}

Having, post-aggregation filter

func HavingFromPB

func HavingFromPB(pb *PlanPb) *Having

func NewHaving

func NewHaving(stmt *rel.SqlSelect) *Having

func (*Having) Equal

func (m *Having) Equal(t Task) bool

func (*Having) ToPb

func (m *Having) ToPb() (*PlanPb, error)

type HavingPb

type HavingPb struct {
	Select           *rel.SqlSelectPb `protobuf:"bytes,1,opt,name=select" json:"select,omitempty"`
	XXX_unrecognized []byte           `json:"-"`
}

func (*HavingPb) Descriptor

func (*HavingPb) Descriptor() ([]byte, []int)

func (*HavingPb) Marshal

func (m *HavingPb) Marshal() (data []byte, err error)

func (*HavingPb) MarshalTo

func (m *HavingPb) MarshalTo(data []byte) (int, error)

func (*HavingPb) ProtoMessage

func (*HavingPb) ProtoMessage()

func (*HavingPb) Reset

func (m *HavingPb) Reset()

func (*HavingPb) Size

func (m *HavingPb) Size() (n int)

func (*HavingPb) String

func (m *HavingPb) String() string

func (*HavingPb) Unmarshal

func (m *HavingPb) Unmarshal(data []byte) error

type Insert

type Insert struct {
	*PlanBase
	Stmt   *rel.SqlInsert
	Source schema.ConnUpsert
}

func (*Insert) Walk

func (m *Insert) Walk(p Planner) error

type Into

type Into struct {
	*PlanBase
	Stmt *rel.SqlInto
}

Select INTO table

func (*Into) Equal

func (m *Into) Equal(t Task) bool

type JoinKey

type JoinKey struct {
	*PlanBase
	Source *Source
}

func NewJoinKey

func NewJoinKey(s *Source) *JoinKey

func (*JoinKey) Equal

func (m *JoinKey) Equal(t Task) bool

type JoinKeyPb

type JoinKeyPb struct {
	Having           *expr.NodePb `protobuf:"bytes,1,opt,name=having" json:"having,omitempty"`
	XXX_unrecognized []byte       `json:"-"`
}

func (*JoinKeyPb) Descriptor

func (*JoinKeyPb) Descriptor() ([]byte, []int)

func (*JoinKeyPb) Marshal

func (m *JoinKeyPb) Marshal() (data []byte, err error)

func (*JoinKeyPb) MarshalTo

func (m *JoinKeyPb) MarshalTo(data []byte) (int, error)

func (*JoinKeyPb) ProtoMessage

func (*JoinKeyPb) ProtoMessage()

func (*JoinKeyPb) Reset

func (m *JoinKeyPb) Reset()

func (*JoinKeyPb) Size

func (m *JoinKeyPb) Size() (n int)

func (*JoinKeyPb) String

func (m *JoinKeyPb) String() string

func (*JoinKeyPb) Unmarshal

func (m *JoinKeyPb) Unmarshal(data []byte) error

type JoinMerge

type JoinMerge struct {
	*PlanBase
	Left      Task
	Right     Task
	LeftFrom  *rel.SqlSource
	RightFrom *rel.SqlSource
	ColIndex  map[string]int
}

2 source/input tasks for join

func NewJoinMerge

func NewJoinMerge(l, r Task, lf, rf *rel.SqlSource) *JoinMerge

A parallel join merge, uses Key() as value to merge two different input channels

left source  ->
               \
                 --  join  -->
               /
right source ->

func (*JoinMerge) Equal

func (m *JoinMerge) Equal(t Task) bool

type JoinMergePb

type JoinMergePb struct {
	Having           *expr.NodePb `protobuf:"bytes,1,opt,name=having" json:"having,omitempty"`
	XXX_unrecognized []byte       `json:"-"`
}

func (*JoinMergePb) Descriptor

func (*JoinMergePb) Descriptor() ([]byte, []int)

func (*JoinMergePb) Marshal

func (m *JoinMergePb) Marshal() (data []byte, err error)

func (*JoinMergePb) MarshalTo

func (m *JoinMergePb) MarshalTo(data []byte) (int, error)

func (*JoinMergePb) ProtoMessage

func (*JoinMergePb) ProtoMessage()

func (*JoinMergePb) Reset

func (m *JoinMergePb) Reset()

func (*JoinMergePb) Size

func (m *JoinMergePb) Size() (n int)

func (*JoinMergePb) String

func (m *JoinMergePb) String() string

func (*JoinMergePb) Unmarshal

func (m *JoinMergePb) Unmarshal(data []byte) error

type NextIdFunc

type NextIdFunc func() uint64
var NextId NextIdFunc

type PlanBase

type PlanBase struct {
	RootTask Task // Root task
	// contains filtered or unexported fields
}

func NewPlanBase

func NewPlanBase(isParallel bool) *PlanBase

func (*PlanBase) Add

func (m *PlanBase) Add(task Task) error

func (*PlanBase) Children

func (m *PlanBase) Children() []Task

func (*PlanBase) Close

func (m *PlanBase) Close() error

func (*PlanBase) Equal

func (m *PlanBase) Equal(t Task) bool

func (*PlanBase) EqualBase

func (m *PlanBase) EqualBase(p *PlanBase) bool

func (*PlanBase) IsParallel

func (m *PlanBase) IsParallel() bool

func (*PlanBase) IsSequential

func (m *PlanBase) IsSequential() bool

func (*PlanBase) Run

func (m *PlanBase) Run() error

func (*PlanBase) SetParallel

func (m *PlanBase) SetParallel()

func (*PlanBase) SetSequential

func (m *PlanBase) SetSequential()

func (*PlanBase) ToPb

func (m *PlanBase) ToPb() (*PlanPb, error)

func (*PlanBase) Walk

func (m *PlanBase) Walk(p Planner) error

type PlanPb

type PlanPb struct {
	Parallel         bool              `protobuf:"varint,1,req,name=parallel" json:"parallel"`
	Select           *SelectPb         `protobuf:"bytes,3,opt,name=select" json:"select,omitempty"`
	Source           *SourcePb         `protobuf:"bytes,4,opt,name=source" json:"source,omitempty"`
	Where            *WherePb          `protobuf:"bytes,5,opt,name=where" json:"where,omitempty"`
	Having           *HavingPb         `protobuf:"bytes,6,opt,name=having" json:"having,omitempty"`
	GroupBy          *GroupByPb        `protobuf:"bytes,7,opt,name=groupBy" json:"groupBy,omitempty"`
	JoinMerge        *JoinMergePb      `protobuf:"bytes,8,opt,name=joinMerge" json:"joinMerge,omitempty"`
	JoinKey          *JoinKeyPb        `protobuf:"bytes,9,opt,name=joinKey" json:"joinKey,omitempty"`
	Projection       *rel.ProjectionPb `protobuf:"bytes,10,opt,name=projection" json:"projection,omitempty"`
	Children         []*PlanPb         `protobuf:"bytes,11,rep,name=children" json:"children,omitempty"`
	XXX_unrecognized []byte            `json:"-"`
}

The generic Node, must be exactly one of these types

func (*PlanPb) Descriptor

func (*PlanPb) Descriptor() ([]byte, []int)

func (*PlanPb) Marshal

func (m *PlanPb) Marshal() (data []byte, err error)

func (*PlanPb) MarshalTo

func (m *PlanPb) MarshalTo(data []byte) (int, error)

func (*PlanPb) ProtoMessage

func (*PlanPb) ProtoMessage()

func (*PlanPb) Reset

func (m *PlanPb) Reset()

func (*PlanPb) Size

func (m *PlanPb) Size() (n int)

func (*PlanPb) String

func (m *PlanPb) String() string

func (*PlanPb) Unmarshal

func (m *PlanPb) Unmarshal(data []byte) error

type PlanProto

type PlanProto interface {
	proto.Marshaler
	proto.Unmarshaler
}

type Planner

type Planner interface {
	WalkPreparedStatement(p *PreparedStatement) error
	WalkSelect(p *Select) error
	WalkInsert(p *Insert) error
	WalkUpsert(p *Upsert) error
	WalkUpdate(p *Update) error
	WalkDelete(p *Delete) error
	WalkCommand(p *Command) error
	WalkInto(p *Into) error

	WalkSourceSelect(p *Source) error
	WalkProjectionSource(p *Source) error
	WalkProjectionFinal(p *Select) error
}

Planner defines the planner interfaces, so our planner package can

expect implementations from downstream packages
in our case:
      qlbridge/exec package implements a non-distributed query-planner
      dataux/planner implements a distributed query-planner

type PlannerDefault

type PlannerDefault struct {
	Planner Planner
	Ctx     *Context
	// contains filtered or unexported fields
}

PlannerDefault is implementation of Planner that creates a dag of plan.Tasks that will be turned into execution plan by executor. This is a simple planner but can be over-ridden by providing a Planner that will supercede any single or more visit methods. - stateful, specific to a single request

func NewPlanner

func NewPlanner(ctx *Context) *PlannerDefault

func (*PlannerDefault) WalkCommand

func (m *PlannerDefault) WalkCommand(p *Command) error

func (*PlannerDefault) WalkDelete

func (m *PlannerDefault) WalkDelete(p *Delete) error

func (*PlannerDefault) WalkInsert

func (m *PlannerDefault) WalkInsert(p *Insert) error

func (*PlannerDefault) WalkInto

func (m *PlannerDefault) WalkInto(p *Into) error

func (*PlannerDefault) WalkLiteralQuery

func (m *PlannerDefault) WalkLiteralQuery(p *Select) error

Handle Literal queries such as "SELECT 1, @var;"

func (*PlannerDefault) WalkPreparedStatement

func (m *PlannerDefault) WalkPreparedStatement(p *PreparedStatement) error

func (*PlannerDefault) WalkProjectionFinal

func (m *PlannerDefault) WalkProjectionFinal(p *Select) error

func (*PlannerDefault) WalkProjectionSource

func (m *PlannerDefault) WalkProjectionSource(p *Source) error

func (*PlannerDefault) WalkSelect

func (m *PlannerDefault) WalkSelect(p *Select) error

func (*PlannerDefault) WalkSourceSelect

func (m *PlannerDefault) WalkSourceSelect(p *Source) error

SourceSelect is a single source select

func (*PlannerDefault) WalkUpdate

func (m *PlannerDefault) WalkUpdate(p *Update) error

func (*PlannerDefault) WalkUpsert

func (m *PlannerDefault) WalkUpsert(p *Upsert) error

type PreparedStatement

type PreparedStatement struct {
	*PlanBase
	Stmt *rel.PreparedStatement
}

func (*PreparedStatement) Walk

func (m *PreparedStatement) Walk(p Planner) error

type Projection

type Projection struct {
	*PlanBase
	Final bool // Is this final projection or not?
	P     *Select
	Stmt  *rel.SqlSelect
	Proj  *rel.Projection
}

Projection holds original query for column info and schema/field types

func NewProjectionFinal

func NewProjectionFinal(ctx *Context, p *Select) (*Projection, error)

Final Projections project final select columns for result-writing

func NewProjectionInProcess

func NewProjectionInProcess(stmt *rel.SqlSelect) *Projection

func NewProjectionStatic

func NewProjectionStatic(proj *rel.Projection) *Projection

A static projection has already had its column/types defined

and doesn't need to use internal schema to find it, often internal SHOW/DESCRIBE

func ProjectionFromPB

func ProjectionFromPB(pb *PlanPb, sel *rel.SqlSelect) *Projection

func (*Projection) Equal

func (m *Projection) Equal(t Task) bool

func (*Projection) ToPb

func (m *Projection) ToPb() (*PlanPb, error)

type SchemaLoader

type SchemaLoader func(name string) (*schema.Schema, error)

SchemaLoader

type Select

type Select struct {
	*PlanBase
	Ctx      *Context
	From     []*Source
	Stmt     *rel.SqlSelect
	ChildDag bool
	// contains filtered or unexported fields
}

func SelectFromPB

func SelectFromPB(pb *PlanPb, loader SchemaLoader) (*Select, error)

func SelectPlanFromPbBytes

func SelectPlanFromPbBytes(pb []byte, loader SchemaLoader) (*Select, error)

Create a sql plan from pb

func (*Select) Equal

func (m *Select) Equal(t Task) bool

func (*Select) IsSchemaQuery

func (m *Select) IsSchemaQuery() bool

func (*Select) Marshal

func (m *Select) Marshal() ([]byte, error)

func (*Select) MarshalTo

func (m *Select) MarshalTo(data []byte) (int, error)

func (*Select) NeedsFinalProjection

func (m *Select) NeedsFinalProjection() bool

func (*Select) Size

func (m *Select) Size() (n int)

func (*Select) Unmarshal

func (m *Select) Unmarshal(data []byte) error

func (*Select) Walk

func (m *Select) Walk(p Planner) error

type SelectPb

type SelectPb struct {
	Select           *rel.SqlSelectPb `protobuf:"bytes,1,req,name=select" json:"select,omitempty"`
	Context          *ContextPb       `protobuf:"bytes,2,opt,name=context" json:"context,omitempty"`
	XXX_unrecognized []byte           `json:"-"`
}

Select Plan

func (*SelectPb) Descriptor

func (*SelectPb) Descriptor() ([]byte, []int)

func (*SelectPb) Marshal

func (m *SelectPb) Marshal() (data []byte, err error)

func (*SelectPb) MarshalTo

func (m *SelectPb) MarshalTo(data []byte) (int, error)

func (*SelectPb) ProtoMessage

func (*SelectPb) ProtoMessage()

func (*SelectPb) Reset

func (m *SelectPb) Reset()

func (*SelectPb) Size

func (m *SelectPb) Size() (n int)

func (*SelectPb) String

func (m *SelectPb) String() string

func (*SelectPb) Unmarshal

func (m *SelectPb) Unmarshal(data []byte) error

type SelectTask

type SelectTask interface {
	Equal(Task) bool
}

type Source

type Source struct {
	*PlanBase

	// Request Information, if cross-node distributed query must be serialized
	*SourcePb
	Stmt     *rel.SqlSource  // The sub-query statement (may have been rewritten)
	Proj     *rel.Projection // projection for this sub-query
	ExecPlan PlanProto       // If SourceExec has a plan?
	Custom   u.JsonHelper    // Source specific context info

	DataSource   schema.Source        // The data source for this From
	Conn         schema.Conn          // Connection for this source, only for this source/task
	SchemaSource *schema.SchemaSource // Schema for this source/from
	Tbl          *schema.Table        // Table schema for this From
	Static       []driver.Value       // this is static data source
	Cols         []string
	// contains filtered or unexported fields
}

Within a Select query, it optionally has multiple sources such

as sub-select, join, etc this is the plan for a each source

func NewSource

func NewSource(ctx *Context, stmt *rel.SqlSource, isFinal bool) (*Source, error)

func NewSourceStaticPlan

func NewSourceStaticPlan(ctx *Context) *Source

func SourceFromPB

func SourceFromPB(pb *PlanPb, ctx *Context) (*Source, error)

func (*Source) Context

func (m *Source) Context() *Context

func (*Source) Equal

func (m *Source) Equal(t Task) bool

func (*Source) IsSchemaQuery

func (m *Source) IsSchemaQuery() bool

func (*Source) LoadConn

func (m *Source) LoadConn() error

func (*Source) Marshal

func (m *Source) Marshal() ([]byte, error)

func (*Source) MarshalTo

func (m *Source) MarshalTo(data []byte) (n int, err error)

func (*Source) Size

func (m *Source) Size() (n int)

func (*Source) ToPb

func (m *Source) ToPb() (*PlanPb, error)

func (*Source) Unmarshal

func (m *Source) Unmarshal(data []byte) error

func (*Source) Walk

func (m *Source) Walk(p Planner) error

type SourcePb

type SourcePb struct {
	// do we need group-by, join, partition key for routing purposes?
	NeedsHashableKey bool `protobuf:"varint,2,req,name=needsHashableKey" json:"needsHashableKey"`
	// Is this final projection or not?  non finals are partial-sub-query types
	Final bool `protobuf:"varint,3,req,name=final" json:"final"`
	// Is this plan complete as is?  skip remaining plan walk steps
	Complete         bool              `protobuf:"varint,4,req,name=complete" json:"complete"`
	Join             bool              `protobuf:"varint,5,req,name=join" json:"join"`
	SourceExec       bool              `protobuf:"varint,6,req,name=sourceExec" json:"sourceExec"`
	Custom           []byte            `protobuf:"bytes,7,opt,name=custom" json:"custom,omitempty"`
	SqlSource        *rel.SqlSourcePb  `protobuf:"bytes,8,opt,name=sqlSource" json:"sqlSource,omitempty"`
	Projection       *rel.ProjectionPb `protobuf:"bytes,9,opt,name=projection" json:"projection,omitempty"`
	XXX_unrecognized []byte            `json:"-"`
}

Source Plan is a plan for single source of select query, of which many may exist (joins, sub-querys etc)

func (*SourcePb) Descriptor

func (*SourcePb) Descriptor() ([]byte, []int)

func (*SourcePb) Marshal

func (m *SourcePb) Marshal() (data []byte, err error)

func (*SourcePb) MarshalTo

func (m *SourcePb) MarshalTo(data []byte) (int, error)

func (*SourcePb) ProtoMessage

func (*SourcePb) ProtoMessage()

func (*SourcePb) Reset

func (m *SourcePb) Reset()

func (*SourcePb) Size

func (m *SourcePb) Size() (n int)

func (*SourcePb) String

func (m *SourcePb) String() string

func (*SourcePb) Unmarshal

func (m *SourcePb) Unmarshal(data []byte) error

type SourcePlanner

type SourcePlanner interface {
	// given our request statement, turn that into a plan.Task.
	WalkSourceSelect(pl Planner, s *Source) (Task, error)
}

Sources can often do their own planning for sub-select statements

ie mysql can do its own (select, projection) mongo, es can as well

- provide interface to allow passing down select planning to source

type Task

type Task interface {
	Walk(p Planner) error

	// TODO, move to exec.Task
	Run() error
	Close() error

	Children() []Task // children sub-tasks
	Add(Task) error   // Add a child to this dag

	IsSequential() bool
	SetSequential()
	IsParallel() bool
	SetParallel()
	Equal(Task) bool
	ToPb() (*PlanPb, error)
}

Plan Tasks are inherently DAG's of task's implementing

a rel.Task interface

func SelectTaskFromTaskPb

func SelectTaskFromTaskPb(pb *PlanPb, ctx *Context, sel *rel.SqlSelect) (Task, error)

func WalkStmt

func WalkStmt(ctx *Context, stmt rel.SqlStatement, planner Planner) (Task, error)

Walk given statement for given Planner to produce a query plan

which is a plan.Task and children, ie a DAG of tasks

type Update

type Update struct {
	*PlanBase
	Stmt   *rel.SqlUpdate
	Source schema.ConnUpsert
}

func (*Update) Walk

func (m *Update) Walk(p Planner) error

type Upsert

type Upsert struct {
	*PlanBase
	Stmt   *rel.SqlUpsert
	Source schema.ConnUpsert
}

func (*Upsert) Walk

func (m *Upsert) Walk(p Planner) error

type Where

type Where struct {
	*PlanBase
	Final bool
	Stmt  *rel.SqlSelect
}

Where, pre-aggregation filter

func NewWhere

func NewWhere(stmt *rel.SqlSelect) *Where

func NewWhereFinal

func NewWhereFinal(stmt *rel.SqlSelect) *Where

func WhereFromPB

func WhereFromPB(pb *PlanPb) *Where

func (*Where) Equal

func (m *Where) Equal(t Task) bool

func (*Where) ToPb

func (m *Where) ToPb() (*PlanPb, error)

type WherePb

type WherePb struct {
	Select           *rel.SqlSelectPb `protobuf:"bytes,1,opt,name=select" json:"select,omitempty"`
	Final            bool             `protobuf:"varint,2,req,name=final" json:"final"`
	XXX_unrecognized []byte           `json:"-"`
}

Where Plan

func (*WherePb) Descriptor

func (*WherePb) Descriptor() ([]byte, []int)

func (*WherePb) Marshal

func (m *WherePb) Marshal() (data []byte, err error)

func (*WherePb) MarshalTo

func (m *WherePb) MarshalTo(data []byte) (int, error)

func (*WherePb) ProtoMessage

func (*WherePb) ProtoMessage()

func (*WherePb) Reset

func (m *WherePb) Reset()

func (*WherePb) Size

func (m *WherePb) Size() (n int)

func (*WherePb) String

func (m *WherePb) String() string

func (*WherePb) Unmarshal

func (m *WherePb) Unmarshal(data []byte) error

Jump to

Keyboard shortcuts

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