types

package
v0.0.0-rc9 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToJSON

func ToJSON(d DataType) (string, error)

Types

type AliaseDataType

type AliaseDataType interface {
	Aliases() []string
}

type ArrayType

type ArrayType struct {
	ElementType  DataType
	ContainsNull bool
}

func (*ArrayType) Name

func (a *ArrayType) Name() string

type BinaryType

type BinaryType struct {
}

func (*BinaryType) Name

func (b *BinaryType) Name() string

type BooleanType

type BooleanType struct {
}

func (*BooleanType) Name

func (b *BooleanType) Name() string

type ByteType

type ByteType struct {
}

func (*ByteType) Aliases

func (b *ByteType) Aliases() []string

func (*ByteType) Name

func (b *ByteType) Name() string

type DataType

type DataType interface {
	Name() string
}

func FromJSON

func FromJSON(s string) (DataType, error)

type DateType

type DateType struct {
}

func (*DateType) Name

func (d *DateType) Name() string

type DecimalType

type DecimalType struct {
	Precision int `json:"precision,omitempty"`
	Scale     int `json:"scale,omitempty"`
}

func (*DecimalType) JSON

func (d *DecimalType) JSON() string

func (*DecimalType) Name

func (d *DecimalType) Name() string

type DoubleType

type DoubleType struct {
}

func (*DoubleType) Name

func (d *DoubleType) Name() string

type FloatType

type FloatType struct {
}

func (*FloatType) Aliases

func (f *FloatType) Aliases() []string

func (*FloatType) Name

func (f *FloatType) Name() string

type IntegerType

type IntegerType struct {
}

func (*IntegerType) Aliases

func (i *IntegerType) Aliases() []string

func (*IntegerType) Name

func (i *IntegerType) Name() string

type LongType

type LongType struct {
}

func (*LongType) Aliases

func (l *LongType) Aliases() []string

func (*LongType) Name

func (l *LongType) Name() string

type MapType

type MapType struct {
	KeyType           DataType
	ValueType         DataType
	ValueContainsNull bool
}

func (*MapType) Name

func (m *MapType) Name() string

type NullType

type NullType struct {
}

func (*NullType) Aliases

func (n *NullType) Aliases() []string

func (*NullType) Name

func (n *NullType) Name() string

type ShortType

type ShortType struct {
}

func (*ShortType) Aliases

func (s *ShortType) Aliases() []string

func (*ShortType) Name

func (s *ShortType) Name() string

type StringType

type StringType struct {
}

func (*StringType) Name

func (s *StringType) Name() string

type StructField

type StructField struct {
	Name     string
	DataType DataType
	Nullable bool

	// a map is used for metadata, be aware of all the numbers are marshalled as float64
	// Note: Java version only supports Long(array)/Double(array)/Bool(array)/String(array)/Map type, but we do not check them explicitly.
	Metadata map[string]interface{}
}

func NewStructField

func NewStructField(name string, t DataType, nullable bool) *StructField

type StructType

type StructType struct {
	Fields []*StructField
	// contains filtered or unexported fields
}

func NewStructType

func NewStructType(fields []*StructField) *StructType

func (*StructType) Add

func (s *StructType) Add(field *StructField) *StructType

func (*StructType) Add2

func (s *StructType) Add2(fieldName string, dt DataType) *StructType

func (*StructType) Add3

func (s *StructType) Add3(fieldName string, dt DataType, nullable bool) *StructType

func (*StructType) FieldNames

func (s *StructType) FieldNames() []string

func (*StructType) Get

func (s *StructType) Get(fieldName string) (*StructField, error)

func (*StructType) GetFields

func (s *StructType) GetFields() []*StructField

func (*StructType) Length

func (s *StructType) Length() int

func (*StructType) Name

func (s *StructType) Name() string

type TimestampType

type TimestampType struct {
}

func (*TimestampType) Name

func (t *TimestampType) Name() string

Jump to

Keyboard shortcuts

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