package literal

import "github.com/substrait-io/substrait-go/v3/literal"

Index

Functions

func NewBool

func NewBool(value bool, nullable bool) expr.Literal

func NewDate

func NewDate(days int, nullable bool) (expr.Literal, error)

func NewDateFromString

func NewDateFromString(value string, nullable bool) (expr.Literal, error)

func NewDecimalFromApdDecimal

func NewDecimalFromApdDecimal(value *apd.Decimal, nullable bool) (expr.Literal, error)

func NewDecimalFromString

func NewDecimalFromString(value string, nullable bool) (expr.Literal, error)

NewDecimalFromString create a Decimal literal from decimal value string

func NewDecimalFromTwosComplement

func NewDecimalFromTwosComplement(twosComplement []byte, precision, scale int32, nullable bool) (expr.Literal, error)

NewDecimalFromTwosComplement create a Decimal literal from twosComplement. twosComplement is a little-endian twos-complement integer representation of complete value

func NewFixedBinary

func NewFixedBinary(value []byte, nullable bool) (expr.Literal, error)

func NewFixedChar

func NewFixedChar(value string, nullable bool) (expr.Literal, error)

func NewFloat32

func NewFloat32(value float32, nullable bool) expr.Literal

func NewFloat64

func NewFloat64(value float64, nullable bool) expr.Literal

func NewInt16

func NewInt16(value int16, nullable bool) expr.Literal

func NewInt32

func NewInt32(value int32, nullable bool) expr.Literal

func NewInt64

func NewInt64(value int64, nullable bool) expr.Literal

func NewInt8

func NewInt8(value int8, nullable bool) expr.Literal

func NewIntervalDaysToSecond

func NewIntervalDaysToSecond(days, seconds int32, micros int64, nullable bool) (expr.Literal, error)

func NewIntervalDaysToSecondFromString

func NewIntervalDaysToSecondFromString(daysToSecond string, nullable bool) (expr.Literal, error)

func NewIntervalYearsToMonth

func NewIntervalYearsToMonth(years, months int32, nullable bool) (expr.Literal, error)

func NewIntervalYearsToMonthFromString

func NewIntervalYearsToMonthFromString(yearsToMonth string, nullable bool) (expr.Literal, error)

func NewList

func NewList(elements []expr.Literal, nullable bool) (expr.Literal, error)

func NewPrecisionTimestamp

func NewPrecisionTimestamp(precision types.TimePrecision, value int64, nullable bool) (expr.Literal, error)

NewPrecisionTimestamp creates a new PrecisionTimestamp literal with given precision and value.

func NewPrecisionTimestampFromString

func NewPrecisionTimestampFromString(precision types.TimePrecision, value string, nullable bool) (expr.Literal, error)

func NewPrecisionTimestampFromTime

func NewPrecisionTimestampFromTime(precision types.TimePrecision, tm time.Time, nullable bool) (expr.Literal, error)

NewPrecisionTimestampFromTime creates a new PrecisionTimestamp literal from a time.Time timestamp value with given precision.

func NewPrecisionTimestampTz

func NewPrecisionTimestampTz(precision types.TimePrecision, value int64, nullable bool) (expr.Literal, error)

NewPrecisionTimestampTz creates a new PrecisionTimestampTz literal with given precision and value.

func NewPrecisionTimestampTzFromString

func NewPrecisionTimestampTzFromString(precision types.TimePrecision, value string, nullable bool) (expr.Literal, error)

func NewPrecisionTimestampTzFromTime

func NewPrecisionTimestampTzFromTime(precision types.TimePrecision, tm time.Time, nullable bool) (expr.Literal, error)

NewPrecisionTimestampTzFromTime creates a new PrecisionTimestampTz literal from a time.Time timestamp value with given precision.

func NewString

func NewString(value string, nullable bool) expr.Literal

func NewTime

func NewTime(hours, minutes, seconds, microseconds int32, nullable bool) (expr.Literal, error)

NewTime creates a new Time literal from the given hours, minutes, seconds and microseconds. The total microseconds should be in the range [0, 86400_000_000) to represent a valid time within a day.

func NewTimeFromMicros

func NewTimeFromMicros(micros int64, nullable bool) (expr.Literal, error)

NewTimeFromMicros creates a new Time literal from the given microseconds.

func NewTimeFromString

func NewTimeFromString(value string, nullable bool) (expr.Literal, error)

func NewTimestamp

func NewTimestamp(timestamp time.Time, nullable bool) (expr.Literal, error)

NewTimestamp creates a new Timestamp literal from a time.Time timestamp value. This uses the number of microseconds elapsed since January 1, 1970 00:00:00 UTC

func NewTimestampFromMicros

func NewTimestampFromMicros(micros int64, nullable bool) (expr.Literal, error)

func NewTimestampFromString

func NewTimestampFromString(value string, nullable bool) (expr.Literal, error)

func NewTimestampTZ

func NewTimestampTZ(timestamp time.Time, nullable bool) (expr.Literal, error)

NewTimestampTZ creates a new TimestampTz literal from a time.Time timestamp value. This uses the number of microseconds elapsed since January 1, 1970 00:00:00 UTC

func NewTimestampTZFromMicros

func NewTimestampTZFromMicros(micros int64, nullable bool) (expr.Literal, error)

func NewTimestampTZFromString

func NewTimestampTZFromString(value string, nullable bool) (expr.Literal, error)

func NewUUID

func NewUUID(guid uuid.UUID, nullable bool) (expr.Literal, error)

func NewUUIDFromBytes

func NewUUIDFromBytes(value []byte, nullable bool) (expr.Literal, error)

func NewVarChar

func NewVarChar(value string, nullable bool) (expr.Literal, error)

Source Files

utils.go

Version
v3.9.1 (latest)
Published
Apr 7, 2025
Platform
linux/amd64
Imports
10 packages
Last checked
9 hours ago

Tools for package owners.