expr

package
v1.2.142 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateEmptyList added in v1.2.139

func CreateEmptyList(dataType arrow.DataType, allocator memory.Allocator) (*arrowv1.ScalarListValue, error)

CreateEmptyList creates an empty list with the specified arrow type

func ProtoToArrowDataType added in v1.2.139

func ProtoToArrowDataType(protoType *arrowv1.ArrowType) (arrow.DataType, error)

ProtoToArrowDataType converts a protobuf ArrowType to an Arrow DataType

func ToIdentifierLiteral added in v1.2.95

func ToIdentifierLiteral(name string) *expressionv1.LogicalExprNode

func ToProto

func ToProto(expr ExprI) (*expressionv1.LogicalExprNode, error)

ToProto converts an ExprI to a LogicalExprNode proto message

Types

type AggregateExprImpl added in v1.2.106

type AggregateExprImpl struct {
	Expr
	Function   string
	Arguments  []Expr
	DataFrame  DataFrameExpr
	Conditions []Expr // Accumulated filter conditions
	Distinct   bool
	Selection  Expr
}

AggregateExprImpl represents an aggregation expression that returns a scalar

func (*AggregateExprImpl) Add added in v1.2.106

func (e *AggregateExprImpl) Add(other Expr) Expr

Implement Expr interface for AggregateExprImpl

func (*AggregateExprImpl) And added in v1.2.106

func (e *AggregateExprImpl) And(other Expr) Expr

func (*AggregateExprImpl) Apply added in v1.2.106

func (e *AggregateExprImpl) Apply(args ...Expr) Expr

func (*AggregateExprImpl) As added in v1.2.106

func (e *AggregateExprImpl) As(alias string) Expr

func (*AggregateExprImpl) Attr added in v1.2.106

func (e *AggregateExprImpl) Attr(attribute string) Expr

func (*AggregateExprImpl) Div added in v1.2.106

func (e *AggregateExprImpl) Div(other Expr) Expr

func (*AggregateExprImpl) Eq added in v1.2.106

func (e *AggregateExprImpl) Eq(other Expr) Expr

func (*AggregateExprImpl) Ge added in v1.2.106

func (e *AggregateExprImpl) Ge(other Expr) Expr

func (*AggregateExprImpl) Gt added in v1.2.106

func (e *AggregateExprImpl) Gt(other Expr) Expr

func (*AggregateExprImpl) IsNotNull added in v1.2.106

func (e *AggregateExprImpl) IsNotNull() Expr

func (*AggregateExprImpl) IsNull added in v1.2.106

func (e *AggregateExprImpl) IsNull() Expr

func (*AggregateExprImpl) Le added in v1.2.106

func (e *AggregateExprImpl) Le(other Expr) Expr

func (*AggregateExprImpl) Lt added in v1.2.106

func (e *AggregateExprImpl) Lt(other Expr) Expr

func (*AggregateExprImpl) Mul added in v1.2.106

func (e *AggregateExprImpl) Mul(other Expr) Expr

func (*AggregateExprImpl) Ne added in v1.2.106

func (e *AggregateExprImpl) Ne(other Expr) Expr

func (*AggregateExprImpl) Not added in v1.2.106

func (e *AggregateExprImpl) Not() Expr

func (*AggregateExprImpl) Or added in v1.2.106

func (e *AggregateExprImpl) Or(other Expr) Expr

func (*AggregateExprImpl) String added in v1.2.106

func (e *AggregateExprImpl) String() string

func (*AggregateExprImpl) Sub added in v1.2.106

func (e *AggregateExprImpl) Sub(other Expr) Expr

func (*AggregateExprImpl) WithDistinct added in v1.2.106

func (e *AggregateExprImpl) WithDistinct() *AggregateExprImpl

WithDistinct adds DISTINCT to the aggregation

type AliasExpr

type AliasExpr struct {
	Expression Expr
	Alias      string
}

AliasExpr represents an aliased expression

func (*AliasExpr) Add

func (e *AliasExpr) Add(other Expr) Expr

Implement Expr interface for AliasExpr

func (*AliasExpr) And

func (e *AliasExpr) And(other Expr) Expr

func (*AliasExpr) Apply added in v1.2.95

func (e *AliasExpr) Apply(args ...Expr) Expr

func (*AliasExpr) As

func (e *AliasExpr) As(alias string) Expr

func (*AliasExpr) Attr

func (e *AliasExpr) Attr(attribute string) Expr

func (*AliasExpr) Div

func (e *AliasExpr) Div(other Expr) Expr

func (*AliasExpr) Eq

func (e *AliasExpr) Eq(other Expr) Expr

