Documentation ¶
Index ¶
- func Append(bldr array.Builder, s Scalar) error
- func AppendSlice(bldr array.Builder, scalars []Scalar) error
- func ApproxEquals(left, right Scalar, opts ...EqualOption) bool
- func Equals(left, right Scalar) bool
- func FromScalar(sc *Struct, val interface{}) error
- func Hash(seed maphash.Seed, s Scalar) uint64
- func MakeArrayFromScalar(sc Scalar, length int, mem memory.Allocator) (arrow.Array, error)
- func MakeArrayOfNull(dt arrow.DataType, length int, mem memory.Allocator) arrow.Arraydeprecated
- type Binary
- func (b *Binary) Buffer() *memory.Buffer
- func (b *Binary) CastTo(to arrow.DataType) (Scalar, error)
- func (b *Binary) Data() []byte
- func (s Binary) DataType() arrow.DataType
- func (s *Binary) IsValid() bool
- func (b *Binary) Release()
- func (b *Binary) Retain()
- func (b *Binary) String() string
- func (b *Binary) Validate() (err error)
- func (b *Binary) ValidateFull() error
- type BinaryScalar
- type Boolean
- type Date32
- func (s *Date32) CastTo(to arrow.DataType) (Scalar, error)
- func (s *Date32) Data() []byte
- func (s Date32) DataType() arrow.DataType
- func (s *Date32) IsValid() bool
- func (s *Date32) String() string
- func (s *Date32) ToTime() time.Time
- func (s *Date32) Validate() error
- func (s *Date32) ValidateFull() error
- type Date64
- func (s *Date64) CastTo(to arrow.DataType) (Scalar, error)
- func (s *Date64) Data() []byte
- func (s Date64) DataType() arrow.DataType
- func (s *Date64) IsValid() bool
- func (s *Date64) String() string
- func (s *Date64) ToTime() time.Time
- func (s *Date64) Validate() error
- func (s *Date64) ValidateFull() error
- type DateScalar
- type DayTimeInterval
- func (s *DayTimeInterval) CastTo(to arrow.DataType) (Scalar, error)
- func (s *DayTimeInterval) Data() []byte
- func (s DayTimeInterval) DataType() arrow.DataType
- func (s *DayTimeInterval) IsValid() bool
- func (s *DayTimeInterval) String() string
- func (s *DayTimeInterval) Validate() error
- func (s *DayTimeInterval) ValidateFull() error
- type Decimal128
- type Decimal256
- type DenseUnion
- func (s *DenseUnion) CastTo(to arrow.DataType) (Scalar, error)
- func (s *DenseUnion) ChildValue() Scalar
- func (s DenseUnion) DataType() arrow.DataType
- func (s *DenseUnion) IsValid() bool
- func (s *DenseUnion) Release()
- func (s *DenseUnion) Retain()
- func (s *DenseUnion) String() string
- func (s *DenseUnion) Validate() (err error)
- func (s *DenseUnion) ValidateFull() error
- type Dictionary
- func (s *Dictionary) CastTo(arrow.DataType) (Scalar, error)
- func (s *Dictionary) Data() []byte
- func (s Dictionary) DataType() arrow.DataType
- func (s *Dictionary) GetEncodedValue() (Scalar, error)
- func (s *Dictionary) IsValid() bool
- func (s *Dictionary) Release()
- func (s *Dictionary) Retain()
- func (s *Dictionary) String() string
- func (s *Dictionary) Validate() (err error)
- func (s *Dictionary) ValidateFull() (err error)
- type Duration
- func (s *Duration) CastTo(to arrow.DataType) (Scalar, error)
- func (s *Duration) Data() []byte
- func (s Duration) DataType() arrow.DataType
- func (s *Duration) IsValid() bool
- func (s *Duration) String() string
- func (s *Duration) Unit() arrow.TimeUnit
- func (s *Duration) Validate() error
- func (s *Duration) ValidateFull() error
- type EqualOption
- type Extension
- type FixedSizeBinary
- type FixedSizeList
- type Float16
- type Float32
- type Float64
- type Int16
- type Int32
- type Int64
- type Int8
- type IntervalScalar
- type LargeBinary
- type LargeList
- type LargeString
- type List
- func (l *List) CastTo(to arrow.DataType) (Scalar, error)
- func (s List) DataType() arrow.DataType
- func (l *List) GetList() arrow.Array
- func (s *List) IsValid() bool
- func (l *List) Release()
- func (l *List) Retain()
- func (l *List) String() string
- func (l *List) Validate() (err error)
- func (l *List) ValidateFull() error
- type ListScalar
- type Map
- type MonthDayNanoInterval
- func (s *MonthDayNanoInterval) CastTo(to arrow.DataType) (Scalar, error)
- func (s *MonthDayNanoInterval) Data() []byte
- func (s MonthDayNanoInterval) DataType() arrow.DataType
- func (s *MonthDayNanoInterval) IsValid() bool
- func (s *MonthDayNanoInterval) String() string
- func (s *MonthDayNanoInterval) Validate() error
- func (s *MonthDayNanoInterval) ValidateFull() error
- type MonthInterval
- func (s *MonthInterval) CastTo(to arrow.DataType) (Scalar, error)
- func (s *MonthInterval) Data() []byte
- func (s MonthInterval) DataType() arrow.DataType
- func (s *MonthInterval) IsValid() bool
- func (s *MonthInterval) String() string
- func (s *MonthInterval) Validate() error
- func (s *MonthInterval) ValidateFull() error
- type Null
- type PrimitiveScalar
- type Releasable
- type RunEndEncoded
- func (s *RunEndEncoded) CastTo(to arrow.DataType) (Scalar, error)
- func (s RunEndEncoded) DataType() arrow.DataType
- func (s *RunEndEncoded) IsValid() bool
- func (s *RunEndEncoded) Release()
- func (s *RunEndEncoded) String() string
- func (s *RunEndEncoded) Validate() (err error)
- func (s *RunEndEncoded) ValidateFull() error
- type Scalar
- func GetScalar(arr arrow.Array, idx int) (Scalar, error)
- func MakeIntegerScalar(v int64, bitsize int) (Scalar, error)
- func MakeNullScalar(dt arrow.DataType) Scalar
- func MakeScalar(val interface{}) Scalar
- func MakeScalarParam(val interface{}, dt arrow.DataType) (Scalar, error)
- func MakeUnsignedIntegerScalar(v uint64, bitsize int) (Scalar, error)
- func ParseScalar(dt arrow.DataType, val string) (Scalar, error)
- func ToScalar(val interface{}, mem memory.Allocator) (Scalar, error)
- type SparseUnion
- func (s *SparseUnion) CastTo(to arrow.DataType) (Scalar, error)
- func (s *SparseUnion) ChildValue() Scalar
- func (s SparseUnion) DataType() arrow.DataType
- func (s *SparseUnion) IsValid() bool
- func (s *SparseUnion) Release()
- func (s *SparseUnion) Retain()
- func (s *SparseUnion) String() string
- func (s *SparseUnion) Validate() (err error)
- func (s *SparseUnion) ValidateFull() (err error)
- type String
- type Struct
- func (s *Struct) CastTo(to arrow.DataType) (Scalar, error)
- func (s Struct) DataType() arrow.DataType
- func (s *Struct) Field(name string) (Scalar, error)
- func (s *Struct) IsValid() bool
- func (s *Struct) Release()
- func (s *Struct) String() string
- func (s *Struct) Validate() (err error)
- func (s *Struct) ValidateFull() (err error)
- type TemporalScalar
- type Time32
- func (s *Time32) CastTo(to arrow.DataType) (Scalar, error)
- func (s *Time32) Data() []byte
- func (s Time32) DataType() arrow.DataType
- func (s *Time32) IsValid() bool
- func (s *Time32) String() string
- func (s *Time32) ToTime() time.Time
- func (s *Time32) Unit() arrow.TimeUnit
- func (s *Time32) Validate() error
- func (s *Time32) ValidateFull() error
- type Time64
- func (s *Time64) CastTo(to arrow.DataType) (Scalar, error)
- func (s *Time64) Data() []byte
- func (s Time64) DataType() arrow.DataType
- func (s *Time64) IsValid() bool
- func (s *Time64) String() string
- func (s *Time64) ToTime() time.Time
- func (s *Time64) Unit() arrow.TimeUnit
- func (s *Time64) Validate() error
- func (s *Time64) ValidateFull() error
- type TimeScalar
- type Timestamp
- func (s *Timestamp) CastTo(to arrow.DataType) (Scalar, error)
- func (s *Timestamp) Data() []byte
- func (s Timestamp) DataType() arrow.DataType
- func (s *Timestamp) IsValid() bool
- func (s *Timestamp) String() string
- func (s *Timestamp) ToTime() time.Time
- func (s *Timestamp) Unit() arrow.TimeUnit
- func (s *Timestamp) Validate() error
- func (s *Timestamp) ValidateFull() error
- type TypeFromScalar
- type TypeToScalar
- type Uint16
- type Uint32
- type Uint64
- type Uint8
- type Union
- type Vector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Append ¶
Append requires the passed in builder and scalar to have the same datatype otherwise it will return an error. Will return arrow.ErrNotImplemented if the type hasn't been implemented for this.
NOTE only available in go1.18+
func AppendSlice ¶
AppendSlice requires the passed in builder and all scalars in the slice to have the same datatype otherwise it will return an error. Will return arrow.ErrNotImplemented if the type hasn't been implemented for this.
NOTE only available in go1.18+
func ApproxEquals ¶
func ApproxEquals(left, right Scalar, opts ...EqualOption) bool
func Equals ¶
Equals returns true if two scalars are equal, which means they have the same datatype, validity and value.
func FromScalar ¶
func MakeArrayFromScalar ¶
MakeArrayFromScalar returns an array filled with the scalar value repeated length times. Not yet implemented for nested types such as Struct, List, extension and so on.
Types ¶
type Binary ¶
func (*Binary) ValidateFull ¶
type BinaryScalar ¶
type Boolean ¶
type Boolean struct { Value bool // contains filtered or unexported fields }
func NewBooleanScalar ¶
func (*Boolean) ValidateFull ¶
func (s *Boolean) ValidateFull() error
type Date32 ¶
func NewDate32Scalar ¶
func (*Date32) ValidateFull ¶
func (s *Date32) ValidateFull() error
type Date64 ¶
func NewDate64Scalar ¶
func (*Date64) ValidateFull ¶
func (s *Date64) ValidateFull() error
type DateScalar ¶
type DateScalar interface { TemporalScalar ToTime() time.Time // contains filtered or unexported methods }
type DayTimeInterval ¶
type DayTimeInterval struct { Value arrow.DayTimeInterval // contains filtered or unexported fields }
func NewDayTimeIntervalScalar ¶
func NewDayTimeIntervalScalar(val arrow.DayTimeInterval) *DayTimeInterval
func (*DayTimeInterval) CastTo ¶
func (s *DayTimeInterval) CastTo(to arrow.DataType) (Scalar, error)
func (*DayTimeInterval) Data ¶
func (s *DayTimeInterval) Data() []byte
func (*DayTimeInterval) String ¶
func (s *DayTimeInterval) String() string
func (*DayTimeInterval) ValidateFull ¶
func (s *DayTimeInterval) ValidateFull() error
type Decimal128 ¶
type Decimal128 struct { Value decimal128.Num // contains filtered or unexported fields }
func NewDecimal128Scalar ¶
func NewDecimal128Scalar(val decimal128.Num, typ arrow.DataType) *Decimal128
func (*Decimal128) Data ¶
func (s *Decimal128) Data() []byte
func (*Decimal128) String ¶
func (s *Decimal128) String() string
func (*Decimal128) ValidateFull ¶
func (s *Decimal128) ValidateFull() error
type Decimal256 ¶
type Decimal256 struct { Value decimal256.Num // contains filtered or unexported fields }
func NewDecimal256Scalar ¶
func NewDecimal256Scalar(val decimal256.Num, typ arrow.DataType) *Decimal256
func (*Decimal256) Data ¶
func (s *Decimal256) Data() []byte
func (*Decimal256) String ¶
func (s *Decimal256) String() string
func (*Decimal256) ValidateFull ¶
func (s *Decimal256) ValidateFull() error
type DenseUnion ¶
type DenseUnion struct { TypeCode arrow.UnionTypeCode Value Scalar // contains filtered or unexported fields }
func NewDenseUnionScalar ¶
func NewDenseUnionScalar(v Scalar, code arrow.UnionTypeCode, dt *arrow.DenseUnionType) *DenseUnion
func (*DenseUnion) ChildValue ¶
func (s *DenseUnion) ChildValue() Scalar
func (*DenseUnion) Release ¶
func (s *DenseUnion) Release()
func (*DenseUnion) Retain ¶
func (s *DenseUnion) Retain()
func (*DenseUnion) String ¶
func (s *DenseUnion) String() string
func (*DenseUnion) Validate ¶
func (s *DenseUnion) Validate() (err error)
func (*DenseUnion) ValidateFull ¶
func (s *DenseUnion) ValidateFull() error
type Dictionary ¶
type Dictionary struct { Value struct { Index Scalar Dict arrow.Array } // contains filtered or unexported fields }
func NewDictScalar ¶
func NewDictScalar(index Scalar, dict arrow.Array) *Dictionary
func NewNullDictScalar ¶
func NewNullDictScalar(dt arrow.DataType) *Dictionary
func (*Dictionary) Data ¶
func (s *Dictionary) Data() []byte
func (*Dictionary) GetEncodedValue ¶
func (s *Dictionary) GetEncodedValue() (Scalar, error)
func (*Dictionary) Release ¶
func (s *Dictionary) Release()
func (*Dictionary) Retain ¶
func (s *Dictionary) Retain()
func (*Dictionary) String ¶
func (s *Dictionary) String() string
func (*Dictionary) Validate ¶
func (s *Dictionary) Validate() (err error)
func (*Dictionary) ValidateFull ¶
func (s *Dictionary) ValidateFull() (err error)
type Duration ¶
func (*Duration) ValidateFull ¶
func (s *Duration) ValidateFull() error
type EqualOption ¶
type EqualOption func(*equalOption)
EqualOption is a functional option type used to configure how Records and Arrays are compared.
func WithAbsTolerance ¶
func WithAbsTolerance(atol float64) EqualOption
WithAbsTolerance configures the comparison functions so that 2 floating point values v1 and v2 are considered equal if |v1-v2| <= atol.
func WithNaNsEqual ¶
func WithNaNsEqual(val bool) EqualOption
WithNaNsEqual configures the comparison functions so that NaNs are considered equal.
type Extension ¶
type Extension struct { Value Scalar // contains filtered or unexported fields }
func (*Extension) ValidateFull ¶
type FixedSizeBinary ¶
type FixedSizeBinary struct {
*Binary
}
func NewFixedSizeBinaryScalar ¶
func NewFixedSizeBinaryScalar(val *memory.Buffer, typ arrow.DataType) *FixedSizeBinary
func (*FixedSizeBinary) Validate ¶
func (b *FixedSizeBinary) Validate() (err error)
func (*FixedSizeBinary) ValidateFull ¶
func (b *FixedSizeBinary) ValidateFull() error
type FixedSizeList ¶
type FixedSizeList struct {
*List
}
func NewFixedSizeListScalar ¶
func NewFixedSizeListScalar(val arrow.Array) *FixedSizeList
func NewFixedSizeListScalarWithType ¶
func NewFixedSizeListScalarWithType(val arrow.Array, typ arrow.DataType) *FixedSizeList
func (*FixedSizeList) Validate ¶
func (f *FixedSizeList) Validate() (err error)
func (*FixedSizeList) ValidateFull ¶
func (f *FixedSizeList) ValidateFull() error
type Float16 ¶
func NewFloat16Scalar ¶
func (*Float16) ValidateFull ¶
func (s *Float16) ValidateFull() error
type Float32 ¶
type Float32 struct { Value float32 // contains filtered or unexported fields }
func NewFloat32Scalar ¶
func (*Float32) ValidateFull ¶
func (s *Float32) ValidateFull() error
type Float64 ¶
type Float64 struct { Value float64 // contains filtered or unexported fields }
func NewFloat64Scalar ¶
func (*Float64) ValidateFull ¶
func (s *Float64) ValidateFull() error
type Int16 ¶
type Int16 struct { Value int16 // contains filtered or unexported fields }
func NewInt16Scalar ¶
func (*Int16) ValidateFull ¶
func (s *Int16) ValidateFull() error
type Int32 ¶
type Int32 struct { Value int32 // contains filtered or unexported fields }
func NewInt32Scalar ¶
func (*Int32) ValidateFull ¶
func (s *Int32) ValidateFull() error
type Int64 ¶
type Int64 struct { Value int64 // contains filtered or unexported fields }
func NewInt64Scalar ¶
func (*Int64) ValidateFull ¶
func (s *Int64) ValidateFull() error
type Int8 ¶
type Int8 struct { Value int8 // contains filtered or unexported fields }
func NewInt8Scalar ¶
func (*Int8) ValidateFull ¶
func (s *Int8) ValidateFull() error
type IntervalScalar ¶
type IntervalScalar interface { TemporalScalar // contains filtered or unexported methods }
type LargeBinary ¶
type LargeBinary struct {
*Binary
}
func NewLargeBinaryScalar ¶
func NewLargeBinaryScalar(val *memory.Buffer) *LargeBinary
type LargeList ¶
type LargeList struct {
*List
}
func NewLargeListScalar ¶
func NewLargeListScalarData ¶
type LargeString ¶
type LargeString struct {
// contains filtered or unexported fields
}
func NewLargeStringScalar ¶
func NewLargeStringScalar(val string) *LargeString
func NewLargeStringScalarFromBuffer ¶
func NewLargeStringScalarFromBuffer(val *memory.Buffer) *LargeString
type ListScalar ¶
type MonthDayNanoInterval ¶
type MonthDayNanoInterval struct { Value arrow.MonthDayNanoInterval // contains filtered or unexported fields }
func NewMonthDayNanoIntervalScalar ¶
func NewMonthDayNanoIntervalScalar(val arrow.MonthDayNanoInterval) *MonthDayNanoInterval
func (*MonthDayNanoInterval) CastTo ¶
func (s *MonthDayNanoInterval) CastTo(to arrow.DataType) (Scalar, error)
func (*MonthDayNanoInterval) Data ¶
func (s *MonthDayNanoInterval) Data() []byte
func (*MonthDayNanoInterval) String ¶
func (s *MonthDayNanoInterval) String() string
func (*MonthDayNanoInterval) ValidateFull ¶
func (s *MonthDayNanoInterval) ValidateFull() error
type MonthInterval ¶
type MonthInterval struct { Value arrow.MonthInterval // contains filtered or unexported fields }
func NewMonthIntervalScalar ¶
func NewMonthIntervalScalar(val arrow.MonthInterval) *MonthInterval
func (*MonthInterval) Data ¶
func (s *MonthInterval) Data() []byte
func (*MonthInterval) String ¶
func (s *MonthInterval) String() string
func (*MonthInterval) ValidateFull ¶
func (s *MonthInterval) ValidateFull() error
type Null ¶
type Null struct {
// contains filtered or unexported fields
}
func (*Null) ValidateFull ¶
type PrimitiveScalar ¶
type Releasable ¶
type Releasable interface { Release() Retain() }
type RunEndEncoded ¶
type RunEndEncoded struct { Value Scalar // contains filtered or unexported fields }
func NewRunEndEncodedScalar ¶
func NewRunEndEncodedScalar(v Scalar, dt *arrow.RunEndEncodedType) *RunEndEncoded
func (*RunEndEncoded) Release ¶
func (s *RunEndEncoded) Release()
func (*RunEndEncoded) String ¶
func (s *RunEndEncoded) String() string
func (*RunEndEncoded) Validate ¶
func (s *RunEndEncoded) Validate() (err error)
func (*RunEndEncoded) ValidateFull ¶
func (s *RunEndEncoded) ValidateFull() error
type Scalar ¶
type Scalar interface { fmt.Stringer // IsValid returns true if the value is non-null, otherwise false. IsValid() bool // The datatype of the value in this scalar DataType() arrow.DataType // Performs cheap validation checks, returns nil if successful Validate() error // Perform more expensive validation checks, returns nil if successful ValidateFull() error // Cast the value to the desired DataType (returns an error if unable to do so) // should take semantics into account and modify the value accordingly. CastTo(arrow.DataType) (Scalar, error) // contains filtered or unexported methods }
Scalar represents a single value of a specific DataType as opposed to an array.
Scalars are useful for passing single value inputs to compute functions (not yet implemented) or for representing individual array elements, (with a non-trivial cost though).
func GetScalar ¶
GetScalar creates a scalar object from the value at a given index in the passed in array, returns an error if unable to do so.
func MakeIntegerScalar ¶
MakeIntegerScalar is a helper function for creating an integer scalar of a given bitsize.
func MakeNullScalar ¶
MakeNullScalar creates a scalar value of the desired type representing a null value
func MakeScalar ¶
func MakeScalar(val interface{}) Scalar
MakeScalar creates a scalar of the passed in type via reflection.
func MakeScalarParam ¶
MakeScalarParam is for converting a value to a scalar when it requires a parameterized data type such as a time type that needs units, or a fixed size list which needs it's size.
Will fall back to MakeScalar without the passed in type if not one of the parameterized types.
func MakeUnsignedIntegerScalar ¶
MakeUnsignedIntegerScalar is a helper function for creating an unsigned int scalar of the specified bit width.
func ParseScalar ¶
ParseScalar parses a string to create a scalar of the passed in type. Currently does not support any nested types such as Structs or Lists.
type SparseUnion ¶
type SparseUnion struct { TypeCode arrow.UnionTypeCode Value []Scalar ChildID int // contains filtered or unexported fields }
func NewSparseUnionScalar ¶
func NewSparseUnionScalar(val []Scalar, code arrow.UnionTypeCode, dt *arrow.SparseUnionType) *SparseUnion
func NewSparseUnionScalarFromValue ¶
func NewSparseUnionScalarFromValue(val Scalar, idx int, dt *arrow.SparseUnionType) *SparseUnion
func (*SparseUnion) ChildValue ¶
func (s *SparseUnion) ChildValue() Scalar
func (*SparseUnion) Release ¶
func (s *SparseUnion) Release()
func (*SparseUnion) Retain ¶
func (s *SparseUnion) Retain()
func (*SparseUnion) String ¶
func (s *SparseUnion) String() string
func (*SparseUnion) Validate ¶
func (s *SparseUnion) Validate() (err error)
func (*SparseUnion) ValidateFull ¶
func (s *SparseUnion) ValidateFull() (err error)
type String ¶
type String struct {
*Binary
}
func NewStringScalar ¶
func (*String) ValidateFull ¶
type Struct ¶
type Struct struct { Value Vector // contains filtered or unexported fields }
func (*Struct) ValidateFull ¶
type TemporalScalar ¶
type TemporalScalar interface { Scalar // contains filtered or unexported methods }
type Time32 ¶
func (*Time32) ValidateFull ¶
func (s *Time32) ValidateFull() error
type Time64 ¶
func (*Time64) ValidateFull ¶
func (s *Time64) ValidateFull() error
type TimeScalar ¶
type TimeScalar interface { TemporalScalar Unit() arrow.TimeUnit ToTime() time.Time // contains filtered or unexported methods }
type Timestamp ¶
func NewTimestampScalar ¶
func (*Timestamp) ValidateFull ¶
func (s *Timestamp) ValidateFull() error
type TypeFromScalar ¶
type TypeToScalar ¶
type Uint16 ¶
type Uint16 struct { Value uint16 // contains filtered or unexported fields }
func NewUint16Scalar ¶
func (*Uint16) ValidateFull ¶
func (s *Uint16) ValidateFull() error
type Uint32 ¶
type Uint32 struct { Value uint32 // contains filtered or unexported fields }
func NewUint32Scalar ¶
func (*Uint32) ValidateFull ¶
func (s *Uint32) ValidateFull() error
type Uint64 ¶
type Uint64 struct { Value uint64 // contains filtered or unexported fields }
func NewUint64Scalar ¶
func (*Uint64) ValidateFull ¶
func (s *Uint64) ValidateFull() error
type Uint8 ¶
type Uint8 struct { Value uint8 // contains filtered or unexported fields }
func NewUint8Scalar ¶
func (*Uint8) ValidateFull ¶
func (s *Uint8) ValidateFull() error