{"modulePath":"github.com/matrixorigin/matrixone","version":"v0.7.0","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package operator\n\n## Constants\n\n```go\nconst (\n\tAND logicType = 0\n\tOR  logicType = 1\n\tXOR logicType = 2\n)\n```\n\n## Variables\n\n```go\nvar (\n\tCaseWhenUint8 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn cwGeneral[uint8](vs, proc, types.Type{Oid: types.T_uint8})\n\t}\n\n\tCaseWhenUint16 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn cwGeneral[uint16](vs, proc, types.Type{Oid: types.T_uint16})\n\t}\n\n\tCaseWhenUint32 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn cwGeneral[uint32](vs, proc, types.Type{Oid: types.T_uint32})\n\t}\n\n\tCaseWhenUint64 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn cwGeneral[uint64](vs, proc, types.Type{Oid: types.T_uint64})\n\t}\n\n\tCaseWhenInt8 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn cwGeneral[int8](vs, proc, types.Type{Oid: types.T_int8})\n\t}\n\n\tCaseWhenInt16 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn cwGeneral[int16](vs, proc, types.Type{Oid: types.T_int16})\n\t}\n\n\tCaseWhenInt32 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn cwGeneral[int32](vs, proc, types.Type{Oid: types.T_int32})\n\t}\n\n\tCaseWhenInt64 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn cwGeneral[int64](vs, proc, types.Type{Oid: types.T_int64})\n\t}\n\n\tCaseWhenFloat32 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn cwGeneral[float32](vs, proc, types.Type{Oid: types.T_float32})\n\t}\n\n\tCaseWhenFloat64 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn cwGeneral[float64](vs, proc, types.Type{Oid: types.T_float64})\n\t}\n\n\tCaseWhenBool = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn cwGeneral[bool](vs, proc, types.Type{Oid: types.T_bool})\n\t}\n\n\tCaseWhenDate = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn cwGeneral[types.Date](vs, proc, types.Type{Oid: types.T_date})\n\t}\n\n\tCaseWhenTime = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn cwGeneral[types.Time](vs, proc, types.Type{Oid: types.T_time})\n\t}\n\n\tCaseWhenDateTime = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn cwGeneral[types.Datetime](vs, proc, types.Type{Oid: types.T_datetime})\n\t}\n\n\tCaseWhenVarchar = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn cwString(vs, proc, types.Type{Oid: types.T_varchar, Width: types.MaxVarcharLen})\n\t}\n\n\tCaseWhenChar = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn cwString(vs, proc, types.Type{Oid: types.T_char})\n\t}\n\n\tCaseWhenDecimal64 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn cwGeneral[types.Decimal64](vs, proc, types.Type{Oid: types.T_decimal64})\n\t}\n\n\tCaseWhenDecimal128 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn cwGeneral[types.Decimal128](vs, proc, types.Type{Oid: types.T_decimal128})\n\t}\n\n\tCaseWhenTimestamp = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn cwGeneral[types.Timestamp](vs, proc, types.Type{Oid: types.T_timestamp})\n\t}\n\n\tCaseWhenUuid = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn cwGeneral[types.Uuid](vs, proc, types.Type{Oid: types.T_uuid})\n\t}\n\n\tCaseWhenBlob = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn cwString(vs, proc, types.Type{Oid: types.T_blob})\n\t}\n\n\tCaseWhenText = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn cwString(vs, proc, types.Type{Oid: types.T_text})\n\t}\n\n\tCaseWhenJson = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn cwString(vs, proc, types.Type{Oid: types.T_json})\n\t}\n)\n```\ncase-when operator only support format like that\n\n\t`\n\t\tcase\n\t\twhen A = a1 then ...\n\t\twhen A = a2 then ...\n\t\twhen A = a3 then ...\n\t\t(else ...)\n\t`\n\nformat \\`case A when a1 then ... when a2 then ...\\` should be converted to required format.\n\n```go\nvar (\n\tCoalesceUint8 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn coalesceGeneral[uint8](vs, proc, types.Type{Oid: types.T_uint8})\n\t}\n\n\tCoalesceUint16 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn coalesceGeneral[uint16](vs, proc, types.Type{Oid: types.T_uint16})\n\t}\n\n\tCoalesceUint32 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn coalesceGeneral[uint32](vs, proc, types.Type{Oid: types.T_uint32})\n\t}\n\n\tCoalesceUint64 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn coalesceGeneral[uint64](vs, proc, types.Type{Oid: types.T_uint64})\n\t}\n\n\tCoalesceInt8 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn coalesceGeneral[int8](vs, proc, types.Type{Oid: types.T_int8})\n\t}\n\n\tCoalesceInt16 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn coalesceGeneral[int16](vs, proc, types.Type{Oid: types.T_int16})\n\t}\n\n\tCoalesceInt32 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn coalesceGeneral[int32](vs, proc, types.Type{Oid: types.T_int32})\n\t}\n\n\tCoalesceInt64 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn coalesceGeneral[int64](vs, proc, types.Type{Oid: types.T_int64})\n\t}\n\n\tCoalesceFloat32 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn coalesceGeneral[float32](vs, proc, types.Type{Oid: types.T_float32})\n\t}\n\n\tCoalesceFloat64 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn coalesceGeneral[float64](vs, proc, types.Type{Oid: types.T_float64})\n\t}\n\n\tCoalesceBool = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn coalesceGeneral[bool](vs, proc, types.Type{Oid: types.T_bool})\n\t}\n\n\tCoalesceDate = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn coalesceGeneral[types.Date](vs, proc, types.Type{Oid: types.T_date})\n\t}\n\n\tCoalesceTime = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn coalesceGeneral[types.Time](vs, proc, types.Type{Oid: types.T_time})\n\t}\n\n\tCoalesceDateTime = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn coalesceGeneral[types.Datetime](vs, proc, types.Type{Oid: types.T_datetime})\n\t}\n\n\tCoalesceVarchar = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn coalesceString(vs, proc, types.Type{Oid: types.T_varchar, Width: types.MaxVarcharLen})\n\t}\n\n\tCoalesceChar = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn coalesceString(vs, proc, types.Type{Oid: types.T_char})\n\t}\n\n\tCoalesceJson = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn coalesceString(vs, proc, types.Type{Oid: types.T_json.ToType().Oid})\n\t}\n\n\tCoalesceBlob = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn coalesceString(vs, proc, types.Type{Oid: types.T_blob.ToType().Oid})\n\t}\n\n\tCoalesceText = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn coalesceString(vs, proc, types.Type{Oid: types.T_text.ToType().Oid})\n\t}\n\n\tCoalesceDecimal64 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn coalesceGeneral[types.Decimal64](vs, proc, types.Type{Oid: types.T_decimal64})\n\t}\n\n\tCoalesceDecimal128 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn coalesceGeneral[types.Decimal128](vs, proc, types.Type{Oid: types.T_decimal128})\n\t}\n\n\tCoalesceTimestamp = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn coalesceGeneral[types.Timestamp](vs, proc, types.Type{Oid: types.T_timestamp})\n\t}\n\n\tCoalesceUuid = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn coalesceGeneral[types.Uuid](vs, proc, types.Type{Oid: types.T_uuid})\n\t}\n)\n```\n\n```go\nvar (\n\tIfBool = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn ifGeneral[bool](vs, proc, types.Type{Oid: types.T_bool})\n\t}\n\n\tIfUint8 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn ifGeneral[uint8](vs, proc, types.Type{Oid: types.T_uint8})\n\t}\n\n\tIfUint16 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn ifGeneral[uint16](vs, proc, types.Type{Oid: types.T_uint16})\n\t}\n\n\tIfUint32 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn ifGeneral[uint32](vs, proc, types.Type{Oid: types.T_uint32})\n\t}\n\n\tIfUint64 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn ifGeneral[uint64](vs, proc, types.Type{Oid: types.T_uint64})\n\t}\n\n\tIfInt8 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn ifGeneral[int8](vs, proc, types.Type{Oid: types.T_int8})\n\t}\n\n\tIfInt16 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn ifGeneral[int16](vs, proc, types.Type{Oid: types.T_int16})\n\t}\n\n\tIfInt32 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn ifGeneral[int32](vs, proc, types.Type{Oid: types.T_int32})\n\t}\n\n\tIfInt64 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn ifGeneral[int64](vs, proc, types.Type{Oid: types.T_int64})\n\t}\n\n\tIfFloat32 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn ifGeneral[float32](vs, proc, types.Type{Oid: types.T_float32})\n\t}\n\n\tIfFloat64 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn ifGeneral[float64](vs, proc, types.Type{Oid: types.T_float64})\n\t}\n\n\tIfDecimal64 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn ifGeneral[types.Decimal64](vs, proc, types.Type{Oid: types.T_decimal64})\n\t}\n\n\tIfDecimal128 = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn ifGeneral[types.Decimal128](vs, proc, types.Type{Oid: types.T_decimal128})\n\t}\n\n\tIfDate = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn ifGeneral[types.Date](vs, proc, types.Type{Oid: types.T_date})\n\t}\n\n\tIfTime = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn ifGeneral[types.Time](vs, proc, types.Type{Oid: types.T_time})\n\t}\n\n\tIfDateTime = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn ifGeneral[types.Datetime](vs, proc, types.Type{Oid: types.T_datetime})\n\t}\n\n\tIfVarchar = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn ifForString(vs, proc, types.Type{Oid: types.T_varchar, Width: types.MaxVarcharLen})\n\t}\n\n\tIfChar = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn ifForString(vs, proc, types.Type{Oid: types.T_char})\n\t}\n\n\tIfTimestamp = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn ifGeneral[types.Timestamp](vs, proc, types.Type{Oid: types.T_timestamp})\n\t}\n\n\tIfBlob = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn ifForString(vs, proc, types.Type{Oid: types.T_blob})\n\t}\n\n\tIfText = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn ifForString(vs, proc, types.Type{Oid: types.T_text})\n\t}\n\n\tIfJson = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn ifForString(vs, proc, types.Type{Oid: types.T_json})\n\t}\n\n\tIfUuid = func(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error) {\n\t\treturn ifForString(vs, proc, types.Type{Oid: types.T_uuid})\n\t}\n)\n```\nIf operator supported format like that\n\n\tIf(\u003cboolean operator\u003e, \u003cvalue operator\u003e, \u003cvalue operator\u003e)\n\n## Functions\n\n```go\nfunc And(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc Arith[T1 arithT, T2 arithT](vectors []*vector.Vector, proc *process.Process, typ types.Type, afn arithFn) (*vector.Vector, error)\n```\nGeneric T1 is the operand type and generic T2 is the return value type\n\n```go\nfunc BoolResult(isMatch bool, isReg bool) bool\n```\n\n```go\nfunc Cast(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastBoolToNumeric[T constraints.Integer](lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastBoolToString(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastDateAsDatetime(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastDateAsString(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastDateAsTime(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastDateAsTimestamp(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nCastDateAsTimestamp : Cast converts date to timestamp\n\n```go\nfunc CastDatetimeAsDate(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nCastDatetimeAsDate : convert datetime to date DateTime : high 44 bits stands for the seconds passed by, low 20 bits stands for the microseconds passed by\n\n```go\nfunc CastDatetimeAsString(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastDatetimeAsTime(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastDatetimeAsTimestamp(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nCastDatetimeAsTimestamp : Cast converts datetime to timestamp\n\n```go\nfunc CastDecimal128AsTime(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastDecimal128AsTimestamp(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastDecimal128ToDecimal64(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nthis cast function is too slow, and therefore only temporary, rewrite needed\n\n```go\nfunc CastDecimal128ToFloat32(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastDecimal128ToFloat64(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastDecimal128ToInt32(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastDecimal128ToInt64(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastDecimal128ToString(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastDecimal128ToUint64(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastDecimal64AsDecimal128(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nCastDecimal64AsDecimal128 : Cast converts decimal64 to decimal128\n\n```go\nfunc CastDecimal64AsTime(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastDecimal64AsTimestamp(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastDecimal64ToFloat32(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastDecimal64ToFloat64(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastDecimal64ToInt64(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastDecimal64ToString(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastDecimal64ToUint64(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastFloat64ToInt64(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nXXX can someone document why this one does not use the templated code? CastFloat64ToInt64 : cast float64 to int64\n\n```go\nfunc CastFloatAsDecimal128[T constraints.Float](lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nXXX This is a super slow function that we need to vectorwise.\n\n```go\nfunc CastFloatAsDecimal64[T constraints.Float](lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nXXX Super slow.\n\n```go\nfunc CastFloatToInt[T1 constraints.Float, T2 constraints.Integer](lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastInt64ToUint64(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nCastInt64ToUint64 : cast int64 to uint64\n\n```go\nfunc CastIntAsTime[T constraints.Signed](lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastIntAsTimestamp[T constraints.Signed](lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastJsonToString(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastLeftToRight[T1, T2 constraints.Integer | constraints.Float](lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nCastLeftToRight : Cast handles conversions in the form of cast (left as right), where left and right are different types,\n\n\tand both left and right are numeric types, Contains the following:\n\nint8 -\u003e (int16/int32/int64/uint8/uint16/uint32/uint64/float32/float64) int16 -\u003e (int8/int32/int64/uint8/uint16/uint32/uint64/float32/float64) int32 -\u003e (int8/int16/int64/uint8/uint16/uint32/uint64/float32/float64) int64 -\u003e (int8/int16/int32/uint8/uint16/uint32/uint64/float32/float64) uint8 -\u003e (int8/int16/int32/int64/uint16/uint32/uint64/float32/float64) uint16 -\u003e (int8/int16/int32/int64/uint8/uint32/uint64/float32/float64) uint32 -\u003e (int8/int16/int32/int64/uint8/uint16/uint64/float32/float64) uint64 -\u003e (int8/int16/int32/int64/uint8/uint16/uint32/float32/float64)\n\n```go\nfunc CastNumValToBool[T constraints.Integer | constraints.Float](lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastSameType[T types.FixedSizeT](lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nCastSameType : Cast handles the same data type and is numeric , Contains the following: int8    -\u003e int8, int16   -\u003e int16, int32   -\u003e int32, int64   -\u003e int64, uint8   -\u003e uint8, uint16  -\u003e uint16, uint32  -\u003e uint32, uint64  -\u003e uint64, float32 -\u003e float32, float64 -\u003e float64,\n\n```go\nfunc CastSpecialIntToDecimal[T constraints.Integer](\n\tlv, rv *vector.Vector,\n\ti2d func(ctx context.Context, xs []T, rs []types.Decimal128, width, scale int32) ([]types.Decimal128, error),\n\tproc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastSpecialIntToDecimal64[T constraints.Integer](\n\tlv, rv *vector.Vector,\n\ti2d func(ctx context.Context, xs []T, rs []types.Decimal64, width, scale int32) ([]types.Decimal64, error),\n\tproc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastSpecials1Float[T constraints.Float](lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nCastSpecials1Float : Cast converts string to floating point number,Contains the following: (char / varhcar / text) -\u003e (float32 / float64)\n\n```go\nfunc CastSpecials1Int[T constraints.Signed](lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nCastSpecials1Int : Cast converts string to integer,Contains the following: (char / varhcar / text) -\u003e (int8 / int16 / int32/ int64 / uint8 / uint16 / uint32 / uint64)\n\n```go\nfunc CastSpecials1Uint[T constraints.Unsigned](lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastSpecials2Float[T constraints.Float](lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nCastSpecials2Float : Cast converts floating point number to string ,Contains the following: (float32/float64) -\u003e (char / varhcar)\n\n```go\nfunc CastSpecials2Int[T constraints.Signed](lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nCastSpecials2Int : Cast converts integer to string,Contains the following: (int8 /int16/int32/int64) -\u003e (char / varhcar / text)\n\n```go\nfunc CastSpecials2Uint[T constraints.Unsigned](lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastSpecials3(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nCastSpecials3 :  Cast converts string to string ,Contains the following: char -\u003e char char -\u003e varhcar char -\u003e blob varchar -\u003e char varchar -\u003e varhcar varchar -\u003e blob blob -\u003e char blob -\u003e varchar blob -\u003e blob we need to consider the visiblity of 0xXXXX, the rule is a little complex, please do that in the future the rule is, if src string len is larger than the dest string len, report an error for example: select cast('aaaaaaa' as char(1)); will report an error here. insert into col(varchar(1) values 'aaaaa', report an error for other cases, where col(varchar(1))='aaaaa', do not report error, just return empty result. maybe we can optimize this to false? sometimes, the dest len is 0, then do not report error here. maybe a bug and need to fix in the future?\n\n```go\nfunc CastSpecials4[T constraints.Signed](lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nCastSpecials4 : Cast converts signed integer to decimal128 ,Contains the following: (int8/int16/int32/int64) to decimal128\n\n```go\nfunc CastSpecials4_64[T constraints.Signed](lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastSpecialu4[T constraints.Unsigned](lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nCastSpecialu4 : Cast converts unsigned integer to decimal128 ,Contains the following: (uint8/uint16/uint32/uint64) to decimal128\n\n```go\nfunc CastStringAsDecimal128(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nXXX I felt I have written this ten times, what is going on? CastStringAsDecimal128 : onverts char/varchar as decimal128\n\n```go\nfunc CastStringAsDecimal64(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nCastStringAsDecimal64 : onverts char/varchar/text as decimal64\n\n```go\nfunc CastStringToBool(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastStringToJson(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastStringToUuid(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\\---------------------------------------------uuid cast---------------------------------------------------------------\n\n```go\nfunc CastTimeAsDate(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastTimeAsDatetime(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastTimeAsDecimal128(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastTimeAsDecimal64(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastTimeAsNumeric[T constraints.Integer](lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastTimeAsString(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastTimestampAsDate(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastUIntAsTime[T constraints.Unsigned](lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastUIntAsTimestamp[T constraints.Unsigned](lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastUint64ToInt64(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nCastUint64ToInt64 : cast uint64 to int64\n\n```go\nfunc CastUuidToString(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastVarcharAsDate(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nCastVarcharAsDate : Cast converts varchar to date type\n\n```go\nfunc CastVarcharAsDatetime(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nCastVarcharAsDatetime : Cast converts varchar to datetime type\n\n```go\nfunc CastVarcharAsTime(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CastVarcharAsTimestamp(lv, rv *vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nCastVarcharAsTimestamp : Cast converts varchar to timestamp type\n\n```go\nfunc CoalesceTypeCheckFn(inputTypes []types.T, _ []types.T, ret types.T) bool\n```\nCoalesceTypeCheckFn is type check function for coalesce operator\n\n```go\nfunc CompareBytesEq(v1, v2 []byte, s1, s2 int32) bool\n```\n\n```go\nfunc CompareBytesGe(v1, v2 []byte, s1, s2 int32) bool\n```\n\n```go\nfunc CompareBytesGt(v1, v2 []byte, s1, s2 int32) bool\n```\n\n```go\nfunc CompareBytesLe(v1, v2 []byte, s1, s2 int32) bool\n```\n\n```go\nfunc CompareBytesLt(v1, v2 []byte, s1, s2 int32) bool\n```\n\n```go\nfunc CompareBytesNe(v1, v2 []byte, s1, s2 int32) bool\n```\n\n```go\nfunc CompareOrdered(vs []*vector.Vector, proc *process.Process, cfn compareFn) (*vector.Vector, error)\n```\n\n```go\nfunc CompareString(vs []*vector.Vector, fn compStringFn, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CompareUuid(vs []*vector.Vector, fn compUuidFn, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CompareUuidEq(v1, v2 [16]byte) bool\n```\n\n```go\nfunc CompareUuidGe(v1, v2 [16]byte) bool\n```\n\n```go\nfunc CompareUuidGt(v1, v2 [16]byte) bool\n```\n\n```go\nfunc CompareUuidLe(v1, v2 [16]byte) bool\n```\n\n```go\nfunc CompareUuidLt(v1, v2 [16]byte) bool\n```\n\n```go\nfunc CompareUuidNe(v1, v2 [16]byte) bool\n```\n\n```go\nfunc CompareValenaInline(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc CwTypeCheckFn(inputTypes []types.T, _ []types.T, ret types.T) bool\n```\nCwTypeCheckFn is type check function for case-when operator\n\n```go\nfunc DivDecimal128(args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc DivDecimal64(args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc DivFloat[T constraints.Float](args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nDivision operation\n\n```go\nfunc EqDecimal128(args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc EqDecimal64(args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc EqGeneral[T compareT](args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nEqual compare operator\n\n```go\nfunc EqString(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc EqUuid(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc GeDecimal128(args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc GeDecimal64(args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc GeGeneral[T compareT](args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nGreat equal operator\n\n```go\nfunc GeString(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc GeUuid(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc GtDecimal128(args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc GtDecimal64(args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc GtGeneral[T compareT](args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nGreat than operator\n\n```go\nfunc GtString(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc GtUuid(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc HandleAndNullCol(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc HandleOrNullCol(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc ILike(vectors []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc INGeneral[T compareT](args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nIN operator\n\n```go\nfunc INString(args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc IfTypeCastSupported(sourceType, targetType types.T) bool\n```\n\n```go\nfunc IfTypeCheckFn(inputTypes []types.T, _ []types.T, ret types.T) bool\n```\n\n```go\nfunc IntegerDivFloat[T constraints.Float](args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nInteger division operation\n\n```go\nfunc Is(vectors []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc IsDecimal(t types.T) bool\n```\nIsDecimal: return true if the types.T is decimal64 or decimal128\n\n```go\nfunc IsFalse(vectors []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc IsFloat(t types.T) bool\n```\nIsFloat: return true if the types.T is floating Point Types\n\n```go\nfunc IsInteger(t types.T) bool\n```\n\\---------------------------------------------------------------------------------------------------------------------- IsInteger return true if the types.T is integer type\n\n```go\nfunc IsNot(vectors []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc IsNotFalse(vectors []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc IsNotNull(vectors []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc IsNotTrue(vectors []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc IsNull(vectors []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc IsNumeric(t types.T) bool\n```\nIsNumeric: return true if the types.T is numbric type\n\n```go\nfunc IsTrue(vectors []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc LeDecimal128(args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc LeDecimal64(args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc LeGeneral[T compareT](args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nless equal operator\n\n```go\nfunc LeString(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc LeUuid(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc Like(vectors []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc Logic(vectors []*vector.Vector, proc *process.Process, cfn logicFn, op logicType) (*vector.Vector, error)\n```\n\n```go\nfunc LogicAnd(args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc LogicNot(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc LogicOr(args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc LogicXor(args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc LtDecimal128(args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc LtDecimal64(args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc LtGeneral[T compareT](args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nless than operator\n\n```go\nfunc LtString(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc LtUuid(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc MinusDatetime(args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc MinusDecimal128(args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc MinusDecimal64(args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc MinusFloat[T constraints.Float](args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc MinusInt[T constraints.Signed](args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc MinusUint[T constraints.Unsigned](args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nSubtraction operation\n\n```go\nfunc ModFloat[T constraints.Float](args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc ModInt[T constraints.Signed](args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc ModUint[T constraints.Unsigned](args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nmod operation\n\n```go\nfunc MultDecimal128(args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc MultDecimal64(args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc MultFloat[T constraints.Float](args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc MultInt[T constraints.Signed](args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc MultUint[T constraints.Unsigned](args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nMultiplication operation\n\n```go\nfunc NeDecimal128(args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc NeDecimal64(args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc NeGeneral[T compareT](args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nNot Equal compare operator\n\n```go\nfunc NeString(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc NeUuid(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc NewCast(parameters []*vector.Vector, result vector.FunctionResultWrapper, proc *process.Process, length int) error\n```\n\n```go\nfunc Not(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc NotINGeneral[T compareT](args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nNOT IN operator\n\n```go\nfunc NotINString(args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc NotRegMatch(vectors []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc NotScalar(_, nsv *vector.Vector, col1, col2 []bool, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc OpBitAndFun[T opBitT](args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc OpBitLeftShiftFun[T opBitT](args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc OpBitOrFun[T opBitT](args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc OpBitRightShiftFun[T opBitT](args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc OpBitXorFun[T opBitT](args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc Or(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc PlusDecimal128(args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc PlusDecimal64(args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc PlusFloat[T constraints.Float](args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc PlusInt[T constraints.Signed](args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc PlusUint[T constraints.Unsigned](args []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nAddition operation\n\n```go\nfunc RegMatch(vectors []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc RegMatchWithALL(lv, rv []string, rs []bool, isReg bool) error\n```\n\n```go\nfunc RegMatchWithAllConst(lv, rv []string, rs []bool, isReg bool) error\n```\n\n```go\nfunc RegMatchWithLeftConst(lv, rv []string, rs []bool, isReg bool) error\n```\n\n```go\nfunc RegMatchWithRightConst(lv, rv []string, rs []bool, isReg bool) error\n```\n\n```go\nfunc ScalarAndNotScalar(_, nsv *vector.Vector, col1, col2 []bool, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc ScalarOrNotScalar(_, nsv *vector.Vector, col1, col2 []bool, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc ScalarXorNotScalar(_, nsv *vector.Vector, col1, col2 []bool, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc UnaryMinus[T constraints.Signed | constraints.Float](vectors []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc UnaryMinusDecimal128(vectors []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc UnaryMinusDecimal64(vectors []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc UnaryTilde[T constraints.Integer](vectors []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc Xor(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n## Types\n\n```go\ntype IfRet interface {\n\tconstraints.Integer | constraints.Float | bool | types.Date | types.Datetime |\n\t\ttypes.Decimal64 | types.Decimal128 | types.Timestamp\n}\n```\n\n```go\ntype NormalType interface {\n\tconstraints.Integer | constraints.Float | bool | types.Date | types.Datetime |\n\t\ttypes.Decimal64 | types.Decimal128 | types.Timestamp | types.Uuid\n}\n```\n\n```go\ntype OrderedValue interface {\n\tconstraints.Integer | constraints.Float | types.Date | types.Datetime | types.Decimal64 | types.Timestamp\n}\n```\n\n","path":"github.com/matrixorigin/matrixone/pkg/sql/plan/function/operator","name":"operator","synopsis":"","isRedistributable":true}
