types

package
v2.3.5 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: MPL-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExtensionTypes = struct {
	UUID arrow.ExtensionType
	Inet arrow.ExtensionType
	Mac  arrow.ExtensionType
	JSON arrow.ExtensionType
}{
	UUID: NewUUIDType(),
	Inet: NewInetType(),
	Mac:  NewMacType(),
	JSON: NewJSONType(),
}
View Source
var UUID = NewUUIDType()

Functions

This section is empty.

Types

type InetArray

type InetArray struct {
	array.ExtensionArrayBase
}

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

func (*InetArray) GetOneForMarshal

func (a *InetArray) GetOneForMarshal(i int) any

func (InetArray) String

func (a InetArray) String() string

func (*InetArray) ValueStr added in v2.0.1

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

type InetBuilder

type InetBuilder struct {
	*array.ExtensionBuilder
}

func NewInetBuilder

func NewInetBuilder(bldr *array.ExtensionBuilder) *InetBuilder

func (*InetBuilder) Append

func (b *InetBuilder) Append(v net.IPNet)

func (*InetBuilder) AppendValueFromString added in v2.0.1

func (b *InetBuilder) AppendValueFromString(s string) error

func (*InetBuilder) AppendValues

func (b *InetBuilder) AppendValues(v []net.IPNet, valid []bool)

func (*InetBuilder) Unmarshal

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

func (*InetBuilder) UnmarshalJSON

func (b *InetBuilder) UnmarshalJSON(data []byte) error

func (*InetBuilder) UnmarshalOne

func (b *InetBuilder) UnmarshalOne(dec *json.Decoder) error

func (*InetBuilder) UnsafeAppend

func (b *InetBuilder) UnsafeAppend(v net.IPNet)

type InetType

type InetType struct {
	arrow.ExtensionBase
}

InetType is a simple extension type that represents a StringType to be used for representing IP Addresses and CIDRs

func NewInetType

func NewInetType() *InetType

NewInetType is a convenience function to create an instance of InetType with the correct storage type

func (InetType) ArrayType

func (InetType) ArrayType() reflect.Type

func (InetType) Deserialize

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

Deserialize expects storageType to be StringType and the data to be "inet-serialized" in order to correctly create a InetType for testing deserialize.

func (InetType) ExtensionEquals

func (u InetType) ExtensionEquals(other arrow.ExtensionType) bool

InetType are equal if both are named "inet"

func (InetType) ExtensionName

func (InetType) ExtensionName() string

func (InetType) NewBuilder

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

func (InetType) Serialize

func (InetType) Serialize() string

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

type JSONArray

type JSONArray struct {
	array.ExtensionArrayBase
}

JSONArray is a simple array which is a Binary

func (*JSONArray) GetOneForMarshal

func (a *JSONArray) GetOneForMarshal(i int) any

func (*JSONArray) MarshalJSON

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

func (JSONArray) String

func (a JSONArray) String() string

func (*JSONArray) ValueStr added in v2.0.1

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

type JSONBuilder

type JSONBuilder struct {
	*array.ExtensionBuilder
}

func NewJSONBuilder

func NewJSONBuilder(bldr *array.ExtensionBuilder) *JSONBuilder

func (*JSONBuilder) Append

func (b *JSONBuilder) Append(v any)

func (*JSONBuilder) AppendValueFromString added in v2.0.1

func (b *JSONBuilder) AppendValueFromString(s string) error

func (*JSONBuilder) AppendValues

func (b *JSONBuilder) AppendValues(v []any, valid []bool)

func (*JSONBuilder) UnmarshalJSON

func (b *JSONBuilder) UnmarshalJSON(data []byte) error

func (*JSONBuilder) UnmarshalOne

func (b *JSONBuilder) UnmarshalOne(dec *json.Decoder) error

func (*JSONBuilder) UnsafeAppend

func (b *JSONBuilder) UnsafeAppend(v any)

type JSONType

