Documentation
ΒΆ
Index ΒΆ
- Variables
- type Cardinality
- type CustomField
- type FieldType
- type Opt
- type Option
- type Schema
- func (s *Schema[T]) Append(value T)
- func (s *Schema[T]) AppendWithCustom(value T, c ...any) error
- func (s *Schema[T]) Clone(mem memory.Allocator) (schema *Schema[T], err error)
- func (s *Schema[T]) FieldNames() []string
- func (s *Schema[T]) NewNormalizerRecord() arrow.Record
- func (s *Schema[T]) NewRecord() arrow.Record
- func (s *Schema[T]) NormalizerBuilder() *array.RecordBuilder
- func (s *Schema[T]) Parquet() *schema.Schema
- func (s *Schema[T]) Proto(r arrow.Record, rows []int) []T
- func (s *Schema[T]) ReadParquet(ctx context.Context, r parquet.ReaderAtSeeker, columns []int) (arrow.Record, error)
- func (s *Schema[T]) Release()
- func (s *Schema[T]) Schema() *arrow.Schema
- func (s *Schema[T]) WriteParquet(w io.Writer) error
- func (s *Schema[T]) WriteParquetRecords(w io.Writer, records ...arrow.Record) error
Constants ΒΆ
This section is empty.
Variables ΒΆ
var ErrMxDepth = errors.New("max depth reached, either the message is deeply nested or a circular dependency was introduced")
var ErrPathNotFound = errors.New("path not found")
Functions ΒΆ
This section is empty.
Types ΒΆ
type Cardinality ΒΆ added in v0.5.1
type Cardinality protoreflect.Cardinality
Cardinality determines whether a field is optional, required, or repeated.
const ( Optional Cardinality = 1 // appears zero or one times Required Cardinality = 2 // appears exactly one time; invalid with Proto3 Repeated Cardinality = 3 // appears zero or more times )
Constants as defined by the google.protobuf.Cardinality enumeration.
func (*Cardinality) Get ΒΆ added in v0.5.1
func (c *Cardinality) Get() protoreflect.Cardinality
type CustomField ΒΆ added in v0.5.1
type CustomField struct { Name string Type FieldType FieldCardinality Cardinality IsPacked bool }
type Option ΒΆ added in v0.5.0
type Option func(config)
func WithCustomFields ΒΆ added in v0.5.1
func WithCustomFields(c []CustomField) Option
WithCustomFields
func WithNormalizer ΒΆ added in v0.5.0
WithNormalizer configures the scalars to add to a flat Arrow Record suitable for efficient aggregation. Fields should be specified by their path (field names separated by a period ie. 'field1.field2.field3'). The Arrow field types of the selected fields will be used to build the new schema. If coaslescing data between multiple fields of the same type, specify only one of the paths. List fields should have an index to retrieve specified, otherwise defaults to all elements; ranges are not yet implemented. Current functionality is limited to valitating the fields/aliases match in `New()β, and `NormalizerBuilder()` returning an `*arrow.RecordBuilder` to be used externally to append data, and NewNormalizerRecord() to get an `arrow.Record` from the normalizer RecordBuilder. Future development may include Append methods that accept protopath operations to normalize protobuf messages in-flight internally to the package. failOnRangeError indicates whether to fail on a list[start:end] where end > len(list). TODO
type Schema ΒΆ
func (*Schema[T]) Append ΒΆ
func (s *Schema[T]) Append(value T)
Append appends protobuf value to the schema builder.This method is not safe for concurrent use.
func (*Schema[T]) AppendWithCustom ΒΆ added in v0.5.1
AppendWithCustom appends protobuf value and custom field values to the schema builder. This method is not safe for concurrent use.
func (*Schema[T]) FieldNames ΒΆ added in v0.3.0
FieldNames returns top-level field names
func (*Schema[T]) NewNormalizerRecord ΒΆ added in v0.5.0
NewNormalizerRecord returns buffered builder value as an arrow.Record. The builder is reset and can be reused to build new records.
func (*Schema[T]) NewRecord ΒΆ
NewRecord returns buffered builder value as an arrow.Record. The builder is reset and can be reused to build new records.
func (*Schema[T]) NormalizerBuilder ΒΆ added in v0.5.0
func (s *Schema[T]) NormalizerBuilder() *array.RecordBuilder
func (*Schema[T]) ReadParquet ΒΆ
func (s *Schema[T]) ReadParquet(ctx context.Context, r parquet.ReaderAtSeeker, columns []int) (arrow.Record, error)
ReadParquet specified columns from parquet source r and returns an Arrow record. The returned record must be released by the caller.
func (*Schema[T]) Release ΒΆ
func (s *Schema[T]) Release()
Release releases the reference on the message builder
func (*Schema[T]) WriteParquet ΒΆ
WriteParquet writes Parquet to an io.Writer