types

package
v35.0.0-...-df5103f Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BOOLEAN       = BooleanType{}
	BYTE          = ByteType{}
	SHORT         = ShortType{}
	INTEGER       = IntegerType{}
	LONG          = LongType{}
	FLOAT         = FloatType{}
	DOUBLE        = DoubleType{}
	DATE          = DateType{}
	TIMESTAMP     = TimestampType{}
	TIMESTAMP_NTZ = TimestampNtzType{}
	STRING        = StringType{}
)
View Source
var BinaryNil = BinaryNilType{}
View Source
var BooleanNil = BooleanNilType{}
View Source
var Float32Nil = Float32NilType{}
View Source
var Float64Nil = Float64NilType{}
View Source
var Int16Nil = Int16NilType{}
View Source
var Int32Nil = Int32NilType{}
View Source
var Int64Nil = Int64NilType{}
View Source
var Int8Nil = Int8NilType{}
View Source
var IntNil = IntNilType{}
View Source
var StringNil = StringNilType{}

Functions

func ArrowSchemaToProto

func ArrowSchemaToProto(schema *arrow.Schema) proto.DataType_Struct

func ArrowTypeToProto

func ArrowTypeToProto(dataType arrow.DataType) *proto.DataType

func ReadArrowBatchToRecord

func ReadArrowBatchToRecord(data []byte, schema *StructType) (arrow.Record, error)

Types

type Binary

type Binary []byte

func (Binary) ToProto

func (t Binary) ToProto(ctx context.Context) (*proto.Expression, error)

type BinaryNilType

type BinaryNilType struct{}

func (BinaryNilType) ToProto

func (t BinaryNilType) ToProto(ctx context.Context) (*proto.Expression, error)

type BinaryType

type BinaryType struct{}

func (BinaryType) IsNumeric

func (t BinaryType) IsNumeric() bool

func (BinaryType) ToArrowType

func (t BinaryType) ToArrowType() arrow.DataType

func (BinaryType) TypeName

func (t BinaryType) TypeName() string

type Boolean

type Boolean bool

func (Boolean) ToProto

func (t Boolean) ToProto(ctx context.Context) (*proto.Expression, error)

type BooleanNilType

type BooleanNilType struct{}

func (BooleanNilType) ToProto

func (t BooleanNilType) ToProto(ctx context.Context) (*proto.Expression, error)

type BooleanType

type BooleanType struct{}

func (BooleanType) IsNumeric

func (t BooleanType) IsNumeric() bool

func (BooleanType) ToArrowType

func (t BooleanType) ToArrowType() arrow.DataType

func (BooleanType) TypeName

func (t BooleanType) TypeName() string

type ByteType

type ByteType struct{}

func (ByteType) IsNumeric

func (t ByteType) IsNumeric() bool

func (ByteType) ToArrowType

func (t ByteType) ToArrowType() arrow.DataType

func (ByteType) TypeName

func (t ByteType) TypeName() string

type DataType

type DataType interface {
	TypeName() string
	IsNumeric() bool
	ToArrowType() arrow.DataType
}

func ConvertProtoDataTypeToDataType

func ConvertProtoDataTypeToDataType(input *generated.DataType) DataType

ConvertProtoDataTypeToDataType converts protobuf data type to Spark connect sql data type

type DateType

type DateType struct{}

func (DateType) IsNumeric

func (t DateType) IsNumeric() bool

func (DateType) ToArrowType

func (t DateType) ToArrowType() arrow.DataType

func (DateType) TypeName

func (t DateType) TypeName() string

type DecimalType

type DecimalType struct {
	Precision int32
	Scale     int32
}

func (DecimalType) IsNumeric

func (t DecimalType) IsNumeric() bool

func (DecimalType) ToArrowType

func (t DecimalType) ToArrowType() arrow.DataType

func (DecimalType) TypeName

func (t DecimalType) TypeName() string

type DoubleType

type DoubleType struct{}

func (DoubleType) IsNumeric

func (t DoubleType) IsNumeric() bool

func (DoubleType) ToArrowType

func (t DoubleType) ToArrowType() arrow.DataType

func (DoubleType) TypeName

func (t DoubleType) TypeName() string

type Float32

type Float32 float32

func (Float32) ToProto

func (t Float32) ToProto(ctx context.Context) (*proto.Expression, error)

type Float32NilType

type Float32NilType struct{}

func (Float32NilType) ToProto

func (t Float32NilType) ToProto(ctx context.Context) (*proto.Expression, error)

type Float64

type Float64 float64

func (Float64) ToProto

func (t Float64) ToProto(ctx context.Context) (*proto.Expression, error)

type Float64NilType

type Float64NilType struct{}

func (Float64NilType) ToProto

func (t Float64NilType) ToProto(ctx context.Context) (*proto.Expression, error)

type FloatType

type FloatType struct{}

func (FloatType) IsNumeric

func (t FloatType) IsNumeric() bool

func (FloatType) ToArrowType

func (t FloatType) ToArrowType() arrow.DataType

func (FloatType) TypeName

func (t FloatType) TypeName() string

type Int

type Int int

func (Int) ToProto

func (t Int) ToProto(ctx context.Context) (*proto.Expression, error)

type Int16

type Int16 int16

func (Int16) ToProto

func (t Int16) ToProto(ctx context.Context) (*proto.Expression, error)

type Int16NilType

type Int16NilType struct{}

func (Int16NilType) ToProto

func (t Int16NilType) ToProto(ctx context.Context) (*proto.Expression, error)