func (*AliasExpr) Ge

func (e *AliasExpr) Ge(other Expr) Expr

func (*AliasExpr) Gt

func (e *AliasExpr) Gt(other Expr) Expr

func (*AliasExpr) IsNotNull

func (e *AliasExpr) IsNotNull() Expr

func (*AliasExpr) IsNull

func (e *AliasExpr) IsNull() Expr

func (*AliasExpr) Le

func (e *AliasExpr) Le(other Expr) Expr

func (*AliasExpr) Lt

func (e *AliasExpr) Lt(other Expr) Expr

func (*AliasExpr) Mul

func (e *AliasExpr) Mul(other Expr) Expr

func (*AliasExpr) Ne

func (e *AliasExpr) Ne(other Expr) Expr

func (*AliasExpr) Not

func (e *AliasExpr) Not() Expr

func (*AliasExpr) Or

func (e *AliasExpr) Or(other Expr) Expr

func (*AliasExpr) String

func (e *AliasExpr) String() string

func (*AliasExpr) Sub

func (e *AliasExpr) Sub(other Expr) Expr

type CallExpr

type CallExpr struct {
	Expr
	Function Expr
	Args     []Expr
	Kwargs   map[string]Expr
}

CallExpr represents function calls and method calls

func (*CallExpr) Add

func (e *CallExpr) Add(other Expr) Expr

Implement Expr interface for CallExpr

func (*CallExpr) And

func (e *CallExpr) And(other Expr) Expr

func (*CallExpr) Apply added in v1.2.95

func (e *CallExpr) Apply(args ...Expr) Expr

func (*CallExpr) As

func (e *CallExpr) As(alias string) Expr

func (*CallExpr) Attr

func (e *CallExpr) Attr(attribute string) Expr

func (*CallExpr) Div

func (e *CallExpr) Div(other Expr) Expr

func (*CallExpr) Eq

func (e *CallExpr) Eq(other Expr) Expr

func (*CallExpr) Ge

func (e *CallExpr) Ge(other Expr) Expr

func (*CallExpr) Gt

func (e *CallExpr) Gt(other Expr) Expr

func (*CallExpr) IsNotNull

func (e *CallExpr) IsNotNull() Expr

func (*CallExpr) IsNull

func (e *CallExpr) IsNull() Expr

func (*CallExpr) Le

func (e *CallExpr) Le(other Expr) Expr

func (*CallExpr) Lt

func (e *CallExpr) Lt(other Expr) Expr

func (*CallExpr) Mul

func (e *CallExpr) Mul(other Expr) Expr

func (*CallExpr) Ne

func (e *CallExpr) Ne(other Expr) Expr

func (*CallExpr) Not

func (e *CallExpr) Not() Expr

func (*CallExpr) Or

func (e *CallExpr) Or(other Expr) Expr

func (*CallExpr) String

func (e *CallExpr) String() string

func (*CallExpr) Sub

func (e *CallExpr) Sub(other Expr) Expr

type ColumnExpr

type ColumnExpr struct {
	Expr
	Name     string
	Relation string
}

ColumnExpr represents a column reference

func (*ColumnExpr) Add

func (e *ColumnExpr) Add(other Expr) Expr

Implement Expr interface for ColumnExpr

func (*ColumnExpr) And

func (e *ColumnExpr) And(other Expr) Expr

func (*ColumnExpr) Apply added in v1.2.95

func (e *ColumnExpr) Apply(args ...Expr) Expr

func (*ColumnExpr) As

func (e *ColumnExpr) As(alias string) Expr

func (*ColumnExpr) Attr

func (e *ColumnExpr) Attr(attribute string) Expr

func (*ColumnExpr) Div

func (e *ColumnExpr) Div(other Expr) Expr

func (*ColumnExpr) Eq

func (e *ColumnExpr) Eq(other Expr) Expr

func (*ColumnExpr) Ge

func (e *ColumnExpr) Ge(other Expr) Expr

func (*ColumnExpr) Gt

func (e *ColumnExpr) Gt(other Expr) Expr

func (*ColumnExpr) IsNotNull

func (e *ColumnExpr) IsNotNull() Expr

func (*ColumnExpr) IsNull

func (e *ColumnExpr) IsNull() Expr

func (*ColumnExpr) Le

func (e *ColumnExpr) Le(other Expr) Expr

func (*ColumnExpr) Lt

func (e *ColumnExpr) Lt(other Expr) Expr

func (*ColumnExpr) Mul

func (e *ColumnExpr) Mul(other Expr) Expr

func (*ColumnExpr) Ne

