untyped

package
v0.40.4 Latest Latest
Warning

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

Go to latest
Published: May 19, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package untyped provides helper functions for working with untyped table data. Untyped tables treat all fields as strings

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRowFromStrings

func NewRowFromStrings(nbf *types.NomsBinFormat, sch schema.Schema, valStrs []string) (row.Row, error)

NewRowFromStrings is a utility method that takes a schema for an untyped row, and a slice of strings and uses the strings as the field values for the row by converting them to noms type.String

func NewRowFromTaggedStrings

func NewRowFromTaggedStrings(nbf *types.NomsBinFormat, sch schema.Schema, taggedStrs map[uint64]string) (row.Row, error)

NewRowFromTaggedStrings takes an untyped schema and a map of column tag to string value and returns a row

func NewUntypedSchema

func NewUntypedSchema(colNames ...string) (map[string]uint64, schema.Schema)

NewUntypedSchema takes an array of field names and returns a schema where the fields use the provided names, are of kind types.StringKind, and are not required.

func NewUntypedSchemaWithFirstTag

func NewUntypedSchemaWithFirstTag(firstTag uint64, colNames ...string) (map[string]uint64, schema.Schema)

func UnkeySchema

func UnkeySchema(sch schema.Schema) (schema.Schema, error)

UnkeySchema takes a schema and returns a schema with the same columns and types, but stripped of constraints and primary keys. Meant for use in result sets.

func UntypeSchema

func UntypeSchema(sch schema.Schema) (schema.Schema, error)

UntypeSchema takes a schema and returns a schema with the same columns, but with the types of each of those columns as types.StringKind

func UntypeUnkeySchema

func UntypeUnkeySchema(sch schema.Schema) (schema.Schema, error)

UntypeUnkeySchema takes a schema and returns a schema with the same columns, but stripped of constraints and primary keys and using only string types. Meant for displaying output and tests.

func UntypedSchemaUnion

func UntypedSchemaUnion(schemas ...schema.Schema) (schema.Schema, error)

UntypedSchemaUnion takes an arbitrary number of schemas and provides the union of all of their key and non-key columns. The columns will all be of type types.StringKind and and IsPartOfPK will be false for every column, and all of the columns will be in the schemas non-key ColumnCollection. Columns that share tags must have compatible types.

Types

This section is empty.

Directories

Path Synopsis
Package csv provides TableReadCloser and TableWriteCloser implementations for working with csvs.
Package csv provides TableReadCloser and TableWriteCloser implementations for working with csvs.
Package tabular provides writer implementations for working with tabular output for display
Package tabular provides writer implementations for working with tabular output for display

Jump to

Keyboard shortcuts

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