compute

package
v7.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 8 more Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const UnknownLength int64 = -1

Variables

View Source
var (
	ErrEmpty           = errors.New("cannot traverse empty field path")
	ErrNoChildren      = errors.New("trying to get child of type with no children")
	ErrIndexRange      = errors.New("index out of range")
	ErrMultipleMatches = errors.New("multiple matches")
	ErrNoMatch         = errors.New("no match")
	ErrInvalid         = errors.New("field ref invalid")
)

Functions

func SerializeExpr

func SerializeExpr(expr Expression, mem memory.Allocator) (*memory.Buffer, error)

SerializeExpr serializes expressions by converting them to Metadata and storing this in the schema of a Record. Embedded arrays and scalars are stored in its columns. Finally the record is written as an IPC file

func SerializeOptions

func SerializeOptions(opts FunctionOptions, mem memory.Allocator) (*memory.Buffer, error)

Types

type ArithmeticOptions

type ArithmeticOptions struct {
	CheckOverflow bool `compute:"check_overflow"`
}

func (ArithmeticOptions) TypeName

func (ArithmeticOptions) TypeName() string

type ArrayDatum

type ArrayDatum struct {
	Value arrow.ArrayData
}

ArrayDatum references an array.Data object which can be used to create array instances from if needed.

func (*ArrayDatum) Chunks

func (d *ArrayDatum) Chunks() []arrow.Array

func (*ArrayDatum) Descr

func (d *ArrayDatum) Descr() ValueDescr

func (*ArrayDatum) Equals

func (d *ArrayDatum) Equals(other Datum) bool

func (ArrayDatum) Kind

func (ArrayDatum) Kind() DatumKind

func (*ArrayDatum) Len

func (d *ArrayDatum) Len() int64

func (*ArrayDatum) MakeArray

func (d *ArrayDatum) MakeArray() arrow.Array

func (*ArrayDatum) NullN

func (d *ArrayDatum) NullN() int64

func (*ArrayDatum) Release

func (d *ArrayDatum) Release()

func (ArrayDatum) Shape

func (ArrayDatum) Shape() ValueShape

func (*ArrayDatum) String

func (d *ArrayDatum) String() string

func (*ArrayDatum) ToScalar

func (d *ArrayDatum) ToScalar() (scalar.Scalar, error)

func (*ArrayDatum) Type

func (d *ArrayDatum) Type() arrow.DataType

type ArrayLikeDatum

type ArrayLikeDatum interface {
	Datum
	Shape() ValueShape
	Descr() ValueDescr
	NullN() int64
	Type() arrow.DataType
	Chunks() []arrow.Array
}

ArrayLikeDatum is an interface for treating a Datum similarly to an Array, so that it is easy to differentiate between Record/Table/Collection and Scalar, Array/ChunkedArray for ease of use. Chunks will return an empty slice for Scalar, a slice with 1 element for Array, and the slice of chunks for a chunked array.

type Call

type Call struct {
	// contains filtered or unexported fields
}

Call is a function call with specific arguments which are themselves other expressions. A call can also have options that are specific to the function in question. It must be bound to determine the shape and type.

func (*Call) Bind

func (c *Call) Bind(ctx context.Context, mem memory.Allocator, schema *arrow.Schema) (Expression, error)

func (*Call) Descr

func (c *Call) Descr() ValueDescr

func (*Call) Equals

func (c *Call) Equals(other Expression) bool

func (*Call) FieldRef

func (c *Call) FieldRef() *FieldRef

func (*Call) Hash

func (c *Call) Hash() uint64

func (*Call) IsBound

func (c *Call) IsBound() bool

func (*Call) IsNullLiteral

func (c *Call) IsNullLiteral() bool

func (*Call) IsSatisfiable

func (c *Call) IsSatisfiable() bool

func (*Call) IsScalarExpr

func (c *Call) IsScalarExpr() bool

func (*Call) Release

func (c *Call) Release()

func (*Call) String

func (c *Call) String() string

func (*Call) Type