func (e *ColumnExpr) Ne(other Expr) Expr

func (*ColumnExpr) Not

func (e *ColumnExpr) Not() Expr

func (*ColumnExpr) Or

func (e *ColumnExpr) Or(other Expr) Expr

func (*ColumnExpr) String

func (e *ColumnExpr) String() string

func (*ColumnExpr) Sub

func (e *ColumnExpr) Sub(other Expr) Expr

func (*ColumnExpr) WithRelation

func (e *ColumnExpr) WithRelation(relation string) *ColumnExpr

WithRelation adds a relation qualifier to the column

type DataFrameExpr

type DataFrameExpr interface {
	ExprI

	Filter(condition ExprI) DataFrameExpr
	Select(selection Expr) DataFrameExpr
	Agg(aggFunc string, args ...Expr) Expr
}

DataFrameExpr represents expressions that operate on DataFrames

func DataFrame

func DataFrame(name string) DataFrameExpr

DataFrame creates a dataframe reference for aggregations

type DataFrameExprImpl added in v1.2.106

type DataFrameExprImpl struct {
	Expr
	Name       string
	Conditions []Expr // Store accumulated filter conditions
	Selection  Expr   // Store expression to be aggregated
}

DataFrameExprImpl represents a dataframe for aggregation operations

func (*DataFrameExprImpl) Add added in v1.2.106

func (e *DataFrameExprImpl) Add(other Expr) Expr

Implement Expr interface for DataFrameExprImpl

func (*DataFrameExprImpl) Agg added in v1.2.106

func (e *DataFrameExprImpl) Agg(aggFunc string, args ...Expr) Expr

func (*DataFrameExprImpl) And added in v1.2.106

func (e *DataFrameExprImpl) And(other Expr) Expr

func (*DataFrameExprImpl) Apply added in v1.2.106

func (e *DataFrameExprImpl) Apply(args ...Expr) Expr

func (*DataFrameExprImpl) As added in v1.2.106

func (e *DataFrameExprImpl) As(alias string) Expr

func (*DataFrameExprImpl) Attr added in v1.2.106

func (e *DataFrameExprImpl) Attr(attribute string) Expr

func (*DataFrameExprImpl) Div added in v1.2.106

func (e *DataFrameExprImpl) Div(other Expr) Expr

func (*DataFrameExprImpl) Eq added in v1.2.106

func (e *DataFrameExprImpl) Eq(other Expr) Expr

func (*DataFrameExprImpl) Filter added in v1.2.106

func (e *DataFrameExprImpl) Filter(condition ExprI) DataFrameExpr

Implement DataFrameExpr interface

func (*DataFrameExprImpl) Ge added in v1.2.106

func (e *DataFrameExprImpl) Ge(other Expr) Expr

func (*DataFrameExprImpl) Gt added in v1.2.106

func (e *DataFrameExprImpl) Gt(other Expr) Expr

func (*DataFrameExprImpl) IsNotNull added in v1.2.106

func (e *DataFrameExprImpl) IsNotNull() Expr

func (*DataFrameExprImpl) IsNull added in v1.2.106

func (e *DataFrameExprImpl) IsNull() Expr

func (*DataFrameExprImpl) Le added in v1.2.106

func (e *DataFrameExprImpl) Le(other Expr) Expr

func (*DataFrameExprImpl) Lt added in v1.2.106

func (e *DataFrameExprImpl) Lt(other Expr) Expr

func (*DataFrameExprImpl) Mul added in v1.2.106

func (e *DataFrameExprImpl) Mul(other Expr) Expr

func (*DataFrameExprImpl) Ne added in v1.2.106

func (e *DataFrameExprImpl) Ne(other Expr) Expr

func (*DataFrameExprImpl) Not added in v1.2.106

func (e *DataFrameExprImpl) Not() Expr

func (*DataFrameExprImpl) Or added in v1.2.106

func (e *DataFrameExprImpl) Or(other Expr) Expr

func (*DataFrameExprImpl) Select added in v1.2.106

func (e *DataFrameExprImpl) Select(selection Expr) DataFrameExpr

func (*DataFrameExprImpl) String added in v1.2.106

func (e *DataFrameExprImpl) String() string

func (*DataFrameExprImpl) Sub added in v1.2.106

func (e *DataFrameExprImpl) Sub(other Expr) Expr

type Expr

