types

package
v15.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 7 more Imports: 10 Imported by: 0

Documentation

Overview

Package types contains user-defined types for use in the tests for the arrow package

Index

Constants

This section is empty.

Variables

View Source
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 (a *UUIDArray) GetOneForMarshal(i int) interface{}

func (*UUIDArray) MarshalJSON

func (a *UUIDArray) MarshalJSON() ([]byte, error)

func (*UUIDArray) String

func (a *UUIDArray) String() string

func (*UUIDArray) Value

func (a *UUIDArray) Value(i int) uuid.UUID

func (*UUIDArray) ValueStr

func (a *UUIDArray) ValueStr(i int) string

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) Unmarshal

func (b *UUIDBuilder) Unmarshal(dec *json.Decoder) error

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) ArrayType

func (*UUIDType) ArrayType() reflect.Type

ArrayType returns TypeOf(UUIDArray{}) for constructing UUID arrays

func (*UUIDType) Deserialize

func (*UUIDType) Deserialize(storageType arrow.DataType, data string) (arrow.ExtensionType, error)

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) ExtensionName() string

func (*UUIDType) MarshalJSON

func (e *UUIDType) MarshalJSON() ([]byte, error)

func (*UUIDType) NewBuilder

func (*UUIDType) NewBuilder(bldr *array.ExtensionBuilder) array.Builder

func (*UUIDType) Serialize

func (*UUIDType) Serialize() string

Serialize returns "uuid-serialized" for testing proper metadata passing

func (*UUIDType) String

func (e *UUIDType) String() string

Jump to

Keyboard shortcuts

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