func (c *Call) Type() arrow.DataType

type CastOptions

type CastOptions struct {
	ToType               arrow.DataType `compute:"to_type"`
	AllowIntOverflow     bool           `compute:"allow_int_overflow"`
	AllowTimeTruncate    bool           `compute:"allow_time_truncate"`
	AllowTimeOverflow    bool           `compute:"allow_time_overflow"`
	AllowDecimalTruncate bool           `compute:"allow_decimal_truncate"`
	AllowFloatTruncate   bool           `compute:"allow_float_truncate"`
	AllowInvalidUtf8     bool           `compute:"allow_invalid_utf8"`
}

func DefaultCastOptions

func DefaultCastOptions(safe bool) *CastOptions

func NewCastOptions

func NewCastOptions(dt arrow.DataType, safe bool) *CastOptions

func (CastOptions) TypeName

func (CastOptions) TypeName() string

type ChunkedDatum

type ChunkedDatum struct {
	Value *arrow.Chunked
}

ChunkedDatum contains a chunked array for use with expressions and compute.

func (*ChunkedDatum) Chunks

func (d *ChunkedDatum) Chunks() []arrow.Array

func (*ChunkedDatum) Descr

func (d *ChunkedDatum) Descr() ValueDescr

func (*ChunkedDatum) Equals

func (d *ChunkedDatum) Equals(other Datum) bool

func (ChunkedDatum) Kind

func (ChunkedDatum) Kind() DatumKind

func (*ChunkedDatum) Len

func (d *ChunkedDatum) Len() int64

func (*ChunkedDatum) NullN

func (d *ChunkedDatum) NullN() int64

func (*ChunkedDatum) Release

func (d *ChunkedDatum) Release()

func (ChunkedDatum) Shape

func (ChunkedDatum) Shape() ValueShape

func (*ChunkedDatum) String

func (d *ChunkedDatum) String() string

func (*ChunkedDatum) Type

func (d *ChunkedDatum) Type() arrow.DataType

type CollectionDatum

type CollectionDatum []Datum

CollectionDatum is a slice of Datums

func (CollectionDatum) Equals

func (c CollectionDatum) Equals(other Datum) bool

func (CollectionDatum) Kind

func (CollectionDatum) Kind() DatumKind

func (CollectionDatum) Len

func (c CollectionDatum) Len() int64

func (CollectionDatum) Release

func (c CollectionDatum) Release()

func (CollectionDatum) String

func (c CollectionDatum) String() string

type Datum

type Datum interface {
	fmt.Stringer
	Kind() DatumKind
	Len() int64
	Equals(Datum) bool
	Release()
}

Datum is a variant interface for wrapping the various Arrow data structures for now the various Datum types just hold a Value which is the type they are wrapping, but it might make sense in the future for those types to actually be aliases or embed their types instead. Not sure yet.

func NewDatum

func NewDatum(value interface{}) Datum

NewDatum will construct the appropriate Datum type based on what is passed in as the argument.

An arrow.Array gets an ArrayDatum An array.Chunked gets a ChunkedDatum An array.Record gets a RecordDatum an array.Table gets a TableDatum a []Datum gets a CollectionDatum a scalar.Scalar gets a ScalarDatum

Anything else is passed to scalar.MakeScalar and recieves a scalar datum of that appropriate type.

type DatumKind

type DatumKind int

DatumKind is an enum used for denoting which kind of type a datum is encapsulating

const (
	KindNone       DatumKind = iota // none
	KindScalar                      // scalar
	KindArray                       // array
	KindChunked                     // chunked_array
	KindRecord                      // record_batch
	KindTable                       // table
	KindCollection                  // collection
)

func (DatumKind) String

func (i DatumKind) String() string

type EmptyDatum

type EmptyDatum struct{}

EmptyDatum is the null case, a Datum with nothing in it.

func (EmptyDatum) Equals

func (EmptyDatum) Equals(other Datum) bool

func (EmptyDatum) Kind

func (EmptyDatum) Kind() DatumKind

