arrowpb

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: MIT Imports: 11 Imported by: 0

README

arrowpb

Convert Apache Arrow records to Protocol Buffers

Go Report Card Build Status

Introduction

arrowpb is a library designed to facilitate the conversion of Apache Arrow records into Protocol Buffers format. This allows for efficient serialization and deserialization of data structures, making it easier to work with data across different systems.

Feature

  • Convert Arrow records to Protocol Buffers and vice versa.
  • High performance and low memory overhead.
  • Easy integration with existing Arrow and Protocol Buffers projects.

Author

arrowpb is developed by @TFMV.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Documentation

Index

Constants

This section is empty.

Variables

TypeMappings maps Apache Arrow types to Protocol Buffers field types.

Functions

func ArrowBatchToProto added in v0.2.0

func ArrowBatchToProto(reader array.RecordReader, protoDescriptor *descriptorpb.DescriptorProto) [][]byte

ArrowBatchToProto converts an Arrow RecordReader into serialized ProtoBuf messages.

func ArrowRecordToProto added in v0.2.0

func ArrowRecordToProto(record arrow.Record, descriptorProto *descriptorpb.DescriptorProto) ([]byte, error)

ArrowRecordToProto converts an Arrow RecordBatch into serialized ProtoBuf messages.

func ArrowRowToProto added in v0.2.0

func ArrowRowToProto(record arrow.Record, descriptorProto *descriptorpb.DescriptorProto, rowIndex int) ([]byte, error)

ArrowRowToProto converts a single row in an Arrow RecordBatch to a Protobuf message.

func ArrowSchemaToProto added in v0.2.0

func ArrowSchemaToProto(schema *arrow.Schema) *descriptorpb.DescriptorProto

ArrowSchemaToProto converts an Arrow schema into a Protocol Buffers descriptor.

func CreateArrowRecord added in v0.2.0

func CreateArrowRecord() (array.RecordReader, error)

CreateArrowRecord creates a sample Arrow RecordBatch for testing.

func CreateNestedMessage added in v0.2.0

func CreateNestedMessage(fieldType *arrow.StructType, messageName string) *descriptorpb.DescriptorProto

CreateNestedMessage constructs a nested ProtoBuf message descriptor.

func ExtractValue added in v0.2.0

func ExtractValue(col arrow.Array, rowIndex int) any

ExtractValue retrieves a value from an Arrow column at a specific row index.

func FormatArrowJSON

func FormatArrowJSON(reader array.RecordReader, output io.Writer) error

FormatArrowJSON formats Arrow records as pretty-printed JSON.

func GenerateUniqueName added in v0.2.0

func GenerateUniqueName(prefix string) string

GenerateUniqueName creates a unique name for the ProtoBuf message.

Types

This section is empty.

Jump to

Keyboard shortcuts

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