type Int32

type Int32 int32

func (Int32) ToProto

func (t Int32) ToProto(ctx context.Context) (*proto.Expression, error)

type Int32NilType

type Int32NilType struct{}

func (Int32NilType) ToProto

func (t Int32NilType) ToProto(ctx context.Context) (*proto.Expression, error)

type Int64

type Int64 int64

func (Int64) ToProto

func (t Int64) ToProto(ctx context.Context) (*proto.Expression, error)

type Int64NilType

type Int64NilType struct{}

func (Int64NilType) ToProto

func (t Int64NilType) ToProto(ctx context.Context) (*proto.Expression, error)

type Int8

type Int8 int8

func (Int8) ToProto

func (t Int8) ToProto(ctx context.Context) (*proto.Expression, error)

type Int8NilType

type Int8NilType struct{}

func (Int8NilType) ToProto

func (t Int8NilType) ToProto(ctx context.Context) (*proto.Expression, error)

type IntNilType

type IntNilType struct{}

func (IntNilType) ToProto

func (t IntNilType) ToProto(ctx context.Context) (*proto.Expression, error)

type IntegerType

type IntegerType struct{}

func (IntegerType) IsNumeric

func (t IntegerType) IsNumeric() bool

func (IntegerType) ToArrowType

func (t IntegerType) ToArrowType() arrow.DataType

func (IntegerType) TypeName

func (t IntegerType) TypeName() string

type LiteralType

type LiteralType interface {
	ToProto(ctx context.Context) (*proto.Expression, error)
}

type LongType

type LongType struct{}

func (LongType) IsNumeric

func (t LongType) IsNumeric() bool

func (LongType) ToArrowType

func (t LongType) ToArrowType() arrow.DataType

func (LongType) TypeName

func (t LongType) TypeName() string

type NumericLiteral

type NumericLiteral interface {
	LiteralType
	// contains filtered or unexported methods
}

type PrimitiveTypeLiteral

type PrimitiveTypeLiteral interface {
	LiteralType
	// contains filtered or unexported methods
}

type Row

type Row interface {
	// At returns field's value at the given index within a [Row].
	// It returns nil for invalid indices.
	At(index int) any
	// Value returns field's value of the given column's name within a [Row].
	// It returns nil for invalid column's name.
	Value(name string) any
	// Values returns values of all fields within a [Row] as a slice of any.
	Values() []any
	// Len returns the number of fields within a [Row]
	Len() int
	FieldNames() []string
}

func ReadArrowTableToRows

func ReadArrowTableToRows(table arrow.Table) ([]Row, error)

type ShortType

type ShortType struct{}

func (ShortType) IsNumeric

func (t ShortType) IsNumeric() bool

func (ShortType) ToArrowType

func (t ShortType) ToArrowType() arrow.DataType

func (ShortType) TypeName

func (t ShortType) TypeName() string

type String

type String string

func (String) ToProto

func (t String) ToProto(ctx context.Context) (*proto.Expression, error)

type StringNilType

type StringNilType struct{}

func (StringNilType) ToProto

func (t StringNilType) ToProto(ctx context.Context) (*proto.Expression, error)

type StringType

type StringType struct{}

func (StringType) IsNumeric

func (t StringType) IsNumeric() bool

func (StringType) ToArrowType

func (t StringType) ToArrowType() arrow.DataType

func (StringType) TypeName

func (t StringType) TypeName() string

type StructField

type StructField struct {
	Name     string
	DataType DataType
	Nullable bool // default should be true
	Metadata *string
}

StructField represents a field in a StructType.

func ConvertProtoStructField

func ConvertProtoStructField(field *generated.DataType_StructField) StructField

func ConvertProtoStructFields

func ConvertProtoStructFields(input []*generated.DataType_StructField) []StructField

func NewStructField

func NewStructField(name string, dataType DataType) StructField

func (*StructField) ToArrowType

func (t *StructField) ToArrowType() arrow.Field

type StructType

type StructType struct {
	Fields []StructField
}

StructType represents a struct type.

func ConvertProtoDataTypeToStructType

func ConvertProtoDataTypeToStructType(input *generated.DataType) (*StructType, error)

func StructOf

func StructOf(fields ...StructField) *StructType

func (*StructType) IsNumeric

func (t *StructType) IsNumeric() bool

func (*StructType) ToArrowType

func (t *StructType) ToArrowType() *arrow.StructType

func (*StructType) TypeName

func (t *StructType) TypeName() string

type TimestampNtzType

type TimestampNtzType struct{}

func (TimestampNtzType) IsNumeric

func (t TimestampNtzType) IsNumeric() bool

func (TimestampNtzType) ToArrowType

func (t TimestampNtzType) ToArrowType() arrow.DataType

func (TimestampNtzType) TypeName

func (t TimestampNtzType) TypeName() string

type TimestampType

type TimestampType struct{}

func (TimestampType) IsNumeric

func (t TimestampType) IsNumeric() bool

func (TimestampType) ToArrowType

func (t TimestampType) ToArrowType() arrow.DataType

func (TimestampType) TypeName

func (t TimestampType) TypeName() string

type UnsupportedType

type UnsupportedType struct {
	TypeInfo any
}

func (UnsupportedType) IsNumeric

func (t UnsupportedType) IsNumeric() bool

func (UnsupportedType) ToArrowType

func (t UnsupportedType) ToArrowType() arrow.DataType

func (UnsupportedType) TypeName

func (t UnsupportedType) TypeName() string

Jump to

Keyboard shortcuts

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