type Expr interface {
	ExprI

	// Arithmetic operations
	Add(other Expr) Expr
	Sub(other Expr) Expr
	Mul(other Expr) Expr
	Div(other Expr) Expr

	// Comparison operations
	Eq(other Expr) Expr
	Ne(other Expr) Expr
	Lt(other Expr) Expr
	Le(other Expr) Expr
	Gt(other Expr) Expr
	Ge(other Expr) Expr

	// Logical operations
	And(other Expr) Expr
	Or(other Expr) Expr
	Not() Expr

	// Null checking
	IsNull() Expr
	IsNotNull() Expr

	// Attribute access
	Attr(attribute string) Expr

	// Alias
	As(alias string) Expr

	// Function application
	Apply(args ...Expr) Expr
}

func Abs

func Abs(x Expr) Expr

Abs calculates absolute value

func And

func And(a, b Expr) Expr

And performs logical AND

func ArrayAverage

func ArrayAverage(array Expr) Expr

ArrayAverage calculates average of numeric array

func ArrayConstructor

func ArrayConstructor(elements ...Expr) Expr

ArrayConstructor creates array from elements

func ArrayDistinct

func ArrayDistinct(array Expr) Expr

ArrayDistinct returns unique elements from array

func ArrayFrequency

func ArrayFrequency(array Expr) Expr

ArrayFrequency returns frequency map of array elements

func ArrayJoin

func ArrayJoin(array, separator Expr) Expr

ArrayJoin joins array elements with separator

func ArrayMax

func ArrayMax(array Expr) Expr

ArrayMax returns maximum element from array

func ArrayMedian

func ArrayMedian(array Expr) Expr

ArrayMedian calculates median of numeric array

func ArrayMin

func ArrayMin(array Expr) Expr

ArrayMin returns minimum element from array

func ArrayMode

func ArrayMode(array Expr, mode ...Expr) Expr

ArrayMode calculates mode of array

func ArraySort

func ArraySort(array Expr) Expr

ArraySort sorts array in ascending order

func ArraySortDesc

func ArraySortDesc(array Expr) Expr

ArraySortDesc sorts array in descending order

func ArrayStddev

func ArrayStddev(array, isSample Expr) Expr

ArrayStddev calculates standard deviation of array

func ArraySum

func ArraySum(array Expr) Expr

ArraySum calculates sum of numeric array

func BankersRound

func BankersRound(x Expr, decimals ...Expr) Expr

BankersRound rounds using banker's rounding (round half to even)

func Binary

func Binary(value []byte) Expr

Binary creates a binary literal expression

func Bool

func Bool(value bool) Expr

Bool creates a boolean literal expression

func BoostRegexpFindall

func BoostRegexpFindall(str, pattern Expr) Expr

BoostRegexpFindall finds all matches of regular expression

func BytesToUtf8 added in v1.2.139

func BytesToUtf8(bytes Expr) Expr

BytesToUtf8 converts from binary data to UTF-8 string (same as chalkpy bytes_to_string(..., encoding='utf-8'))

func Cardinality

func Cardinality(array Expr) Expr

Cardinality returns length of array

func Cast added in v1.2.139

func Cast(expr Expr, to *arrowv1.ArrowType) Expr

Cast converts a value to a target type

func Ceiling

func Ceiling(x Expr) Expr

Ceiling rounds up to nearest integer

func ChalkNow added in v1.2.88

func ChalkNow() Expr

func ChalkWindow added in v1.2.109

func ChalkWindow() Expr

func Coalesce

func Coalesce(values ...Expr) Expr

Coalesce returns first non-null value

func Col

func Col(name string) Expr

Col creates a column reference expression

func ColIn added in v1.2.95

func ColIn(relation string, name string) Expr

maybe replace with a relation.name call to Col?

func Concat

func Concat(first Expr, rest ...Expr) Expr

Concat concatenates strings or arrays

func Contains

func Contains(array, element Expr) Expr

Contains checks if array contains element

func Cos

func Cos(x Expr) Expr

Cos calculates cosine

func CurrentDate

func CurrentDate() Expr

CurrentDate returns current date

func Date

func Date(value time.Time) Expr

Date creates a date literal expression using Date64 (days since epoch)

func Date32

func Date32(value int32) Expr

Date32 creates a date32 literal expression (days since epoch as int32)

func Date64

func Date64(value int64) Expr

Date64 creates a date64 literal expression (days since epoch)

func DateTrunc

func DateTrunc(unit, timestamp Expr) Expr

DateTrunc truncates timestamp to specified unit

func DayOfMonth

func DayOfMonth(dateTime Expr) Expr

DayOfMonth extracts day of month from timestamp or date

func DurationMicrosecond

func DurationMicrosecond(value int64) Expr

DurationMicrosecond creates a duration in microseconds

func DurationMillisecond

func DurationMillisecond(value int64) Expr

