Documentation ¶
Index ¶
- func ConvertTimestampValue(in, out arrow.TimeUnit, value int64) int64
- func Equals(left, right Scalar) bool
- func Hash(seed maphash.Seed, s Scalar) uint64
- func MakeArrayFromScalar(sc Scalar, length int, mem memory.Allocator) (array.Interface, error)
- func MakeArrayOfNull(dt arrow.DataType, length int, mem memory.Allocator) array.Interface
- type Binary
- 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
- type Date64
- 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 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 Extension
- type FixedSizeBinary
- type FixedSizeList
- type Float16
- type Float32
- type Float64
- type Int16
- type Int32
- type Int64
- type Int8
- type IntervalScalar
- type List
- func (l *List) CastTo(to arrow.DataType) (Scalar, error)
- func (s List) DataType() arrow.DataType
- func (l *List) GetList() array.Interface
- 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 Scalar
- func GetScalar(arr array.Interface, 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)
- 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) 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) 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) 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) Unit() arrow.TimeUnit
- func (s *Timestamp) Validate() error
- func (s *Timestamp) ValidateFull() error
- type Uint16
- type Uint32
- type Uint64
- type Uint8
- type Vector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Equals ¶
Equals returns true if two scalars are equal, which means they have the same datatype, validity and value.
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 // 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) String ¶
func (s *Decimal128) String() string
func (*Decimal128) ValidateFull ¶
func (s *Decimal128) ValidateFull() error
type Duration ¶
func (*Duration) ValidateFull ¶
func (s *Duration) ValidateFull() error
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 array.Interface) *FixedSizeList
func NewFixedSizeListScalarWithType ¶
func NewFixedSizeListScalarWithType(val array.Interface, 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 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 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.
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 // contains filtered or unexported methods }
type Timestamp ¶
func NewTimestampScalar ¶
func (*Timestamp) ValidateFull ¶
func (s *Timestamp) ValidateFull() error
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