Documentation
¶
Index ¶
- Variables
- func ArrowBatchToProto(reader array.RecordReader, protoDescriptor *descriptorpb.DescriptorProto) [][]byte
- func ArrowRecordToProto(record arrow.Record, descriptorProto *descriptorpb.DescriptorProto) ([]byte, error)
- func ArrowRowToProto(record arrow.Record, descriptorProto *descriptorpb.DescriptorProto, ...) ([]byte, error)
- func ArrowSchemaToProto(schema *arrow.Schema) *descriptorpb.DescriptorProto
- func CreateArrowRecord() (array.RecordReader, error)
- func CreateNestedMessage(fieldType *arrow.StructType, messageName string) *descriptorpb.DescriptorProto
- func ExtractValue(col arrow.Array, rowIndex int) any
- func FormatArrowJSON(reader array.RecordReader, output io.Writer) error
- func GenerateUniqueName(prefix string) string
Constants ¶
This section is empty.
Variables ¶
var TypeMappings = map[arrow.DataType]descriptorpb.FieldDescriptorProto_Type{ arrow.BinaryTypes.Binary: descriptorpb.FieldDescriptorProto_TYPE_BYTES, arrow.FixedWidthTypes.Boolean: descriptorpb.FieldDescriptorProto_TYPE_BOOL, arrow.PrimitiveTypes.Float64: descriptorpb.FieldDescriptorProto_TYPE_DOUBLE, arrow.PrimitiveTypes.Int64: descriptorpb.FieldDescriptorProto_TYPE_INT64, arrow.BinaryTypes.String: descriptorpb.FieldDescriptorProto_TYPE_STRING, arrow.FixedWidthTypes.Date32: descriptorpb.FieldDescriptorProto_TYPE_STRING, arrow.FixedWidthTypes.Timestamp_s: descriptorpb.FieldDescriptorProto_TYPE_STRING, }
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
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
GenerateUniqueName creates a unique name for the ProtoBuf message.
Types ¶
This section is empty.