DurationMillisecond creates a duration in milliseconds

func DurationNanosecond

func DurationNanosecond(value int64) Expr

DurationNanosecond creates a duration in nanoseconds

func DurationSecond

func DurationSecond(value int64) Expr

DurationSecond creates a duration in seconds

func ElementAt

func ElementAt(array, index Expr) Expr

ElementAt returns element at index (1-indexed)

func EndsWith

func EndsWith(str, suffix Expr) Expr

EndsWith checks if string ends with suffix

func Eq

func Eq(a, b Expr) Expr

Eq performs equality comparison

func Fail

func Fail(message Expr) Expr

Fail throws an error with message

func Float

func Float(value float64) Expr

Float is an alias for Float64 for convenience

func Float16

func Float16(value float32) Expr

Float16 creates a float16 literal expression

func Float32

func Float32(value float32) Expr

Float32 creates a float32 literal expression

func Float64

func Float64(value float64) Expr

Float64 creates a float64 literal expression

func Floor

func Floor(x Expr) Expr

Floor rounds down to nearest integer

func FormatDatetime

func FormatDatetime(timestamp, format Expr) Expr

FormatDatetime formats timestamp as string

func FromBase

func FromBase(str, base Expr) Expr

FromBase converts string from specified base to integer

func FromBigEndian32

func FromBigEndian32(data Expr) Expr

FromBigEndian32 converts binary data to int32 using big-endian byte order

func FromBigEndian64

func FromBigEndian64(data Expr) Expr

FromBigEndian64 converts binary data to int64 using big-endian byte order

func FromIso8601Timestamp

func FromIso8601Timestamp(str Expr) Expr

FromIso8601Timestamp parses ISO8601 timestamp string

func FromUnixSeconds

func FromUnixSeconds(seconds Expr) Expr

FromUnixSeconds converts Unix timestamp to timestamp

func FromUtf8

func FromUtf8(data Expr) Expr

FromUtf8 converts to binary data from UTF-8 string

func FunctionCall

func FunctionCall(name string, args ...Expr) Expr

FunctionCall creates a function call expression

func FunctionCallWithKwargs

func FunctionCallWithKwargs(name string, args []Expr, kwargs map[string]Expr) Expr

FunctionCallWithKwargs creates a function call expression with keyword arguments

func GetJsonValue

func GetJsonValue(json Expr, path string) Expr

GetJsonValue extracts value from JSON

func Gt

func Gt(a, b Expr) Expr

Gt performs greater than comparison

func Gte

func Gte(a, b Expr) Expr

Gte performs greater than or equal comparison

func Hour

func Hour(timestamp Expr) Expr

Hour extracts hour from timestamp

func Identifier

func Identifier(name string) Expr

Identifier creates an identifier expression

func IfElse

func IfElse(condition, trueValue, falseValue Expr) Expr

IfElse conditional expression

func Int

func Int(value int64) Expr

Int is an alias for Int64 for convenience

func Int8

func Int8(value int8) Expr

Int8 creates an int8 literal expression

func Int16

func Int16(value int16) Expr

Int16 creates an int16 literal expression

func Int32

func Int32(value int32) Expr

Int32 creates an int32 literal expression

func Int64

func Int64(value int64) Expr

Int64 creates an int64 literal expression

func IsNan

func IsNan(x Expr) Expr

IsNan checks if value is NaN

func JaccardSimilarity

func JaccardSimilarity(left, right Expr) Expr

JaccardSimilarity calculates Jaccard similarity between two strings

func JaroWinklerDistance

func JaroWinklerDistance(left, right, threshold Expr) Expr

JaroWinklerDistance calculates Jaro-Winkler distance

func Jsonify added in v1.2.139

func Jsonify(json Expr) Expr

Jsonify turns a value into a JSON string

func LargeBinary

func LargeBinary(value []byte) Expr

LargeBinary creates a large binary literal expression

func LargeUtf8

func LargeUtf8(value string) Expr

LargeUtf8 creates a large UTF-8 string literal expression

func LastDayOfMonth

func LastDayOfMonth(timestamp Expr) Expr

LastDayOfMonth returns the last day of the month for given timestamp

func Length

func Length(str Expr) Expr

Length returns the length of a string

func Like

func Like(str, pattern Expr) Expr

Like performs SQL LIKE pattern matching

func List added in v1.2.139

func List(items ...Expr) Expr

List creates a list literal expression Arguments must all be literals and of the same type

func Log10

func Log10(x Expr) Expr

Log10 calculates base-10 logarithm

func Lower

func Lower(str Expr) Expr

Lower converts string to lowercase

func Lt

