Documentation ¶
Index ¶
- Constants
- Variables
- func AddToTaggedVals(tv TaggedValues, t types.Tuple) error
- func AreEqual(row1, row2 Row, sch schema.Schema) bool
- func CountCellDiffs(from, to types.Tuple) (uint64, error)
- func GetFieldByName(colName string, r Row, sch schema.Schema) (types.Value, bool)
- func GetFieldByNameWithDefault(colName string, defVal types.Value, r Row, sch schema.Schema) types.Value
- func GetInvalidCol(r Row, sch schema.Schema) (*schema.Column, error)
- func GetInvalidConstraint(r Row, sch schema.Schema) (*schema.Column, schema.ColConstraint, error)
- func IsEmpty(r Row) (b bool)
- func IsValid(r Row, sch schema.Schema) (bool, error)
- func IterDoltTuple(t types.Tuple, cb func(tag uint64, val types.Value) error) error
- func IterPkTuple(tvs types.TupleValueSlice, ...) error
- func ReduceToIndexKeysFromTagMap(nbf *types.NomsBinFormat, idx schema.Index, tagToVal map[uint64]types.Value, ...) (types.Tuple, types.Tuple, error)
- func ReduceToIndexPartialKey(idx schema.Index, r Row) (types.Tuple, error)
- func TaggedValsEqualForSch(tv, other TaggedValues, sch schema.Schema) bool
- func ToNoms(ctx context.Context, sch schema.Schema, r Row) (key, val types.Tuple, err error)
- type Row
- func FromNoms(sch schema.Schema, nomsKey, nomsVal types.Tuple) (Row, error)
- func KeylessRow(nbf *types.NomsBinFormat, vals ...types.Value) (Row, error)
- func KeylessRowsFromTuples(key, val types.Tuple) (Row, uint64, error)
- func New(nbf *types.NomsBinFormat, sch schema.Schema, colVals TaggedValues) (Row, error)
- type RowFormatFunc
- type TaggedValues
- func KeyAndTaggedValuesForRow(r Row, sch schema.Schema) (types.Tuple, TaggedValues, error)
- func ParseTaggedValues(tpl types.Tuple) (TaggedValues, error)
- func TaggedValuesFromTupleKeyAndValue(key, value types.Tuple) (TaggedValues, error)
- func TaggedValuesFromTupleValueSlice(vals types.TupleValueSlice) (TaggedValues, error)
- func (tt TaggedValues) Get(tag uint64) (types.Value, bool)
- func (tt TaggedValues) GetWithDefault(tag uint64, def types.Value) types.Value
- func (tt TaggedValues) Iter(cb func(tag uint64, val types.Value) (stop bool, err error)) (bool, error)
- func (tt TaggedValues) NomsTupleForNonPKCols(nbf *types.NomsBinFormat, nonPKCols *schema.ColCollection) TupleVals
- func (tt TaggedValues) NomsTupleForPKCols(nbf *types.NomsBinFormat, pkCols *schema.ColCollection) TupleVals
- func (tt TaggedValues) Set(tag uint64, val types.Value) TaggedValues
- func (tt TaggedValues) String() string
- func (tt TaggedValues) ToRow(ctx context.Context, nbf *types.NomsBinFormat, sch schema.Schema) (Row, error)
- type TupleFormatFunc
- type TupleVals
Constants ¶
const ( KeylessCardinalityTagIdx = uint64(0) KeylessCardinalityValIdx = uint64(1) KeylessFirstValIdx = uint64(2) )
Variables ¶
var ErrRowNotValid = errors.New("invalid row for current schema")
var ErrZeroCardinality = fmt.Errorf("read row with zero cardinality")
var Fmt = FieldSeparatedFmt(':')
var TupleFmt = FieldSeparatedTupleFmt(',')
Functions ¶
func AddToTaggedVals ¶
func AddToTaggedVals(tv TaggedValues, t types.Tuple) error
func CountCellDiffs ¶
CountCellDiffs returns the number of fields that are different between two tuples and does not panic if tuples are different lengths.
func GetFieldByName ¶
func GetInvalidCol ¶
GetInvalidCol returns the first column in the schema that fails a constraint, or nil if none do.
func GetInvalidConstraint ¶
GetInvalidConstraint returns the failed constraint for the row given (previously identified by IsValid) along with the column with that constraint. Note that if there is a problem with the row besides the constraint, the constraint return value will be nil.
func IsValid ¶
IsValid returns whether the row given matches the types and satisfies all the constraints of the schema given.
func IterDoltTuple ¶
func IterPkTuple ¶
func ReduceToIndexKeysFromTagMap ¶
func ReduceToIndexKeysFromTagMap(nbf *types.NomsBinFormat, idx schema.Index, tagToVal map[uint64]types.Value, tf *types.TupleFactory) (types.Tuple, types.Tuple, error)
ReduceToIndexKeysFromTagMap creates a full key and a partial key from the given map of tags (first tuple being the full key). Please refer to the note in the index editor for more information regarding partial keys.
func ReduceToIndexPartialKey ¶
ReduceToIndexPartialKey creates an index record from a primary storage record.
func TaggedValsEqualForSch ¶
func TaggedValsEqualForSch(tv, other TaggedValues, sch schema.Schema) bool
Types ¶
type Row ¶
type Row interface { // Iterates over all the columns in the row. Columns that have no value set will not be visited. IterCols(cb func(tag uint64, val types.Value) (stop bool, err error)) (bool, error) // Iterates over all columns in the schema, using the value for the row. Columns that have no value set in this row // will still be visited, and receive a nil value. IterSchema(sch schema.Schema, cb func(tag uint64, val types.Value) (stop bool, err error)) (bool, error) // Returns the value for the column with the tag given, and a success bool. The value will be null if the row // doesn't contain a value for that tag. GetColVal(tag uint64) (types.Value, bool) // Format returns the types.NomsBinFormat for this row. Format() *types.NomsBinFormat // SetColVal sets a value for the column with the tag given, returning a new row with the update. SetColVal(tag uint64, val types.Value, sch schema.Schema) (Row, error) // NomsMapKey returns the noms map key for this row, using the schema provided. NomsMapKey(sch schema.Schema) types.LesserValuable // NomsMapValue returns the noms map value for this row, using the schema provided. NomsMapValue(sch schema.Schema) types.Valuable // NomsMapKeyTuple returns the noms map key tuple for this row, using the schema provided NomsMapKeyTuple(sch schema.Schema, tf *types.TupleFactory) (types.Tuple, error) // NomsMapValueTuple returns the noms map value tuple for this row, using the schema provided. NomsMapValueTuple(sch schema.Schema, tf *types.TupleFactory) (types.Tuple, error) // TaggedValues returns the row as TaggedValues. TaggedValues() (TaggedValues, error) // ReduceToIndexKeys returns full and partial index keys ReduceToIndexKeys(idx schema.Index, tf *types.TupleFactory) (full types.Tuple, partial types.Tuple, value types.Tuple, err error) }
func KeylessRow ¶
func New ¶
func New(nbf *types.NomsBinFormat, sch schema.Schema, colVals TaggedValues) (Row, error)
type RowFormatFunc ¶
func FieldSeparatedFmt ¶
func FieldSeparatedFmt(delim rune) RowFormatFunc
type TaggedValues ¶
func ParseTaggedValues ¶
func ParseTaggedValues(tpl types.Tuple) (TaggedValues, error)
func TaggedValuesFromTupleKeyAndValue ¶
func TaggedValuesFromTupleKeyAndValue(key, value types.Tuple) (TaggedValues, error)
func TaggedValuesFromTupleValueSlice ¶
func TaggedValuesFromTupleValueSlice(vals types.TupleValueSlice) (TaggedValues, error)
func (TaggedValues) GetWithDefault ¶
func (TaggedValues) NomsTupleForNonPKCols ¶
func (tt TaggedValues) NomsTupleForNonPKCols(nbf *types.NomsBinFormat, nonPKCols *schema.ColCollection) TupleVals
func (TaggedValues) NomsTupleForPKCols ¶
func (tt TaggedValues) NomsTupleForPKCols(nbf *types.NomsBinFormat, pkCols *schema.ColCollection) TupleVals
func (TaggedValues) Set ¶
func (tt TaggedValues) Set(tag uint64, val types.Value) TaggedValues
func (TaggedValues) String ¶
func (tt TaggedValues) String() string
type TupleFormatFunc ¶
func FieldSeparatedTupleFmt ¶
func FieldSeparatedTupleFmt(delim rune) TupleFormatFunc