Documentation
¶
Index ¶
- func ArrayFromJSON(t *testing.T, mem memory.Allocator, dt arrow.DataType, json string) arrow.Array
- func CheckedClose(t *testing.T, obj io.Closer)
- func CheckedCloseWithContext(t *testing.T, obj CloserWithContext, ctx context.Context)
- func RecordFromJSON(t *testing.T, mem memory.Allocator, schema *arrow.Schema, json string) arrow.RecordBatch
- func StatisticsToLookupMap(stats []Statistic) map[int16]Statistic
- type CloserWithContext
- type Statistic
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArrayFromJSON ¶
ArrayFromJSON is the same as array.FromJSON, but fails the test on error.
func CheckedClose ¶
CheckedClose validates that a deferred Close call did not fail. See: https://github.com/stretchr/testify/issues/1067
func CheckedCloseWithContext ¶
func CheckedCloseWithContext(t *testing.T, obj CloserWithContext, ctx context.Context)
CheckedCloseWithContext validates that a deferred Close call did not fail. See: https://github.com/stretchr/testify/issues/1067
func RecordFromJSON ¶
func RecordFromJSON(t *testing.T, mem memory.Allocator, schema *arrow.Schema, json string) arrow.RecordBatch
RecordFromJSON is the same as array.RecordFromJSON, but fails the test on error.
func StatisticsToLookupMap ¶
StatisticsToLookupMap converts a slice of statistics (from ExtractStatisticsForTable) into a lookup map for easier test assertions. Returns a map from statistic key to the full Statistic struct.
Types ¶
type CloserWithContext ¶
type Statistic ¶
type Statistic struct {
ColumnName *string
StatisticKey int16
StatisticValue any
IsApproximate bool
}
Statistic represents a single statistic extracted from ADBC GetStatistics results.
func ExtractStatisticsForTable ¶
func ExtractStatisticsForTable(rec arrow.RecordBatch, catalog, schema, table string) []Statistic
ExtractStatisticsForTable extracts statistics for a specific table from GetStatistics result.
This helper navigates the nested ADBC GetStatistics schema:
catalog_name: string
catalog_db_schemas: list<struct{
db_schema_name: string
db_schema_statistics: list<struct{
table_name: string
column_name: string (nullable)
statistic_key: int16
statistic_value: dense_union<int64, uint64, float64, binary>
statistic_is_approximate: bool
}>
}>