func Lt(a, b Expr) Expr

Lt performs less than comparison

func Lte

func Lte(a, b Expr) Expr

Lte performs less than or equal comparison

func Ltrim

func Ltrim(str Expr, chars ...Expr) Expr

Ltrim removes whitespace from left end of string

func MapContains

func MapContains(mapExpr, predicate Expr) Expr

MapContains checks if map contains key matching predicate

func MapGet

func MapGet(mapExpr, key Expr) Expr

MapGet gets value from map by key

func MapKeysByTopNValues

func MapKeysByTopNValues(mapExpr, n Expr) Expr

MapKeysbyTopNValues returns keys with top N values from map

func Md5

func Md5(data Expr) Expr

Md5 calculates MD5 hash

func Minute

func Minute(timestamp Expr) Expr

Minute extracts minute from timestamp

func Mod

func Mod(a, b Expr) Expr

Mod calculates modulo

func Month

func Month(dateTime Expr) Expr

Month extracts month from timestamp or date

func Nan

func Nan() Expr

Nan returns NaN value

func Negate

func Negate(x Expr) Expr

Negate negates a number

func Neq

func Neq(a, b Expr) Expr

Neq performs inequality comparison

func Now

func Now() Expr

Now returns current timestamp (convenience function)

func Null

func Null() Expr

Null creates a null literal expression

func ParseDatetime

func ParseDatetime(dateStr, format Expr) Expr

ParseDatetime parses datetime string with format

func PartialRatio

func PartialRatio(left, right Expr) Expr

PartialRatio calculates partial ratio similarity

func PythonElementAt

func PythonElementAt(array, index Expr) Expr

PythonElementAt returns element at index (0-based for Python compatibility)

func Rand added in v1.2.140

func Rand() Expr

func RegexpLike

func RegexpLike(str, pattern Expr) Expr

RegexpLike performs regular expression matching

func RegexpReplace

func RegexpReplace(str, pattern Expr, replacement ...Expr) Expr

RegexpReplace replaces text matching regular expression

func Replace

func Replace(str, old, new Expr) Expr

Replace replaces all occurrences of old substring with new

func Reverse

func Reverse(str Expr) Expr

Reverse reverses a string

func Round

func Round(x Expr, decimals ...Expr) Expr

Round rounds to nearest integer or specified decimal places

func Rtrim

func Rtrim(str Expr, chars ...Expr) Expr

Rtrim removes whitespace from right end of string

func ScalarMax

func ScalarMax(a, b Expr) Expr

ScalarMax returns maximum of two values

func ScalarMin

func ScalarMin(a, b Expr) Expr

ScalarMin returns minimum of two values

func Second

func Second(timestamp Expr) Expr

Second extracts second from timestamp

func SequenceMatcherRatio

func SequenceMatcherRatio(left, right Expr) Expr

SequenceMatcherRatio calculates similarity ratio between two strings

func Sha1

func Sha1(data Expr) Expr

Sha1 calculates SHA-1 hash

func Sha256

func Sha256(data Expr) Expr

Sha256 calculates SHA-256 hash

func Sha512

func Sha512(data Expr) Expr

Sha512 calculates SHA-512 hash

func Sin

func Sin(x Expr) Expr

Sin calculates sine

func Slice

func Slice(array, start, length Expr) Expr

Slice extracts slice from array

func Split

func Split(str, delimiter Expr, maxSplit ...Expr) Expr

Split splits string by delimiter

func SpookyHashV232

func SpookyHashV232(data Expr) Expr

SpookyHashV232 calculates 32-bit SpookyHash

func SpookyHashV264

func SpookyHashV264(data Expr) Expr

SpookyHashV264 calculates 64-bit SpookyHash

func Sqrt

func Sqrt(x Expr) Expr

Sqrt calculates square root

func StartsWith

func StartsWith(str, prefix Expr) Expr

StartsWith checks if string starts with prefix

func String

func String(value string) Expr

String is an alias for Utf8 for convenience

func StringFromTimestamp

func StringFromTimestamp(timestamp Expr) Expr

StringFromTimestamp converts timestamp to ISO8601 string

func Strpos

func Strpos(str, substr Expr) Expr

Strpos finds the position of substring in string (0-based)

func Strrpos

func Strrpos(str, substr Expr) Expr

Strrpos finds the last position of substring in string (0-based)

func StructPack added in v1.2.140

func StructPack(fields map[string]Expr) Expr

func Substr

func Substr(str, start Expr, length ...Expr) Expr

Substr extracts substring

func Tan

func Tan(x Expr) Expr

Tan calculates tangent

func Timestamp