type JSONType struct {
	arrow.ExtensionBase
}

JSONType is a simple extension type that represents a BinaryType to be used for representing JSONs

func NewJSONType

func NewJSONType() *JSONType

NewJSONType is a convenience function to create an instance of JSONType with the correct storage type

func (JSONType) ArrayType

func (JSONType) ArrayType() reflect.Type

ArrayType returns TypeOf(JSONType) for constructing JSON arrays

func (JSONType) Deserialize

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

Deserialize expects storageType to be BinaryBuilder and the data to be "json-serialized" in order to correctly create a JSONType for testing deserialize.

func (JSONType) ExtensionEquals

func (e JSONType) ExtensionEquals(other arrow.ExtensionType) bool

ExtensionEquals returns true if both extensions have the same name

func (JSONType) ExtensionName

func (JSONType) ExtensionName() string

func (JSONType) MarshalJSON

func (e JSONType) MarshalJSON() ([]byte, error)

func (JSONType) NewBuilder

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

func (JSONType) Serialize

func (JSONType) Serialize() string

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

func (JSONType) String

func (e JSONType) String() string

type MacArray

type MacArray struct {
	array.ExtensionArrayBase
}

MacArray is a simple array which is a wrapper around a BinaryArray

func (*MacArray) GetOneForMarshal

func (a *MacArray) GetOneForMarshal(i int) any

func (*MacArray) MarshalJSON

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

func (MacArray) String

func (a MacArray) String() string

func (*MacArray) ValueStr added in v2.0.1

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

type MacBuilder

type MacBuilder struct {
	*array.ExtensionBuilder
}

func NewMacBuilder

func NewMacBuilder(bldr *array.ExtensionBuilder) *MacBuilder

func (*MacBuilder) Append

func (b *MacBuilder) Append(v net.HardwareAddr)

func (*MacBuilder) AppendValueFromString added in v2.0.1

func (b *MacBuilder) AppendValueFromString(s string) error

func (*MacBuilder) AppendValues

func (b *MacBuilder) AppendValues(v []net.HardwareAddr, valid []bool)

func (*MacBuilder) Unmarshal

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

func (*MacBuilder) UnmarshalJSON

func (b *MacBuilder) UnmarshalJSON(data []byte) error

func (*MacBuilder) UnmarshalOne

func (b *MacBuilder) UnmarshalOne(dec *json.Decoder) error

func (*MacBuilder) UnsafeAppend

func (b *MacBuilder) UnsafeAppend(v net.HardwareAddr)

type MacType

type MacType struct {
	arrow.ExtensionBase
}

MacType is a simple extension type that represents a BinaryType to be used for representing mac addresses.

func NewMacType

func NewMacType() *MacType

NewMacType is a convenience function to create an instance of MacType with the correct storage type

func (MacType) ArrayType

func (MacType) ArrayType() reflect.Type

ArrayType returns TypeOf(MacArray) for constructing mac arrays

func (MacType) Deserialize

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

Deserialize expects storageType to be FixedSizeBinaryType{ByteWidth: 16} and the data to be "mac-serialized" in order to correctly create a MacType for testing deserialize.

func (MacType) ExtensionEquals

func (u MacType) ExtensionEquals(other arrow.ExtensionType) bool

MacTypes are equal if both are named "mac"

func (MacType) ExtensionName

func (MacType) ExtensionName() string

func (MacType) NewBuilder

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

func (MacType) Serialize

func (MacType) Serialize() string

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

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

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 added in v2.0.1

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

type UUIDBuilder

type UUIDBuilder struct {
	*array.ExtensionBuilder
}

func NewUUIDBuilder

func NewUUIDBuilder(bldr *array.ExtensionBuilder) *UUIDBuilder

func (*UUIDBuilder) Append

func (b *UUIDBuilder) Append(v uuid.UUID)

func (*UUIDBuilder) AppendValueFromString added in v2.0.1

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

UuidTypes are equal if both are named "uuid"

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