func (EmptyDatum) Len

func (EmptyDatum) Len() int64

func (EmptyDatum) Release

func (EmptyDatum) Release()

func (EmptyDatum) String

func (EmptyDatum) String() string

type Expression

type Expression interface {
	fmt.Stringer
	// IsBound returns true if this expression has been bound to a particular
	// Datum and/or Schema.
	IsBound() bool
	// IsScalarExpr returns true if this expression is composed only of scalar
	// literals, field references and calls to scalar functions.
	IsScalarExpr() bool
	// IsNullLiteral returns true if this expression is a literal and entirely
	// null.
	IsNullLiteral() bool
	// IsSatisfiable returns true if this expression could evaluate to true
	IsSatisfiable() bool
	// FieldRef returns a pointer to the underlying field reference, or nil if
	// this expression is not a field reference.
	FieldRef() *FieldRef
	// Descr returns the shape of this expression will evaluate to including the type
	// and whether it will be an Array, Scalar, or either.
	Descr() ValueDescr
	// Type returns the datatype this expression will evaluate to.
	Type() arrow.DataType

	Hash() uint64
	Equals(Expression) bool

	// Bind binds this expression to the given input schema, looking up appropriate
	// underlying implementations and some expression simplification may be performed
	// along with implicit casts being inserted.
	// Any state necessary for execution will be initialized.
	//
	// This only works in conjunction with cgo and being able to link against the
	// C++ libarrow.so compute library. If this was not built with the libarrow compute
	// support, this will panic.
	Bind(context.Context, memory.Allocator, *arrow.Schema) (Expression, error)

	// Release releases the underlying bound C++ memory that is allocated when
	// a Bind is performed. Any bound expression should get released to ensure
	// no memory leaks.
	Release()
	// contains filtered or unexported methods
}

Expression is an interface for mapping one datum to another. An expression is one of:

A literal Datum
A reference to a single (potentially nested) field of an input Datum
A call to a compute function, with arguments specified by other Expressions

func And

func And(lhs, rhs Expression, ops ...Expression) Expression

And constructs a tree of calls to and_kleene for boolean And logic taking an arbitrary number of values.

func Cast

func Cast(ex Expression, dt arrow.DataType) Expression

func DeserializeExpr

func DeserializeExpr(mem memory.Allocator, buf *memory.Buffer) (Expression, error)

func Equal

func Equal(lhs, rhs Expression) Expression

Equal is a convenience function for the equal function

func Greater

func Greater(lhs, rhs Expression) Expression

Greater is shorthand for NewCall("greater",....)

func GreaterEqual

func GreaterEqual(lhs, rhs Expression) Expression

GreaterEqual is shorthand for NewCall("greater_equal",....)

func IsNull

func IsNull(lhs Expression, nanIsNull bool) Expression

IsNull creates an expression that returns true if the passed in expression is null. Optionally treating NaN as null if desired.

func IsValid

func IsValid(lhs Expression) Expression

IsValid is the inverse of IsNull

func Less

func Less(lhs, rhs Expression) Expression

Less is shorthand for NewCall("less",....)

func LessEqual

func LessEqual(lhs, rhs Expression) Expression

LessEqual is shorthand for NewCall("less_equal",....)

func NewCall

func NewCall(name string, args []Expression, opts FunctionOptions) Expression

NewCall constructs an expression that represents a specific function call with the given arguments and options.

func NewFieldRef

func NewFieldRef(field string) Expression

NewFieldRef is shorthand for NewRef(FieldRefName(field))

func NewLiteral

func NewLiteral(arg interface{}) Expression

NewLiteral constructs a new literal expression from any value. It is passed to NewDatum which will construct the appropriate Datum and/or scalar value for the type provided.

func NewRef

func NewRef(ref FieldRef) Expression

NewRef constructs a parameter expression which refers to a specific field

func Not

func Not(expr Expression) Expression

Not creates a call to "invert" for the value specified.

func NotEqual

func NotEqual(lhs, rhs Expression) Expression