func Timestamp(value time.Time) Expr

Timestamp creates a timestamp literal expression with nanosecond precision (alias for convenience)

func TimestampFromString

func TimestampFromString(str Expr) Expr

TimestampFromString parses timestamp from ISO8601 string

func TimestampMicrosecond

func TimestampMicrosecond(value time.Time) Expr

TimestampMicrosecond creates a timestamp literal expression with microsecond precision

func TimestampMillisecond

func TimestampMillisecond(value time.Time) Expr

TimestampMillisecond creates a timestamp literal expression with millisecond precision

func TimestampNanosecond

func TimestampNanosecond(value time.Time) Expr

TimestampNanosecond creates a timestamp literal expression with nanosecond precision

func TimestampSecond

func TimestampSecond(value time.Time) Expr

TimestampSecond creates a timestamp literal expression with second precision

func ToHex

func ToHex(data Expr) Expr

ToHex converts binary data to hexadecimal string representation

func ToIso8601

func ToIso8601(timestamp Expr) Expr

ToIso8601 converts timestamp to ISO8601 string

func ToUnixtime

func ToUnixtime(timestamp Expr) Expr

ToUnixtime converts timestamp to Unix timestamp (seconds since epoch)

func ToUtf8

func ToUtf8(str Expr) Expr

ToUtf8 converts string to UTF-8 binary data

func TokenSetRatio

func TokenSetRatio(left, right Expr) Expr

TokenSetRatio calculates token set ratio similarity

func TokenSortRatio

func TokenSortRatio(left, right Expr) Expr

TokenSortRatio calculates token sort ratio similarity

func Trim

func Trim(str Expr, chars ...Expr) Expr

Trim removes whitespace from both ends of string

func Truncate

func Truncate(x Expr) Expr

Truncate truncates to integer part

func Uint8

func Uint8(value uint8) Expr

Uint8 creates a uint8 literal expression

func Uint16

func Uint16(value uint16) Expr

Uint16 creates a uint16 literal expression

func Uint32

func Uint32(value uint32) Expr

Uint32 creates a uint32 literal expression

func Uint64

func Uint64(value uint64) Expr

Uint64 creates a uint64 literal expression

func Upper

func Upper(str Expr) Expr

Upper converts string to uppercase

func Utf8

func Utf8(value string) Expr

Utf8 creates a UTF-8 string literal expression

func Year

func Year(dateTime Expr) Expr

Year extracts year from timestamp or date

func ZiSplitPart

func ZiSplitPart(str, delimiter, index Expr) Expr

ZiSplitPart splits string and returns part at index (0-based)

type ExprI

type ExprI interface {
	// String representation
	String() string
	// contains filtered or unexported methods
}

type GetAttributeExpr

type GetAttributeExpr struct {
	Parent    Expr
	Attribute string
}

GetAttributeExpr represents field access like arr.length

func (*GetAttributeExpr) Add

func (e *GetAttributeExpr) Add(other Expr) Expr

Implement Expr interface for GetAttributeExpr

func (*GetAttributeExpr) And

func (e *GetAttributeExpr) And(other Expr) Expr

func (*GetAttributeExpr) Apply added in v1.2.95

func (e *GetAttributeExpr) Apply(args ...Expr) Expr

func (*GetAttributeExpr) As

func (e *GetAttributeExpr) As(alias string) Expr

func (*GetAttributeExpr) Attr

func (e *GetAttributeExpr) Attr(attribute string) Expr

func (*GetAttributeExpr) Div

func (e *GetAttributeExpr) Div(other Expr) Expr

func (*GetAttributeExpr) Eq

func (e *GetAttributeExpr) Eq(other Expr) Expr

func (*GetAttributeExpr) Ge

func (e *GetAttributeExpr) Ge(other Expr) Expr

func (*GetAttributeExpr) Gt

func (e *GetAttributeExpr) Gt(other Expr) Expr

func (*GetAttributeExpr) IsNotNull

func (e *GetAttributeExpr) IsNotNull() Expr

func (*GetAttributeExpr) IsNull

func (e *GetAttributeExpr) IsNull() Expr

func (*GetAttributeExpr) Le

func (e *GetAttributeExpr) Le(other Expr) Expr

func (*GetAttributeExpr) Lt

func (e *GetAttributeExpr) Lt(other Expr) Expr

func (*GetAttributeExpr) Mul

func (e *GetAttributeExpr) Mul(other Expr) Expr

func (*GetAttributeExpr) Ne

func (e *GetAttributeExpr) Ne(other Expr) Expr

func (*GetAttributeExpr) Not

func (e *GetAttributeExpr) Not() Expr

