types

package
v0.0.0-...-bc21918 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2021 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 8 more Imports: 6 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

This section is empty.

Functions

This section is empty.

Types

type ExtStructArray

type ExtStructArray struct {
	array.ExtensionArrayBase
}

ExtStructArray is a struct array type for testing an extension type with non-primitive storage

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.

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.

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 UUIDArray

type UUIDArray struct {
	array.ExtensionArrayBase
}

UUIDArray is a simple array which is a FixedSizeBinary(16)

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 (u UUIDType) ExtensionEquals(other arrow.ExtensionType) bool

UuidTypes are equal if both are named "uuid"

func (UUIDType) ExtensionName

func (UUIDType) ExtensionName() string

func (UUIDType) Serialize

func (UUIDType) Serialize() string

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

Jump to

Keyboard shortcuts

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