plan2

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BuiltinFunctions = [...]*FunctionSig{}/* 142 elements not displayed */

Functions shipped by system.

View Source
var BuiltinFunctionsMap map[string]*FunctionSig

BuiltinFunctionsMap change BuiltinFunctions to map

Functions

This section is empty.

Types

type CompilerContext

type CompilerContext interface {
	Resolve(name string) (*plan.ObjectRef, *plan.TableDef)
	Cost(obj *ObjectRef, e *Expr) *Cost //change Cost to *Cost to fixed "return copies lock value" warning in new proto code generated
}

type Const

type Const plan.Const

type Cost

type Cost plan.Cost

type Expr

type Expr plan.Expr

type FunctionSig

type FunctionSig struct {
	Name         string
	Flag         plan.Function_FuncFlag
	ArgTypeClass []plan.Type_TypeId
	ArgType      []int8
}

Function signature. ArgTypeClass and ArgType need some explaination. ArgTypeClass defines type equivalent class for this function. The first equivlent class is the return type. For each argument of this function it has a arg type, which is an index into the ArgTypeClass. Let's use an example,

"=", STRICT, {BOOL, ANY}, {1, 1}}

means,

function name is "=".
it is a STRICT function, that is, it will return null iff
        it has a null arguments
Two type equivalent class
        first is BOOL, means the the return type is BOOL
        second is ANY, means any type
{1, 1}, means the function take two arguments.
        first arg is of type class 1, which is ANY
        second arg is of type class 1 too, which is ANY
        both arg is of same class, means they must be same
        type.

Therefore, it means "=" is a strict function, taking two arguments of ANY type (but both arguments must be of SAME type), and return BOOL.

type MockCompilerContext

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

func NewMockCompilerContext

func NewMockCompilerContext() *MockCompilerContext

func (*MockCompilerContext) Cost

func (m *MockCompilerContext) Cost(obj *ObjectRef, e *Expr) *Cost

func (*MockCompilerContext) Resolve

func (m *MockCompilerContext) Resolve(name string) (*plan.ObjectRef, *plan.TableDef)

type MockOptimizer

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

func (*MockOptimizer) CurrentContext

func (moc *MockOptimizer) CurrentContext() CompilerContext

func (*MockOptimizer) Optimize

func (moc *MockOptimizer) Optimize(stmt tree.Statement) (*Query, error)

type Node

type Node plan.Node

type ObjectRef

type ObjectRef plan.ObjectRef

type Optimizer

type Optimizer interface {
	Optimize(stmt tree.Statement) (*Query, error) //todo confirm interface change
	CurrentContext() CompilerContext
}

type Query

type Query plan.Query

type RowsetData

type RowsetData plan.RowsetData

type SelectContext

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

use for build select

type TableDef

type TableDef plan.TableDef

Jump to

Keyboard shortcuts

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