opcode

package
v0.18.3 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PulloutValue = PulloutOpcode(iota)
	PulloutIn
	PulloutNotIn
	PulloutExists
	PulloutNotExists
)

This is the list of PulloutOpcode values.

View Source
const (
	AggregateUnassigned = AggregateOpcode(iota)
	AggregateCount
	AggregateSum
	AggregateMin
	AggregateMax
	AggregateCountDistinct
	AggregateSumDistinct
	AggregateGtid
	AggregateAnyValue
	AggregateCountStar
	AggregateGroupConcat
)

These constants list the possible aggregate opcodes.

Variables

View Source
var AggregateName = map[AggregateOpcode]string{
	AggregateCount:         "count",
	AggregateSum:           "sum",
	AggregateMin:           "min",
	AggregateMax:           "max",
	AggregateCountDistinct: "count_distinct",
	AggregateSumDistinct:   "sum_distinct",
	AggregateGtid:          "vgtid",
	AggregateCountStar:     "count_star",
	AggregateGroupConcat:   "group_concat",
	AggregateAnyValue:      "any_value",
}
View Source
var (
	// OpcodeType keeps track of the known output types for different aggregate functions
	OpcodeType = map[AggregateOpcode]querypb.Type{
		AggregateCountDistinct: sqltypes.Int64,
		AggregateCount:         sqltypes.Int64,
		AggregateCountStar:     sqltypes.Int64,
		AggregateSumDistinct:   sqltypes.Decimal,
		AggregateSum:           sqltypes.Decimal,
		AggregateGtid:          sqltypes.VarChar,
	}
)
View Source
var SupportedAggregates = map[string]AggregateOpcode{
	"count": AggregateCount,
	"sum":   AggregateSum,
	"min":   AggregateMin,
	"max":   AggregateMax,

	"count_distinct": AggregateCountDistinct,
	"sum_distinct":   AggregateSumDistinct,
	"vgtid":          AggregateGtid,
	"count_star":     AggregateCountStar,
	"any_value":      AggregateAnyValue,
	"group_concat":   AggregateGroupConcat,
}

SupportedAggregates maps the list of supported aggregate functions to their opcodes.

Functions

This section is empty.

Types

type AggregateOpcode

type AggregateOpcode int

AggregateOpcode is the aggregation Opcode.

func (AggregateOpcode) IsDistinct added in v0.18.0

func (code AggregateOpcode) IsDistinct() bool

func (AggregateOpcode) MarshalJSON

func (code AggregateOpcode) MarshalJSON() ([]byte, error)

MarshalJSON serializes the AggregateOpcode as a JSON string. It's used for testing and diagnostics.

func (AggregateOpcode) NeedsComparableValues added in v0.18.0

func (code AggregateOpcode) NeedsComparableValues() bool

func (AggregateOpcode) String

func (code AggregateOpcode) String() string

func (AggregateOpcode) Type added in v0.18.0

func (code AggregateOpcode) Type(typ querypb.Type) querypb.Type

Type returns the opcode return sql type, and a bool telling is we are sure about this type or not

type PulloutOpcode

type PulloutOpcode int

PulloutOpcode is a number representing the opcode for the PulloutSubquery primitive.

func (PulloutOpcode) MarshalJSON

func (code PulloutOpcode) MarshalJSON() ([]byte, error)

MarshalJSON serializes the PulloutOpcode as a JSON string. It's used for testing and diagnostics.

func (PulloutOpcode) NeedsListArg added in v0.18.0

func (code PulloutOpcode) NeedsListArg() bool

func (PulloutOpcode) String

func (code PulloutOpcode) String() string

Jump to

Keyboard shortcuts

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