{"modulePath":"github.com/matrixorigin/matrixone","version":"v0.7.0","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package binary\n\n## Constants\n\n```go\nconst (\n\t// MaxFsp is the maximum digit of fractional seconds part.\n\tMaxFsp = 6\n)\n```\n\n## Variables\n\n```go\nvar (\n\t// WeekdayNames lists names of weekdays, which are used in builtin function `date_format`.\n\tWeekdayNames = []string{\n\t\t\"Monday\",\n\t\t\"Tuesday\",\n\t\t\"Wednesday\",\n\t\t\"Thursday\",\n\t\t\"Friday\",\n\t\t\"Saturday\",\n\t\t\"Sunday\",\n\t}\n\n\t// MonthNames lists names of months, which are used in builtin function `date_format`.\n\tMonthNames = []string{\n\t\t\"January\",\n\t\t\"February\",\n\t\t\"March\",\n\t\t\"April\",\n\t\t\"May\",\n\t\t\"June\",\n\t\t\"July\",\n\t\t\"August\",\n\t\t\"September\",\n\t\t\"October\",\n\t\t\"November\",\n\t\t\"December\",\n\t}\n\n\t// AbbrevWeekdayName lists Abbreviation of week names, which are used int builtin function 'date_format'\n\tAbbrevWeekdayName = []string{\n\t\t\"Sun\",\n\t\t\"Mon\",\n\t\t\"Tue\",\n\t\t\"Wed\",\n\t\t\"Thu\",\n\t\t\"Fri\",\n\t\t\"Sat\",\n\t}\n)\n```\n\n```go\nvar (\n\tInt16ToInt8   = NumericToNumeric[int16, int8]\n\tInt32ToInt8   = NumericToNumeric[int32, int8]\n\tInt64ToInt8   = NumericToNumeric[int64, int8]\n\tUint8ToInt8   = NumericToNumeric[uint8, int8]\n\tUint16ToInt8  = NumericToNumeric[uint16, int8]\n\tUint32ToInt8  = NumericToNumeric[uint32, int8]\n\tUint64ToInt8  = NumericToNumeric[uint64, int8]\n\tFloat32ToInt8 = FloatToIntWithoutError[float32, int8]\n\tFloat64ToInt8 = FloatToIntWithoutError[float64, int8]\n\n\tInt8ToInt16    = NumericToNumeric[int8, int16]\n\tInt32ToInt16   = NumericToNumeric[int32, int16]\n\tInt64ToInt16   = NumericToNumeric[int64, int16]\n\tUint8ToInt16   = NumericToNumeric[uint8, int16]\n\tUint16ToInt16  = NumericToNumeric[uint16, int16]\n\tUint32ToInt16  = NumericToNumeric[uint32, int16]\n\tUint64ToInt16  = NumericToNumeric[uint64, int16]\n\tFloat32ToInt16 = FloatToIntWithoutError[float32, int16]\n\tFloat64ToInt16 = FloatToIntWithoutError[float64, int16]\n\n\tInt8ToInt32    = NumericToNumeric[int8, int32]\n\tInt16ToInt32   = NumericToNumeric[int16, int32]\n\tInt64ToInt32   = NumericToNumeric[int64, int32]\n\tUint8ToInt32   = NumericToNumeric[uint8, int32]\n\tUint16ToInt32  = NumericToNumeric[uint16, int32]\n\tUint32ToInt32  = NumericToNumeric[uint32, int32]\n\tUint64ToInt32  = NumericToNumeric[uint64, int32]\n\tFloat32ToInt32 = NumericToNumeric[float32, int32]\n\tFloat64ToInt32 = NumericToNumeric[float64, int32]\n\n\tInt8ToInt64    = NumericToNumeric[int8, int64]\n\tInt16ToInt64   = NumericToNumeric[int16, int64]\n\tInt32ToInt64   = NumericToNumeric[int32, int64]\n\tUint8ToInt64   = NumericToNumeric[uint8, int64]\n\tUint16ToInt64  = NumericToNumeric[uint16, int64]\n\tUint32ToInt64  = NumericToNumeric[uint32, int64]\n\tUint64ToInt64  = uint64ToInt64 // we handle overflow error in this function\n\tFloat32ToInt64 = FloatToIntWithoutError[float32, int64]\n\tFloat64ToInt64 = float64ToInt64\n\n\tInt8ToUint8    = NumericToNumeric[int8, uint8]\n\tInt16ToUint8   = NumericToNumeric[int16, uint8]\n\tInt32ToUint8   = NumericToNumeric[int32, uint8]\n\tInt64ToUint8   = NumericToNumeric[int64, uint8]\n\tUint16ToUint8  = NumericToNumeric[uint16, uint8]\n\tUint32ToUint8  = NumericToNumeric[uint32, uint8]\n\tUint64ToUint8  = NumericToNumeric[uint64, uint8]\n\tFloat32ToUint8 = FloatToIntWithoutError[float32, uint8]\n\tFloat64ToUint8 = FloatToIntWithoutError[float64, uint8]\n\n\tInt8ToUint16    = NumericToNumeric[int8, uint16]\n\tInt16ToUint16   = NumericToNumeric[int16, uint16]\n\tInt32ToUint16   = NumericToNumeric[int32, uint16]\n\tInt64ToUint16   = NumericToNumeric[int64, uint16]\n\tUint8ToUint16   = NumericToNumeric[uint8, uint16]\n\tUint32ToUint16  = NumericToNumeric[uint32, uint16]\n\tUint64ToUint16  = NumericToNumeric[uint64, uint16]\n\tFloat32ToUint16 = NumericToNumeric[float32, uint16]\n\tFloat64ToUint16 = NumericToNumeric[float64, uint16]\n\n\tInt8ToUint32    = NumericToNumeric[int8, uint32]\n\tInt16ToUint32   = NumericToNumeric[int16, uint32]\n\tInt32ToUint32   = NumericToNumeric[int32, uint32]\n\tInt64ToUint32   = NumericToNumeric[int64, uint32]\n\tUint8ToUint32   = NumericToNumeric[uint8, uint32]\n\tUint16ToUint32  = NumericToNumeric[uint16, uint32]\n\tUint64ToUint32  = NumericToNumeric[uint64, uint32]\n\tFloat32ToUint32 = FloatToIntWithoutError[float32, uint32]\n\tFloat64ToUint32 = FloatToIntWithoutError[float64, uint32]\n\n\tInt8ToUint64    = NumericToNumeric[int8, uint64]\n\tInt16ToUint64   = NumericToNumeric[int16, uint64]\n\tInt32ToUint64   = NumericToNumeric[int32, uint64]\n\tInt64ToUint64   = int64ToUint64\n\tUint8ToUint64   = NumericToNumeric[uint8, uint64]\n\tUint16ToUint64  = NumericToNumeric[uint16, uint64]\n\tUint32ToUint64  = NumericToNumeric[uint32, uint64]\n\tFloat32ToUint64 = FloatToIntWithoutError[float32, uint64]\n\tFloat64ToUint64 = FloatToIntWithoutError[float64, uint64]\n\n\tInt8ToFloat32    = NumericToNumeric[int8, float32]\n\tInt16ToFloat32   = NumericToNumeric[int16, float32]\n\tInt32ToFloat32   = NumericToNumeric[int32, float32]\n\tInt64ToFloat32   = NumericToNumeric[int64, float32]\n\tUint8ToFloat32   = NumericToNumeric[uint8, float32]\n\tUint16ToFloat32  = NumericToNumeric[uint16, float32]\n\tUint32ToFloat32  = NumericToNumeric[uint32, float32]\n\tUint64ToFloat32  = NumericToNumeric[uint64, float32]\n\tFloat64ToFloat32 = NumericToNumeric[float64, float32]\n\n\tInt8ToFloat64    = NumericToNumeric[int8, float64]\n\tInt16ToFloat64   = NumericToNumeric[int16, float64]\n\tInt32ToFloat64   = NumericToNumeric[int32, float64]\n\tInt64ToFloat64   = NumericToNumeric[int64, float64]\n\tUint8ToFloat64   = NumericToNumeric[uint8, float64]\n\tUint16ToFloat64  = NumericToNumeric[uint16, float64]\n\tUint32ToFloat64  = NumericToNumeric[uint32, float64]\n\tUint64ToFloat64  = NumericToNumeric[uint64, float64]\n\tFloat32ToFloat64 = NumericToNumeric[float32, float64]\n\n\tBytesToInt8    = BytesToInt[int8]\n\tInt8ToBytes    = IntToBytes[int8]\n\tBytesToInt16   = BytesToInt[int16]\n\tInt16ToBytes   = IntToBytes[int16]\n\tBytesToInt32   = BytesToInt[int32]\n\tInt32ToBytes   = IntToBytes[int32]\n\tBytesToInt64   = BytesToInt[int64]\n\tInt64ToBytes   = IntToBytes[int64]\n\tBytesToUint8   = BytesToUint[uint8]\n\tUint8ToBytes   = UintToBytes[uint8]\n\tBytesToUint16  = BytesToUint[uint16]\n\tUint16ToBytes  = UintToBytes[uint16]\n\tBytesToUint32  = BytesToUint[uint32]\n\tUint32ToBytes  = UintToBytes[uint32]\n\tBytesToUint64  = BytesToUint[uint64]\n\tUint64ToBytes  = UintToBytes[uint64]\n\tBytesToFloat32 = BytesToFloat[float32]\n\tFloat32ToBytes = FloatToBytes[float32]\n\tBytesToFloat64 = BytesToFloat[float64]\n\tFloat64ToBytes = FloatToBytes[float64]\n\n\tDecimal64ToDecimal128 = decimal64ToDecimal128Pure\n\n\tInt8ToDecimal128   = IntToDecimal128[int8]\n\tInt16ToDecimal128  = IntToDecimal128[int16]\n\tInt32ToDecimal128  = IntToDecimal128[int32]\n\tInt64ToDecimal128  = IntToDecimal128[int64]\n\tUint8ToDecimal128  = UintToDecimal128[uint8]\n\tUint16ToDecimal128 = UintToDecimal128[uint16]\n\tUint32ToDecimal128 = UintToDecimal128[uint32]\n\tUint64ToDecimal128 = UintToDecimal128[uint64]\n\n\tTimestampToDatetime = timestampToDatetime\n\tTimestampToVarchar  = timestampToVarchar\n\tBoolToBytes         = boolToBytes\n\tDateToBytes         = dateToBytes\n\tDateToDatetime      = dateToDateTime\n\tDateToTime          = dateToTime\n\tDatetimeToBytes     = datetimeToBytes\n\tDatetimeToTime      = datetimeToTime\n\tTimeToBytes         = timeToBytes\n\tTimeToDate          = timeToDate\n\tTimeToDatetime      = timeToDatetime\n\tDatetimeToDate      = datetimeToDate\n\tUuidToBytes         = uuidToBytes\n)\n```\n\n## Functions\n\n```go\nfunc AbbrDayOfMonth(day int) string\n```\nAbbrDayOfMonth: Get the abbreviation of month of day\n\n```go\nfunc BinaryByteToDecimal128(ctx context.Context, xs []string, rs []types.Decimal128) ([]types.Decimal128, error)\n```\n\n```go\nfunc BoolToNumeric[T constraints.Integer | constraints.Float](xs []bool, rs []T) ([]T, error)\n```\n\n```go\nfunc BytesToFloat[T constraints.Float](ctx context.Context, xs []string, rs []T, isBin bool, isEmptyStringOrNull ...[]int) ([]T, error)\n```\n\n```go\nfunc BytesToInt[T constraints.Signed](ctx context.Context, xs []string, rs []T, isBin ...bool) ([]T, error)\n```\n\n```go\nfunc BytesToUint[T constraints.Unsigned](ctx context.Context, xs []string, rs []T, isBin ...bool) ([]T, error)\n```\n\n```go\nfunc CalcDateFromat(ctx context.Context, datetimes []types.Datetime, format string, ns *nulls.Nulls) ([]string, error)\n```\nCalcDateFromat: DateFromat is used to formating the datetime values according to the format string.\n\n```go\nfunc CalcStrToDate(ctx context.Context, timestrs []string, format string, ns *nulls.Nulls, rNsp *nulls.Nulls) ([]types.Date, error)\n```\n\n```go\nfunc CalcStrToDatetime(ctx context.Context, timestrs []string, format string, ns *nulls.Nulls, rNsp *nulls.Nulls) ([]types.Datetime, error)\n```\n\n```go\nfunc CalcStrToTime(ctx context.Context, timestrs []string, format string, ns *nulls.Nulls, rNsp *nulls.Nulls) ([]types.Time, error)\n```\n\n```go\nfunc CoreStrToDate(cctx context.Context, t *GeneralTime, date string, format string) bool\n```\n\n```go\nfunc DateDiff(vectors []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc DateFSP(date string) (fsp int)\n```\nDateFSP gets fsp from date string.\n\n```go\nfunc DateFormat(vectors []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nDateFromat: Formats the date value according to the format string. If either argument is NULL, the function returns NULL.\n\n```go\nfunc Decimal128ToBytes(xs []types.Decimal128, rs []string, scale int32) ([]string, error)\n```\n\n```go\nfunc Decimal128ToDecimal128(ctx context.Context, xs []types.Decimal128, width, scale int32, rs []types.Decimal128) ([]types.Decimal128, error)\n```\n\n```go\nfunc Decimal128ToDecimal64(ctx context.Context, xs []types.Decimal128, width, scale int32, rs []types.Decimal64) ([]types.Decimal64, error)\n```\nthe scale of decimal128 is guaranteed to be less than 18 this cast function is too slow, and therefore only temporary, rewrite needed\n\n```go\nfunc Decimal128ToFloat32(ctx context.Context, xs []types.Decimal128, scale int32, rs []float32) ([]float32, error)\n```\n\n```go\nfunc Decimal128ToFloat64(ctx context.Context, xs []types.Decimal128, scale int32, rs []float64) ([]float64, error)\n```\n\n```go\nfunc Decimal128ToInt32(ctx context.Context, xs []types.Decimal128, scale int32, rs []int32) ([]int32, error)\n```\n\n```go\nfunc Decimal128ToInt64(ctx context.Context, xs []types.Decimal128, scale int32, rs []int64) ([]int64, error)\n```\n\n```go\nfunc Decimal128ToTime(ctx context.Context, xs []types.Decimal128, rs []types.Time, precision int32) ([]types.Time, error)\n```\n\n```go\nfunc Decimal128ToTimestamp(xs []types.Decimal128, precision int32, scale int32, rs []types.Timestamp) ([]types.Timestamp, error)\n```\n\n```go\nfunc Decimal128ToUint64(ctx context.Context, xs []types.Decimal128, scale int32, rs []uint64) ([]uint64, error)\n```\n\n```go\nfunc Decimal64ToBytes(xs []types.Decimal64, rs []string, scale int32) ([]string, error)\n```\n\n```go\nfunc Decimal64ToFloat32(ctx context.Context, xs []types.Decimal64, scale int32, rs []float32) ([]float32, error)\n```\n\n```go\nfunc Decimal64ToFloat64(ctx context.Context, xs []types.Decimal64, scale int32, rs []float64) ([]float64, error)\n```\n\n```go\nfunc Decimal64ToInt64(ctx context.Context, xs []types.Decimal64, scale int32, rs []int64) ([]int64, error)\n```\n\n```go\nfunc Decimal64ToTime(ctx context.Context, xs []types.Decimal64, rs []types.Time, precision int32) ([]types.Time, error)\n```\n\n```go\nfunc Decimal64ToTimestamp(xs []types.Decimal64, precision int32, scale int32, rs []types.Timestamp) ([]types.Timestamp, error)\n```\n\n```go\nfunc Decimal64ToUint64(ctx context.Context, xs []types.Decimal64, scale int32, rs []uint64) ([]uint64, error)\n```\n\n```go\nfunc Endswith(vectors []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc ExtractFromDate(vectors []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc ExtractFromDatetime(vectors []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc FindInSet(vectors []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc FloatToBytes[T constraints.Float](xs []T, rs []string) ([]string, error)\n```\n\n```go\nfunc FloatToIntWithoutError[T1 constraints.Float, T2 constraints.Integer](ctx context.Context, xs []T1, rs []T2) ([]T2, error)\n```\n\n```go\nfunc FormatIntByWidth(num, n int) string\n```\nFormatIntByWidth: Formatintwidthn is used to format ints with width parameter n. Insufficient numbers are filled with 0.\n\n```go\nfunc GetTimeFormatType(format string) (isTime, isDate bool)\n```\nGetTimeFormatType checks the type(Time, Date or Datetime) of a format string.\n\n```go\nfunc Instr(vecs []*vector.Vector, proc *process.Process) (ret *vector.Vector, err error)\n```\n\n```go\nfunc IntToBytes[T constraints.Integer](xs []T, rs []string, ZeroAndBin ...int64) ([]string, error)\n```\nXXX Potentially we can do much better with types.Varlena\n\n```go\nfunc IntToDecimal128[T constraints.Integer](ctx context.Context, xs []T, rs []types.Decimal128, width, scale int32) ([]types.Decimal128, error)\n```\n\n```go\nfunc IntToDecimal64[T constraints.Integer](ctx context.Context, xs []T, rs []types.Decimal64, width, scale int32) ([]types.Decimal64, error)\n```\n\n```go\nfunc JudgmentToDateReturnType(format string) (tp types.T, fsp int)\n```\nJudge the return value type of the str\\_to\\_date function according to the value of the fromat parameter\n\n```go\nfunc Left(vs []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc NumericToBool[T constraints.Integer | constraints.Float](xs []T, rs []bool) ([]bool, error)\n```\n\n```go\nfunc NumericToNumeric[T1, T2 constraints.Integer | constraints.Float](ctx context.Context, xs []T1, rs []T2) ([]T2, error)\n```\n\n```go\nfunc NumericToNumericOverflow[T1, T2 constraints.Integer | constraints.Float](ctx context.Context, xs []T1, rs []T2) error\n```\n\n```go\nfunc NumericToTime[T constraints.Integer](ctx context.Context, xs []T, rs []types.Time, precision int32) ([]types.Time, error)\n```\n\n```go\nfunc NumericToTimestamp[T constraints.Integer](xs []T, rs []types.Timestamp) ([]types.Timestamp, error)\n```\n\n```go\nfunc Power(vectors []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc ShowVisibleBin(vec []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc Startswith(vectors []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc StrToDate(vectors []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nConvert the string to date type value according to the format string\n\n```go\nfunc StrToDateTime(vectors []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\nConvert the string to datetime type value according to the format string\n\n```go\nfunc StrToTime(vectors []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n// Convert the string to time type value according to the format string,such as '09:30:17'\n\n```go\nfunc TimeDiff[T timediff.DiffT](vectors []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc TimeToDecimal128(ctx context.Context, xs []types.Time, rs []types.Decimal128, width, precision int32) ([]types.Decimal128, error)\n```\n\n```go\nfunc TimeToDecimal64(ctx context.Context, xs []types.Time, rs []types.Decimal64, width, precision int32) ([]types.Decimal64, error)\n```\n\n```go\nfunc TimeToNumeric[T constraints.Integer](ctx context.Context, xs []types.Time, rs []T) ([]T, error)\n```\n\n```go\nfunc ToDate(vectors []*vector.Vector, proc *process.Process) (*vector.Vector, error)\n```\n\n```go\nfunc ToDateInputBytes(ctx context.Context, inputs []string, format string, inputNsp *nulls.Nulls, result []string) ([]string, *nulls.Nulls, error)\n```\n\n```go\nfunc UintToBytes[T constraints.Integer](xs []T, rs []string) ([]string, error)\n```\nXXX Potentially we can do much better with types.Varlena\n\n```go\nfunc UintToDecimal128[T constraints.Integer](ctx context.Context, xs []T, rs []types.Decimal128, width, scale int32) ([]types.Decimal128, error)\n```\n\n## Types\n\n```go\ntype GeneralTime struct {\n\t// contains filtered or unexported fields\n}\n```\nGeneralTime is the internal struct type for Time.\n\n```go\nfunc FromDate(year int, month int, day int, hour int, minute int, second int, microsecond int) GeneralTime\n```\n\n```go\nfunc NewGeneralTime() *GeneralTime\n```\n\n```go\nfunc (t GeneralTime) Minute() int\n```\nMinute returns the minute value.\n\n```go\nfunc (t GeneralTime) ResetTime()\n```\nReset GeneralTime to initialization state\n\n```go\nfunc (t GeneralTime) String() string\n```\nString implements fmt.Stringer.\n\n```go\ntype Month int\n```\nThe month represents one month of the year (January=1,...).\n\n```go\nconst (\n\tJanuary Month = 1 + iota\n\tFebruary\n\tMarch\n\tApril\n\tMay\n\tJune\n\tJuly\n\tAugust\n\tSeptember\n\tOctober\n\tNovember\n\tDecember\n)\n```\n\n","path":"github.com/matrixorigin/matrixone/pkg/sql/plan/function/builtin/binary","name":"binary","synopsis":"","isRedistributable":true}
