schema

package
v0.0.0-...-45e1a9a Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

Functions

func AddRecordValue

func AddRecordValue(rowBuilder *parquet.RowBuilder, recordType *schema_pb.RecordType, parquetLevels *ParquetLevels, recordValue *schema_pb.RecordValue) error

func ListOf

func ListOf(elementType *schema_pb.Type) *schema_pb.Type

func StructToSchema

func StructToSchema(instance any) *schema_pb.RecordType

func ToParquetSchema

func ToParquetSchema(topicName string, recordType *schema_pb.RecordType) (*parquet.Schema, error)

func ToRecordValue

func ToRecordValue(recordType *schema_pb.RecordType, parquetLevels *ParquetLevels, row parquet.Row) (*schema_pb.RecordValue, error)

ToRecordValue converts a parquet.Row to a schema_pb.RecordValue This does not work or did not test with nested structures. Using this may fail to convert the parquet.Row to schema_pb.RecordValue

func ToValue

func ToValue(t *schema_pb.Type, levels *ParquetLevels, values []parquet.Value, valueIndex int) (value *schema_pb.Value, endValueIndex int, err error)

Types

type ParquetLevels

type ParquetLevels struct {
	// contains filtered or unexported fields
}

func ToParquetLevels

func ToParquetLevels(recordType *schema_pb.RecordType) (*ParquetLevels, error)

type RecordTypeBuilder

type RecordTypeBuilder struct {
	// contains filtered or unexported fields
}

func RecordTypeBegin

func RecordTypeBegin() *RecordTypeBuilder

func (*RecordTypeBuilder) RecordTypeEnd

func (rtb *RecordTypeBuilder) RecordTypeEnd() *schema_pb.RecordType

func (*RecordTypeBuilder) WithField

func (rtb *RecordTypeBuilder) WithField(name string, scalarType *schema_pb.Type) *RecordTypeBuilder

func (*RecordTypeBuilder) WithRecordField

func (rtb *RecordTypeBuilder) WithRecordField(name string, recordType *schema_pb.RecordType) *RecordTypeBuilder

type RecordValueBuilder

type RecordValueBuilder struct {
	// contains filtered or unexported fields
}

RecordValueBuilder helps in constructing RecordValue protobuf messages

func RecordBegin

func RecordBegin() *RecordValueBuilder

RecordBegin creates a new RecordValueBuilder instance

func (*RecordValueBuilder) RecordEnd

func (rvb *RecordValueBuilder) RecordEnd() *schema_pb.RecordValue

RecordEnd returns the constructed RecordValue message

func (*RecordValueBuilder) SetBool

func (rvb *RecordValueBuilder) SetBool(key string, value bool) *RecordValueBuilder

func (*RecordValueBuilder) SetBoolList

func (rvb *RecordValueBuilder) SetBoolList(key string, values ...bool) *RecordValueBuilder

func (*RecordValueBuilder) SetBytes

func (rvb *RecordValueBuilder) SetBytes(key string, value []byte) *RecordValueBuilder

func (*RecordValueBuilder) SetBytesList

func (rvb *RecordValueBuilder) SetBytesList(key string, values ...[]byte) *RecordValueBuilder

func (*RecordValueBuilder) SetDouble

func (rvb *RecordValueBuilder) SetDouble(key string, value float64) *RecordValueBuilder

func (*RecordValueBuilder) SetDoubleList

func (rvb *RecordValueBuilder) SetDoubleList(key string, values ...float64) *RecordValueBuilder

func (*RecordValueBuilder) SetFloat

func (rvb *RecordValueBuilder) SetFloat(key string, value float32) *RecordValueBuilder

func (*RecordValueBuilder) SetFloatList

func (rvb *RecordValueBuilder) SetFloatList(key string, values ...float32) *RecordValueBuilder

func (*RecordValueBuilder) SetInt32

func (rvb *RecordValueBuilder) SetInt32(key string, value int32) *RecordValueBuilder

func (*RecordValueBuilder) SetInt32List

func (rvb *RecordValueBuilder) SetInt32List(key string, values ...int32) *RecordValueBuilder

func (*RecordValueBuilder) SetInt64

func (rvb *RecordValueBuilder) SetInt64(key string, value int64) *RecordValueBuilder

func (*RecordValueBuilder) SetInt64List

func (rvb *RecordValueBuilder) SetInt64List(key string, values ...int64) *RecordValueBuilder

func (*RecordValueBuilder) SetRecord

func (rvb *RecordValueBuilder) SetRecord(key string, value *schema_pb.RecordValue) *RecordValueBuilder

func (*RecordValueBuilder) SetRecordList

func (rvb *RecordValueBuilder) SetRecordList(key string, values ...*schema_pb.RecordValue) *RecordValueBuilder

func (*RecordValueBuilder) SetString

func (rvb *RecordValueBuilder) SetString(key string, value string) *RecordValueBuilder

func (*RecordValueBuilder) SetStringList

func (rvb *RecordValueBuilder) SetStringList(key string, values ...string) *RecordValueBuilder

type Schema

type Schema struct {
	RecordType *schema_pb.RecordType
	// contains filtered or unexported fields
}

func NewSchema

func NewSchema(recordType *schema_pb.RecordType) (*Schema, error)

func (*Schema) GetField

func (s *Schema) GetField(name string) (*schema_pb.Field, bool)

Jump to

Keyboard shortcuts

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