arrowtest

package
v3.6.7 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package arrowtest provides utilities for testing Arrow records.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Row

type Row map[string]any

Row represents a single record row as a map of column name to value.

type Rows

type Rows []Row

Rows is a slice of Row.

func RecordRows

func RecordRows(rec arrow.Record) (Rows, error)

RecordRows converts an arrow.Record into Rows for comparison in tests. RecordRows requires all columns in the record to have a unique name.

All values are converted to their direct Go equivalents.

Callers building expected Rows must use the same functions.

func TableRows

func TableRows(alloc memory.Allocator, table arrow.Table) (Rows, error)

TableRows concatenates all chunks of the arrow.Table into a single arrow.Record, and then returns it as Rows. TableRows requires all columns in the table to have a unique name.

See RecordRows for specifies on how values are converted into Go values for a Row.

func (Rows) Record

func (rows Rows) Record(alloc memory.Allocator, schema *arrow.Schema) arrow.Record

Record converts rows into an arrow.Record with the provided schema. A schema can be inferred from rows by using Rows.Schema.

The returned record must be Release()'d after use.

Record panics if schema references a column not found in one of the rows.

func (Rows) Schema

func (rows Rows) Schema() *arrow.Schema

Schema inferrs a arrow.Schema from each row in Rows. Columns in rows are sorted alphabetically.

Schema panics if any of the following conditions are true:

- A value cannot be converted into an Arrow data type. - Two rows have different sets of columns. - Two columns do not have the same Go type across rows.

Jump to

Keyboard shortcuts

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