NotEqual creates a call to not_equal

func NullLiteral

func NullLiteral(dt arrow.DataType) Expression

func Or

func Or(lhs, rhs Expression, ops ...Expression) Expression

Or constructs a tree of calls to or_kleene for boolean Or logic taking an arbitrary number of values.

func Project

func Project(values []Expression, names []string) Expression

Project is shorthand for `make_struct` to produce a record batch output from a group of expressions.

type FieldPath

type FieldPath []int

FieldPath represents a path to a nested field using indices of child fields. For example, given the indices {5, 9, 3} the field could be retrieved with: schema.Field(5).Type().(*arrow.StructType).Field(9).Type().(*arrow.StructType).Field(3)

Attempting to retrieve a child field using a FieldPath which is not valid for a given schema will get an error such as an out of range index, or an empty path.

FieldPaths provide for drilling down to potentially nested children for convenience of accepting a slice of fields, a schema or a datatype (which should contain child fields).

A fieldpath can also be used to retrieve a child arrow.Array or column from a record batch.

func (FieldPath) Get

func (f FieldPath) Get(s *arrow.Schema) (*arrow.Field, error)

Get retrieves the corresponding nested child field by drilling through the schema's fields as per the field path.

func (FieldPath) GetColumn

func (f FieldPath) GetColumn(batch arrow.Record) (arrow.Array, error)

GetColumn will return the correct child array by traversing the fieldpath going to the nested arrays of the columns in the record batch.

func (FieldPath) GetField

func (f FieldPath) GetField(field arrow.Field) (*arrow.Field, error)

GetField is equivalent to GetFieldFromType(field.Type)

func (FieldPath) GetFieldFromSlice

func (f FieldPath) GetFieldFromSlice(fields []arrow.Field) (*arrow.Field, error)

GetFieldFromSlice treats the slice as the top layer of fields, so the first value in the field path will index into the slice, and then drill down from there.

func (FieldPath) GetFieldFromType

func (f FieldPath) GetFieldFromType(typ arrow.DataType) (*arrow.Field, error)

GetFieldFromType returns the nested field from a datatype by drilling into it's child fields.

func (FieldPath) String

func (f FieldPath) String() string

type FieldRef

type FieldRef struct {
	// contains filtered or unexported fields
}

FieldRef is a descriptor of a (potentially nested) field within a schema.

Unlike FieldPath (which is exclusively indices of child fields), FieldRef may reference a field by name. It can be constructed from either a field index, field name, or field path.

Nested fields can be referenced as well, given the schema:

		arrow.NewSchema([]arrow.Field{
			{Name: "a", Type: arrow.StructOf(arrow.Field{Name: "n", Type: arrow.Null})},
 		{Name: "b", Type: arrow.PrimitiveTypes.Int32},
		})

the following all indicate the nested field named "n":

FieldRefPath(FieldPath{0, 0})
FieldRefList("a", 0)
FieldRefList("a", "n")
FieldRefList(0, "n")
NewFieldRefFromDotPath(".a[0]")

FieldPaths matching a FieldRef are retrieved with the FindAll* functions Multiple matches are possible because field names may be duplicated within a schema. For example:

aIsAmbiguous := arrow.NewSchema([]arrow.Field{
	{Name: "a", Type: arrow.PrimitiveTypes.Int32},
	{Name: "a", Type: arrow.PrimitiveTypes.Float32},
})
matches := FieldRefName("a").FindAll(aIsAmbiguous)
assert.Len(matches, 2)
assert.True(matches[0].Get(aIsAmbiguous).Equals(aIsAmbiguous.Field(0))
assert.True(matches[1].Get(aIsAmbiguous).Equals(aIsAmbiguous.Field(1))

func FieldRefIndex

func FieldRefIndex(i int) FieldRef

FieldRefIndex is a convenience function to construct a FieldPath reference of a single index

func FieldRefList

func FieldRefList(elems ...interface{}) FieldRef

FieldRefList takes an arbitrary number of arguments which can be either strings or ints. This will panic if anything other than a string or int is passed in.

func FieldRefName

func FieldRefName(n string) FieldRef

FieldRefName constructs a FieldRef by name

func FieldRefPath

func FieldRefPath(p FieldPath) FieldRef

FieldRefPath constructs a FieldRef from a given FieldPath

func NewFieldRefFromDotPath

func NewFieldRefFromDotPath(dotpath string) (out FieldRef, err error)

NewFieldRefFromDotPath parses a dot path into a field ref.

dot_path = '.' name

| '[' digit+ ']'
| dot_path+

Examples

".alpha" => FieldRefName("alpha")
"[2]" => FieldRefIndex(2)
".beta[3]" => FieldRefList("beta", 3)
"[5].gamma.delta[7]" => FieldRefList(5, "gamma", "delta", 7)
".hello world" => FieldRefName("hello world")
`.\[y\]\\tho\.\` => FieldRef(`[y]\tho.\`)

Note: when parsing a name, a '\' preceding any other character will be dropped from the resulting name. therefore if a name must contain the characters '.', '\', '[' or ']' then they must be escaped with a preceding '\'.

func (*FieldRef) Equals

func (f *FieldRef) Equals(other FieldRef) bool

func (*FieldRef) FieldPath

func (f *FieldRef) FieldPath() FieldPath

FieldPath returns the fieldpath that this FieldRef uses, otherwise an empty FieldPath if it's not a FieldPath reference

func (FieldRef) FindAll

func (f FieldRef) FindAll(fields []arrow.Field) []FieldPath

FindAll returns all the fieldpaths which this FieldRef matches in the given slice of fields.

func (FieldRef) FindAllField

func (f FieldRef) FindAllField(field arrow.Field) []FieldPath

FindAllField returns all the fieldpaths that this FieldRef matches against the type of the given field.

func (FieldRef) FindOne

func (f FieldRef) FindOne(schema *arrow.Schema) (FieldPath, error)

FindOne returns an error if the field isn't matched or if there are multiple matches otherwise it returns the path to the single valid match.

func (FieldRef) FindOneOrNone

func (f FieldRef) FindOneOrNone(schema *arrow.Schema) (FieldPath, error)

FindOneOrNone is a convenience helper that will either return 1 fieldpath, or an empty fieldpath, and will return an error if there are multiple matches.

func (FieldRef) FindOneOrNoneRecord

func (f FieldRef) FindOneOrNoneRecord(root arrow.Record) (FieldPath, error)

FindOneOrNoneRecord is like FindOneOrNone but for the schema of a record, returning an error only if there are multiple matches.

func (FieldRef) GetAllColumns

func (f FieldRef) GetAllColumns(root arrow.Record) ([]arrow.Array, error)

GetAllColumns gets all the matching column arrays from the given record that this FieldRef references.

func (FieldRef) GetOneColumnOrNone

func (f FieldRef) GetOneColumnOrNone(root arrow.Record) (arrow.Array, error)

GetOneColumnOrNone returns either a nil or the referenced array if it can be found, erroring only if there is an ambiguous multiple matches.

func (FieldRef) GetOneField

func (f FieldRef) GetOneField(schema *arrow.Schema) (*arrow.Field, error)

GetOneField will return a pointer to a field or an error if it is not found or if there are multiple matches.

func (FieldRef) GetOneOrNone

func (f FieldRef) GetOneOrNone(schema *arrow.Schema) (*arrow.Field, error)

GetOneOrNone will return a field or a nil if the field is found or not, and only errors if there are multiple matches.

func (FieldRef) Hash

func (f FieldRef) Hash(seed maphash.Seed) uint64

Hash produces a hash of this field reference and takes in a seed so that it can maintain consistency across multiple places / processes /etc.

func (*FieldRef) IsFieldPath

func (f *FieldRef) IsFieldPath() bool

IsFieldPath returns true if this FieldRef uses a fieldpath

func (*FieldRef) IsName

func (f *FieldRef) IsName() bool

IsName returns true if this fieldref is a name reference

func (*FieldRef) IsNested

func (f *FieldRef) IsNested() bool

IsNested returns true if this FieldRef expects to represent a nested field.

func (*FieldRef) Name

func (f *FieldRef) Name() string

Name returns the name of the field this references if it is a Name reference, otherwise the empty string

func (FieldRef) String

func (f FieldRef) String() string

type FilterOptions

type FilterOptions struct {
	NullSelection NullSelectionBehavior `compute:"null_selection_behavior"`
}

func (FilterOptions) TypeName

func (FilterOptions) TypeName() string

type FunctionOptions

type FunctionOptions interface {
	TypeName() string
}

FunctionOptions can be any type which has a TypeName function. The fields of the type will be used (via reflection) to determine the information to propagate when serializing to pass to the C++ for execution.

type FunctionOptionsEqual

type FunctionOptionsEqual interface {
	Equals(FunctionOptions) bool
}

type Literal

type Literal struct {
	Literal Datum
	// contains filtered or unexported fields
}

Literal is an expression denoting a literal Datum which could be any value as a scalar, an array, or so on.

func (*Literal) Bind

func (l *Literal) Bind(ctx context.Context, mem memory.Allocator, schema *arrow.Schema) (Expression, error)

func (*Literal) Descr

func (l *Literal) Descr() ValueDescr

func (*Literal) Equals

func (l *Literal) Equals(other Expression) bool

func (Literal) FieldRef

func (Literal) FieldRef() *FieldRef

func (*Literal) Hash

func (l *Literal) Hash() uint64

func (*Literal) IsBound

func (l *Literal) IsBound() bool

func (*Literal) IsNullLiteral

func (l *Literal) IsNullLiteral() bool

func (*Literal) IsSatisfiable

func (l *Literal) IsSatisfiable() bool

func (*Literal) IsScalarExpr

func (l *Literal) IsScalarExpr() bool

func (*Literal) Release

func (l *Literal) Release()

func (*Literal) String

func (l *Literal) String() string

func (*Literal) Type

func (l *Literal) Type() arrow.DataType

type MakeStructOptions

type MakeStructOptions struct {
	FieldNames       []string          `compute:"field_names"`
	FieldNullability []bool            `compute:"field_nullability"`
	FieldMetadata    []*arrow.Metadata `compute:"field_metadata"`
}

func (MakeStructOptions) TypeName

func (MakeStructOptions) TypeName() string

type NullOptions

type NullOptions struct {
	NanIsNull bool `compute:"nan_is_null"`
}

func (NullOptions) TypeName

func (NullOptions) TypeName() string

type NullSelectionBehavior

type NullSelectionBehavior int8
const (
	DropNulls NullSelectionBehavior = iota
	EmitNulls
)

type Parameter

type Parameter struct {
	// contains filtered or unexported fields
}

Parameter represents a field reference and needs to be bound in order to determine its type and shape.

func (*Parameter) Bind

func (p *Parameter) Bind(ctx context.Context, mem memory.Allocator, schema *arrow.Schema) (Expression, error)

func (*Parameter) Descr

func (p *Parameter) Descr() ValueDescr

func (*Parameter) Equals

func (p *Parameter) Equals(other Expression) bool

func (*Parameter) FieldRef

func (p *Parameter) FieldRef() *FieldRef

func (*Parameter) Hash

func (p *Parameter) Hash() uint64

func (*Parameter) IsBound

func (p *Parameter) IsBound() bool

func (Parameter) IsNullLiteral

func (Parameter) IsNullLiteral() bool

func (*Parameter) IsSatisfiable

func (p *Parameter) IsSatisfiable() bool

func (*Parameter) IsScalarExpr

func (p *Parameter) IsScalarExpr() bool

func (*Parameter) Release

func (p *Parameter) Release()

func (*Parameter) String

func (p *Parameter) String() string

func (*Parameter) Type

func (p *Parameter) Type() arrow.DataType

type RecordDatum

type RecordDatum struct {
	Value arrow.Record
}

RecordDatum contains an array.Record for passing a full record to an expression or to compute.

func (*RecordDatum) Equals

func (r *RecordDatum) Equals(other Datum) bool

func (RecordDatum) Kind

func (RecordDatum) Kind() DatumKind

func (*RecordDatum) Len

func (r *RecordDatum) Len() int64

func (*RecordDatum) Release

func (r *RecordDatum) Release()

func (*RecordDatum) Schema

func (r *RecordDatum) Schema() *arrow.Schema

func (RecordDatum) String

func (RecordDatum) String() string

type ScalarDatum

type ScalarDatum struct {
	Value scalar.Scalar
}

ScalarDatum contains a scalar value

func (ScalarDatum) Chunks

func (ScalarDatum) Chunks() []arrow.Array

func (*ScalarDatum) Descr

func (d *ScalarDatum) Descr() ValueDescr

func (*ScalarDatum) Equals

func (d *ScalarDatum) Equals(other Datum) bool

func (ScalarDatum) Kind

func (ScalarDatum) Kind() DatumKind

func (ScalarDatum) Len

func (ScalarDatum) Len() int64

func (*ScalarDatum) NullN

func (d *ScalarDatum) NullN() int64

func (*ScalarDatum) Release

func (d *ScalarDatum) Release()

func (ScalarDatum) Shape

func (ScalarDatum) Shape() ValueShape

func (*ScalarDatum) String

func (d *ScalarDatum) String() string

func (*ScalarDatum) ToScalar

func (d *ScalarDatum) ToScalar() (scalar.Scalar, error)

func (*ScalarDatum) Type

func (d *ScalarDatum) Type() arrow.DataType

type SetLookupOptions

type SetLookupOptions struct {
	ValueSet  Datum `compute:"value_set"`
	SkipNulls bool  `compute:"skip_nulls"`
}

func (*SetLookupOptions) Equals

func (s *SetLookupOptions) Equals(other FunctionOptions) bool

func (*SetLookupOptions) FromStructScalar

func (s *SetLookupOptions) FromStructScalar(sc *scalar.Struct) error

func (*SetLookupOptions) Release

func (s *SetLookupOptions) Release()

func (SetLookupOptions) TypeName

func (SetLookupOptions) TypeName() string

type StrptimeOptions

type StrptimeOptions struct {
	Format string         `compute:"format"`
	Unit   arrow.TimeUnit `compute:"unit"`
}

func (StrptimeOptions) TypeName

func (StrptimeOptions) TypeName() string

type TableDatum

type TableDatum struct {
	Value arrow.Table
}

TableDatum contains a table so that multiple record batches can be worked with together as a single table for being passed to compute and expression handling.

func (*TableDatum) Equals

func (d *TableDatum) Equals(other Datum) bool

func (TableDatum) Kind

func (TableDatum) Kind() DatumKind

func (*TableDatum) Len

func (d *TableDatum) Len() int64

func (*TableDatum) Release

func (d *TableDatum) Release()

func (*TableDatum) Schema

func (d *TableDatum) Schema() *arrow.Schema

func (TableDatum) String

func (TableDatum) String() string

type TableLikeDatum

type TableLikeDatum interface {
	Datum
	Schema() *arrow.Schema
}

TableLikeDatum is an interface type for specifying either a RecordBatch or a Table as both contain a schema as opposed to just a single data type.

type ValueDescr

type ValueDescr struct {
	Shape ValueShape
	Type  arrow.DataType
}

ValueDescr is a descriptor type giving both the shape and the datatype of a value but without the data.

func (*ValueDescr) String

func (v *ValueDescr) String() string

type ValueShape

type ValueShape int8

ValueShape is a brief description of the shape of a value (array, scalar or otherwise)

const (
	// either Array or Scalar
	ShapeAny    ValueShape = iota // any
	ShapeArray                    // array
	ShapeScalar                   // scalar
)

func (ValueShape) String

func (i ValueShape) String() string

Jump to

Keyboard shortcuts

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