func (*GetAttributeExpr) Or

func (e *GetAttributeExpr) Or(other Expr) Expr

func (*GetAttributeExpr) String

func (e *GetAttributeExpr) String() string

func (*GetAttributeExpr) Sub

func (e *GetAttributeExpr) Sub(other Expr) Expr

type IdentifierExpr

type IdentifierExpr struct {
	Expr
	Name string
}

IdentifierExpr represents an identifier (variable name, column name, etc.)

func (*IdentifierExpr) Add

func (e *IdentifierExpr) Add(other Expr) Expr

Implement Expr interface for IdentifierExpr

func (*IdentifierExpr) And

func (e *IdentifierExpr) And(other Expr) Expr

func (*IdentifierExpr) Apply added in v1.2.95

func (e *IdentifierExpr) Apply(args ...Expr) Expr

func (*IdentifierExpr) As

func (e *IdentifierExpr) As(alias string) Expr

func (*IdentifierExpr) Attr

func (e *IdentifierExpr) Attr(attribute string) Expr

func (*IdentifierExpr) Div

func (e *IdentifierExpr) Div(other Expr) Expr

func (*IdentifierExpr) Eq

func (e *IdentifierExpr) Eq(other Expr) Expr

func (*IdentifierExpr) Ge

func (e *IdentifierExpr) Ge(other Expr) Expr

func (*IdentifierExpr) Gt

func (e *IdentifierExpr) Gt(other Expr) Expr

func (*IdentifierExpr) IsNotNull

func (e *IdentifierExpr) IsNotNull() Expr

func (*IdentifierExpr) IsNull

func (e *IdentifierExpr) IsNull() Expr

func (*IdentifierExpr) Le

func (e *IdentifierExpr) Le(other Expr) Expr

func (*IdentifierExpr) Lt

func (e *IdentifierExpr) Lt(other Expr) Expr

func (*IdentifierExpr) Mul

func (e *IdentifierExpr) Mul(other Expr) Expr

func (*IdentifierExpr) Ne

func (e *IdentifierExpr) Ne(other Expr) Expr

func (*IdentifierExpr) Not

func (e *IdentifierExpr) Not() Expr

func (*IdentifierExpr) Or

func (e *IdentifierExpr) Or(other Expr) Expr

func (*IdentifierExpr) String

func (e *IdentifierExpr) String() string

func (*IdentifierExpr) Sub

func (e *IdentifierExpr) Sub(other Expr) Expr

type LiteralExpr

type LiteralExpr struct {
	Expr
	ScalarValue         *arrowv1.ScalarValue
	IsArrowScalarObject bool
}

LiteralExpr represents a literal value using Arrow scalar values

func (*LiteralExpr) Add

func (e *LiteralExpr) Add(other Expr) Expr

Implement Expr interface for LiteralExpr

func (*LiteralExpr) And

func (e *LiteralExpr) And(other Expr) Expr

func (*LiteralExpr) Apply added in v1.2.95

func (e *LiteralExpr) Apply(args ...Expr) Expr

func (*LiteralExpr) As

func (e *LiteralExpr) As(alias string) Expr

func (*LiteralExpr) Attr

func (e *LiteralExpr) Attr(attribute string) Expr

func (*LiteralExpr) Div

func (e *LiteralExpr) Div(other Expr) Expr

func (*LiteralExpr) Eq

func (e *LiteralExpr) Eq(other Expr) Expr

func (*LiteralExpr) Ge

func (e *LiteralExpr) Ge(other Expr) Expr

func (*LiteralExpr) Gt

func (e *LiteralExpr) Gt(other Expr) Expr

func (*LiteralExpr) IsNotNull

func (e *LiteralExpr) IsNotNull() Expr

func (*LiteralExpr) IsNull

func (e *LiteralExpr) IsNull() Expr

func (*LiteralExpr) Le

func (e *LiteralExpr) Le(other Expr) Expr

func (*LiteralExpr) Lt

func (e *LiteralExpr) Lt(other Expr) Expr

func (*LiteralExpr) Mul

func (e *LiteralExpr) Mul(other Expr) Expr

func (*LiteralExpr) Ne

func (e *LiteralExpr) Ne(other Expr) Expr

func (*LiteralExpr) Not

func (e *LiteralExpr) Not() Expr

func (*LiteralExpr) Or

func (e *LiteralExpr) Or(other Expr) Expr

func (*LiteralExpr) String

func (e *LiteralExpr) String() string

func (*LiteralExpr) Sub

func (e *LiteralExpr) Sub(other Expr) Expr

Jump to

Keyboard shortcuts

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