Documentation ¶
Overview ¶
Package extensions provides implementations of Arrow canonical extension types as defined in the Arrow specification. https://arrow.apache.org/docs/format/CanonicalExtensions.html
Index ¶
- type Bool8Array
- type Bool8Builder
- func (b *Bool8Builder) Append(v bool)
- func (b *Bool8Builder) AppendValueFromString(s string) error
- func (b *Bool8Builder) AppendValues(v []bool, valid []bool)
- func (b *Bool8Builder) Unmarshal(dec *json.Decoder) error
- func (b *Bool8Builder) UnmarshalOne(dec *json.Decoder) error
- func (b *Bool8Builder) UnsafeAppend(v bool)
- type Bool8Type
- func (b *Bool8Type) ArrayType() reflect.Type
- func (b *Bool8Type) Deserialize(storageType arrow.DataType, data string) (arrow.ExtensionType, error)
- func (b *Bool8Type) ExtensionEquals(other arrow.ExtensionType) bool
- func (b *Bool8Type) ExtensionName() string
- func (*Bool8Type) NewBuilder(mem memory.Allocator) array.Builder
- func (b *Bool8Type) Serialize() string
- func (b *Bool8Type) String() string
- type JSONArray
- func (a *JSONArray) GetOneForMarshal(i int) interface{}
- func (a *JSONArray) MarshalJSON() ([]byte, error)
- func (a *JSONArray) String() string
- func (a *JSONArray) Value(i int) any
- func (a *JSONArray) ValueBytes(i int) []byte
- func (a *JSONArray) ValueJSON(i int) json.RawMessage
- func (a *JSONArray) ValueStr(i int) string
- type JSONType
- func (b *JSONType) ArrayType() reflect.Type
- func (b *JSONType) Deserialize(storageType arrow.DataType, data string) (arrow.ExtensionType, error)
- func (b *JSONType) ExtensionEquals(other arrow.ExtensionType) bool
- func (b *JSONType) ExtensionName() string
- func (b *JSONType) ParquetLogicalType() schema.LogicalType
- func (b *JSONType) Serialize() string
- func (b *JSONType) String() string
- type OpaqueArray
- type OpaqueType
- func (*OpaqueType) ArrayType() reflect.Type
- func (*OpaqueType) Deserialize(storageType arrow.DataType, data string) (arrow.ExtensionType, error)
- func (o *OpaqueType) ExtensionEquals(other arrow.ExtensionType) bool
- func (*OpaqueType) ExtensionName() string
- func (o *OpaqueType) Serialize() string
- func (o *OpaqueType) String() string
- type UUIDArray
- type UUIDBuilder
- func (b *UUIDBuilder) Append(v uuid.UUID)
- func (b *UUIDBuilder) AppendBytes(v [16]byte)
- 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) BitWidth() int
- func (*UUIDType) Bytes() int
- 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(mem memory.Allocator) array.Builder
- func (e *UUIDType) ParquetLogicalType() schema.LogicalType
- func (*UUIDType) Serialize() string
- func (e *UUIDType) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bool8Array ¶
type Bool8Array struct {
array.ExtensionArrayBase
}
Bool8Array is logically an array of boolean values but uses 8 bits to store values instead of 1 bit as in the native BooleanArray.
func (*Bool8Array) BoolValues ¶
func (a *Bool8Array) BoolValues() []bool
func (*Bool8Array) GetOneForMarshal ¶
func (a *Bool8Array) GetOneForMarshal(i int) interface{}
func (*Bool8Array) MarshalJSON ¶
func (a *Bool8Array) MarshalJSON() ([]byte, error)
func (*Bool8Array) String ¶
func (a *Bool8Array) String() string
func (*Bool8Array) Value ¶
func (a *Bool8Array) Value(i int) bool
func (*Bool8Array) ValueStr ¶
func (a *Bool8Array) ValueStr(i int) string
type Bool8Builder ¶
type Bool8Builder struct {
*array.ExtensionBuilder
}
Bool8Builder is a convenience builder for the Bool8 extension type, allowing arrays to be built with boolean values rather than the underlying storage type.
func NewBool8Builder ¶
func NewBool8Builder(mem memory.Allocator) *Bool8Builder
NewBool8Builder creates a new Bool8Builder, exposing a convenient and efficient interface for writing boolean values to the underlying int8 storage array.
func (*Bool8Builder) Append ¶
func (b *Bool8Builder) Append(v bool)
func (*Bool8Builder) AppendValueFromString ¶
func (b *Bool8Builder) AppendValueFromString(s string) error
func (*Bool8Builder) AppendValues ¶
func (b *Bool8Builder) AppendValues(v []bool, valid []bool)
func (*Bool8Builder) UnmarshalOne ¶
func (b *Bool8Builder) UnmarshalOne(dec *json.Decoder) error
func (*Bool8Builder) UnsafeAppend ¶
func (b *Bool8Builder) UnsafeAppend(v bool)
type Bool8Type ¶
type Bool8Type struct {
arrow.ExtensionBase
}
Bool8Type represents a logical boolean that is stored using 8 bits.
func NewBool8Type ¶
func NewBool8Type() *Bool8Type
NewBool8Type creates a new Bool8Type with the underlying storage type set correctly to Int8.
func (*Bool8Type) Deserialize ¶
func (*Bool8Type) ExtensionEquals ¶
func (b *Bool8Type) ExtensionEquals(other arrow.ExtensionType) bool
func (*Bool8Type) ExtensionName ¶
type JSONArray ¶
type JSONArray struct {
array.ExtensionArrayBase
}
JSONArray is logically an array of UTF-8 encoded JSON strings. Its values are unmarshaled to native Go values.
func (*JSONArray) GetOneForMarshal ¶
GetOneForMarshal implements arrow.Array.
func (*JSONArray) MarshalJSON ¶
MarshalJSON implements json.Marshaler. Marshaling json.RawMessage is a no-op, except that nil values will be marshaled as a JSON null.
func (*JSONArray) ValueBytes ¶
type JSONType ¶
type JSONType struct {
arrow.ExtensionBase
}
JSONType represents a UTF-8 encoded JSON string as specified in RFC8259.
func NewJSONType ¶
NewJSONType creates a new JSONType with the specified storage type. storageType must be one of String, LargeString, StringView.
func (*JSONType) Deserialize ¶
func (*JSONType) ExtensionEquals ¶
func (b *JSONType) ExtensionEquals(other arrow.ExtensionType) bool
func (*JSONType) ExtensionName ¶
func (*JSONType) ParquetLogicalType ¶
func (b *JSONType) ParquetLogicalType() schema.LogicalType
ParquetLogicalType implements pqarrow.ExtensionCustomParquetType.
type OpaqueArray ¶
type OpaqueArray struct {
array.ExtensionArrayBase
}
OpaqueArray is a placeholder for data from an external (usually non-Arrow) system that could not be interpreted.
type OpaqueType ¶
type OpaqueType struct { arrow.ExtensionBase `json:"-"` TypeName string `json:"type_name"` VendorName string `json:"vendor_name"` }
OpaqueType is a placeholder for a type from an external (usually non-Arrow) system that could not be interpreted.
func NewOpaqueType ¶
func NewOpaqueType(storageType arrow.DataType, name, vendorName string) *OpaqueType
NewOpaqueType creates a new OpaqueType with the provided storage type, type name, and vendor name.
func (*OpaqueType) ArrayType ¶
func (*OpaqueType) ArrayType() reflect.Type
func (*OpaqueType) Deserialize ¶
func (*OpaqueType) Deserialize(storageType arrow.DataType, data string) (arrow.ExtensionType, error)
func (*OpaqueType) ExtensionEquals ¶
func (o *OpaqueType) ExtensionEquals(other arrow.ExtensionType) bool
func (*OpaqueType) ExtensionName ¶
func (*OpaqueType) ExtensionName() string
func (*OpaqueType) Serialize ¶
func (o *OpaqueType) Serialize() string
func (*OpaqueType) String ¶
func (o *OpaqueType) String() 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(mem memory.Allocator) *UUIDBuilder
NewUUIDBuilder creates a new UUIDBuilder, exposing a convenient and efficient interface for writing uuid.UUID (or [16]byte) values to the underlying FixedSizeBinary storage array.
func (*UUIDBuilder) Append ¶
func (b *UUIDBuilder) Append(v uuid.UUID)
func (*UUIDBuilder) AppendBytes ¶
func (b *UUIDBuilder) AppendBytes(v [16]byte)
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}
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) ParquetLogicalType ¶
func (e *UUIDType) ParquetLogicalType() schema.LogicalType
ParquetLogicalType implements pqarrow.ExtensionCustomParquetType.