Documentation ¶
Overview ¶
Package types contains user-defined types for use in the tests for the arrow package
Index ¶
- Variables
- type DictExtensionArray
- type DictExtensionType
- func (DictExtensionType) ArrayType() reflect.Type
- func (p *DictExtensionType) Deserialize(storage arrow.DataType, data string) (arrow.ExtensionType, error)
- func (p *DictExtensionType) ExtensionEquals(other arrow.ExtensionType) bool
- func (DictExtensionType) ExtensionName() string
- func (DictExtensionType) Serialize() string
- func (p *DictExtensionType) String() string
- type ExtStructArray
- type ExtStructType
- func (ExtStructType) ArrayType() reflect.Type
- func (ExtStructType) Deserialize(_ arrow.DataType, serialized string) (arrow.ExtensionType, error)
- func (ExtStructType) ExtensionEquals(other arrow.ExtensionType) bool
- func (ExtStructType) ExtensionName() string
- func (ExtStructType) Serialize() string
- func (p *ExtStructType) String() string
- type Parametric1Array
- type Parametric1Type
- func (Parametric1Type) ArrayType() reflect.Type
- func (Parametric1Type) Deserialize(storage arrow.DataType, data string) (arrow.ExtensionType, error)
- func (p *Parametric1Type) ExtensionEquals(other arrow.ExtensionType) bool
- func (Parametric1Type) ExtensionName() string
- func (p *Parametric1Type) Serialize() string
- func (p *Parametric1Type) String() string
- type Parametric2Array
- type Parametric2Type
- func (Parametric2Type) ArrayType() reflect.Type
- func (Parametric2Type) Deserialize(storage arrow.DataType, data string) (arrow.ExtensionType, error)
- func (p *Parametric2Type) ExtensionEquals(other arrow.ExtensionType) bool
- func (p *Parametric2Type) ExtensionName() string
- func (p *Parametric2Type) Serialize() string
- func (p *Parametric2Type) String() string
- type SmallintArray
- type SmallintType
- type UUIDArray
- type UUIDBuilder
- func (b *UUIDBuilder) Append(v uuid.UUID)
- func (b *UUIDBuilder) AppendValueFromString(s string) error
- func (b *UUIDBuilder) AppendValues(v []uuid.UUID, valid []bool)
- func (b *UUIDBuilder) Unmarshal(dec *json.Decoder) error
- func (b *UUIDBuilder) UnmarshalJSON(data []byte) error
- func (b *UUIDBuilder) UnmarshalOne(dec *json.Decoder) error
- func (b *UUIDBuilder) UnsafeAppend(v uuid.UUID)
- type UUIDType
- func (*UUIDType) ArrayType() reflect.Type
- func (*UUIDType) Deserialize(storageType arrow.DataType, data string) (arrow.ExtensionType, error)
- func (e *UUIDType) ExtensionEquals(other arrow.ExtensionType) bool
- func (*UUIDType) ExtensionName() string
- func (e *UUIDType) MarshalJSON() ([]byte, error)
- func (*UUIDType) NewBuilder(bldr *array.ExtensionBuilder) array.Builder
- func (*UUIDType) Serialize() string
- func (e *UUIDType) String() string
Constants ¶
This section is empty.
Variables ¶
var UUID = NewUUIDType()
Functions ¶
This section is empty.
Types ¶
type DictExtensionArray ¶
type DictExtensionArray struct {
array.ExtensionArrayBase
}
func (DictExtensionArray) ValueStr ¶
func (a DictExtensionArray) ValueStr(i int) string
type DictExtensionType ¶
type DictExtensionType struct {
arrow.ExtensionBase
}
func NewDictExtensionType ¶
func NewDictExtensionType() *DictExtensionType
func (DictExtensionType) ArrayType ¶
func (DictExtensionType) ArrayType() reflect.Type
func (*DictExtensionType) Deserialize ¶
func (p *DictExtensionType) Deserialize(storage arrow.DataType, data string) (arrow.ExtensionType, error)
func (*DictExtensionType) ExtensionEquals ¶
func (p *DictExtensionType) ExtensionEquals(other arrow.ExtensionType) bool
func (DictExtensionType) ExtensionName ¶
func (DictExtensionType) ExtensionName() string
func (DictExtensionType) Serialize ¶
func (DictExtensionType) Serialize() string
func (*DictExtensionType) String ¶
func (p *DictExtensionType) String() string
type ExtStructArray ¶
type ExtStructArray struct {
array.ExtensionArrayBase
}
ExtStructArray is a struct array type for testing an extension type with non-primitive storage
func (ExtStructArray) ValueStr ¶
func (a ExtStructArray) ValueStr(i int) string
type ExtStructType ¶
type ExtStructType struct {
arrow.ExtensionBase
}
ExtStructType is an extension type with a non-primitive storage type containing a struct with fields {a: int64, b: float64}
func NewExtStructType ¶
func NewExtStructType() *ExtStructType
func (ExtStructType) ArrayType ¶
func (ExtStructType) ArrayType() reflect.Type
ArrayType returns TypeOf(ExtStructType{})
func (ExtStructType) Deserialize ¶
func (ExtStructType) Deserialize(_ arrow.DataType, serialized string) (arrow.ExtensionType, error)
Deserialize ignores the passed in storage datatype and only checks the serialized data byte slice returning the correct type if it matches "ext-struct-type-unique-code".
func (ExtStructType) ExtensionEquals ¶
func (ExtStructType) ExtensionEquals(other arrow.ExtensionType) bool
ExtensionEquals returns true if other is a *ExtStructType
func (ExtStructType) ExtensionName ¶
func (ExtStructType) ExtensionName() string
ExtensionName is always "ext-struct-type"
func (ExtStructType) Serialize ¶
func (ExtStructType) Serialize() string
Serialize just returns "ext-struct-type-unique-code" to test metadata passing in IPC
func (*ExtStructType) String ¶
func (p *ExtStructType) String() string
type Parametric1Array ¶
type Parametric1Array struct {
array.ExtensionArrayBase
}
Parametric1Array is a simple int32 array for use with the Parametric1Type in testing a parameterized user-defined extension type.
func (Parametric1Array) ValueStr ¶
func (a Parametric1Array) ValueStr(i int) string
type Parametric1Type ¶
type Parametric1Type struct { arrow.ExtensionBase // contains filtered or unexported fields }
A type where ExtensionName is always the same
func NewParametric1Type ¶
func NewParametric1Type(p int32) *Parametric1Type
func (Parametric1Type) ArrayType ¶
func (Parametric1Type) ArrayType() reflect.Type
ArrayType returns the TypeOf(Parametric1Array{})
func (Parametric1Type) Deserialize ¶
func (Parametric1Type) Deserialize(storage arrow.DataType, data string) (arrow.ExtensionType, error)
Deserialize requires storage to be an int32 type and data should be a 4 byte little endian int32 value
func (*Parametric1Type) ExtensionEquals ¶
func (p *Parametric1Type) ExtensionEquals(other arrow.ExtensionType) bool
ExtensionEquals returns true if other is a *Parametric1Type and has the same param
func (Parametric1Type) ExtensionName ¶
func (Parametric1Type) ExtensionName() string
ExtensionName is always "parametric-type-1"
func (*Parametric1Type) Serialize ¶
func (p *Parametric1Type) Serialize() string
Serialize returns the param as 4 little endian bytes
func (*Parametric1Type) String ¶
func (p *Parametric1Type) String() string
type Parametric2Array ¶
type Parametric2Array struct {
array.ExtensionArrayBase
}
Parametric2Array is another simple int32 array for use with the Parametric2Type also for testing a parameterized user-defined extension type that utilizes the parameter for defining different types based on the param.
func (Parametric2Array) ValueStr ¶
func (a Parametric2Array) ValueStr(i int) string
type Parametric2Type ¶
type Parametric2Type struct { arrow.ExtensionBase // contains filtered or unexported fields }
a parametric type where the extension name is different for each parameter, and must be registered separately
func NewParametric2Type ¶
func NewParametric2Type(p int32) *Parametric2Type
func (Parametric2Type) ArrayType ¶
func (Parametric2Type) ArrayType() reflect.Type
ArrayType returns TypeOf(Parametric2Array{})
func (Parametric2Type) Deserialize ¶
func (Parametric2Type) Deserialize(storage arrow.DataType, data string) (arrow.ExtensionType, error)
Deserialize expects storage to be int32 type and data must be a 4 byte little endian slice.
func (*Parametric2Type) ExtensionEquals ¶
func (p *Parametric2Type) ExtensionEquals(other arrow.ExtensionType) bool
ExtensionEquals returns true if other is a *Parametric2Type and has the same param
func (*Parametric2Type) ExtensionName ¶
func (p *Parametric2Type) ExtensionName() string
ExtensionName incorporates the param in the name requiring different instances of Parametric2Type to be registered separately if they have different params. this is used for testing registration of different types with the same struct type.
func (*Parametric2Type) Serialize ¶
func (p *Parametric2Type) Serialize() string
Serialize returns the param as a 4 byte little endian slice
func (*Parametric2Type) String ¶
func (p *Parametric2Type) String() string
type SmallintArray ¶
type SmallintArray struct {
array.ExtensionArrayBase
}
SmallintArray is an int16 array
func (SmallintArray) ValueStr ¶
func (a SmallintArray) ValueStr(i int) string
type SmallintType ¶
type SmallintType struct {
arrow.ExtensionBase
}
func NewSmallintType ¶
func NewSmallintType() *SmallintType
func (SmallintType) ArrayType ¶
func (SmallintType) ArrayType() reflect.Type
func (SmallintType) Deserialize ¶
func (SmallintType) Deserialize(storageType arrow.DataType, data string) (arrow.ExtensionType, error)
func (*SmallintType) ExtensionEquals ¶
func (s *SmallintType) ExtensionEquals(other arrow.ExtensionType) bool
func (SmallintType) ExtensionName ¶
func (SmallintType) ExtensionName() string
func (SmallintType) Serialize ¶
func (SmallintType) Serialize() string
type UUIDArray ¶
type UUIDArray struct {
array.ExtensionArrayBase
}
UUIDArray is a simple array which is a FixedSizeBinary(16)
func (*UUIDArray) GetOneForMarshal ¶
func (*UUIDArray) MarshalJSON ¶
type UUIDBuilder ¶
type UUIDBuilder struct {
*array.ExtensionBuilder
}
func NewUUIDBuilder ¶
func NewUUIDBuilder(builder *array.ExtensionBuilder) *UUIDBuilder
func (*UUIDBuilder) Append ¶
func (b *UUIDBuilder) Append(v uuid.UUID)
func (*UUIDBuilder) AppendValueFromString ¶
func (b *UUIDBuilder) AppendValueFromString(s string) error
func (*UUIDBuilder) AppendValues ¶
func (b *UUIDBuilder) AppendValues(v []uuid.UUID, valid []bool)
func (*UUIDBuilder) UnmarshalJSON ¶
func (b *UUIDBuilder) UnmarshalJSON(data []byte) error
func (*UUIDBuilder) UnmarshalOne ¶
func (b *UUIDBuilder) UnmarshalOne(dec *json.Decoder) error
func (*UUIDBuilder) UnsafeAppend ¶
func (b *UUIDBuilder) UnsafeAppend(v uuid.UUID)
type UUIDType ¶
type UUIDType struct {
arrow.ExtensionBase
}
UUIDType is a simple extension type that represents a FixedSizeBinary(16) to be used for representing UUIDs
func NewUUIDType ¶
func NewUUIDType() *UUIDType
NewUUIDType is a convenience function to create an instance of UUIDType with the correct storage type
func (*UUIDType) Deserialize ¶
Deserialize expects storageType to be FixedSizeBinaryType{ByteWidth: 16} and the data to be "uuid-serialized" in order to correctly create a UUIDType for testing deserialize.
func (*UUIDType) ExtensionEquals ¶
func (e *UUIDType) ExtensionEquals(other arrow.ExtensionType) bool
ExtensionEquals returns true if both extensions have the same name
func (*UUIDType) ExtensionName ¶
func (*UUIDType) MarshalJSON ¶
func (*UUIDType) NewBuilder ¶
func (*UUIDType) NewBuilder(bldr *array.ExtensionBuilder) array.Builder