Documentation ¶
Index ¶
- Variables
- func ModifyKeylessCardinality(value Tuple, delta int64) (after uint64)
- func ReadKeylessCardinality(value Tuple) uint64
- type ByteSize
- type Encoding
- type OrdinalMapping
- type SlicedBuffer
- type Triple
- type Tuple
- type TupleBuilder
- func (tb *TupleBuilder) Build(pool pool.BuffPool) (tup Tuple)
- func (tb *TupleBuilder) BuildPermissive(pool pool.BuffPool) (tup Tuple)
- func (tb *TupleBuilder) PutBool(i int, v bool)
- func (tb *TupleBuilder) PutByteString(i int, v []byte)
- func (tb *TupleBuilder) PutDecimal(i int, v string)
- func (tb *TupleBuilder) PutFloat32(i int, v float32)
- func (tb *TupleBuilder) PutFloat64(i int, v float64)
- func (tb *TupleBuilder) PutGeometry(i int, v []byte)
- func (tb *TupleBuilder) PutInt16(i int, v int16)
- func (tb *TupleBuilder) PutInt32(i int, v int32)
- func (tb *TupleBuilder) PutInt64(i int, v int64)
- func (tb *TupleBuilder) PutInt8(i int, v int8)
- func (tb *TupleBuilder) PutJSON(i int, v []byte)
- func (tb *TupleBuilder) PutRaw(i int, buf []byte)
- func (tb *TupleBuilder) PutSqlTime(i int, v string)
- func (tb *TupleBuilder) PutString(i int, v string)
- func (tb *TupleBuilder) PutTimestamp(i int, v time.Time)
- func (tb *TupleBuilder) PutUint16(i int, v uint16)
- func (tb *TupleBuilder) PutUint32(i int, v uint32)
- func (tb *TupleBuilder) PutUint64(i int, v uint64)
- func (tb *TupleBuilder) PutUint8(i int, v uint8)
- func (tb *TupleBuilder) PutYear(i int, v int16)
- func (tb *TupleBuilder) Recycle()
- type TupleComparator
- type TupleDesc
- func (td TupleDesc) Comparator() TupleComparator
- func (td TupleDesc) Compare(left, right Tuple) (cmp int)
- func (td TupleDesc) CompareField(value []byte, i int, tup Tuple) (cmp int)
- func (td TupleDesc) Count() int
- func (td TupleDesc) Equals(other TupleDesc) bool
- func (td TupleDesc) Format(tup Tuple) string
- func (td TupleDesc) FormatValue(i int, value []byte) string
- func (td TupleDesc) GetBool(i int, tup Tuple) (v bool, ok bool)
- func (td TupleDesc) GetBytes(i int, tup Tuple) (v []byte, ok bool)
- func (td TupleDesc) GetDecimal(i int, tup Tuple) (v string, ok bool)
- func (td TupleDesc) GetField(i int, tup Tuple) []byte
- func (td TupleDesc) GetFloat32(i int, tup Tuple) (v float32, ok bool)
- func (td TupleDesc) GetFloat64(i int, tup Tuple) (v float64, ok bool)
- func (td TupleDesc) GetGeometry(i int, tup Tuple) (v []byte, ok bool)
- func (td TupleDesc) GetInt16(i int, tup Tuple) (v int16, ok bool)
- func (td TupleDesc) GetInt32(i int, tup Tuple) (v int32, ok bool)
- func (td TupleDesc) GetInt64(i int, tup Tuple) (v int64, ok bool)
- func (td TupleDesc) GetInt8(i int, tup Tuple) (v int8, ok bool)
- func (td TupleDesc) GetJSON(i int, tup Tuple) (v []byte, ok bool)
- func (td TupleDesc) GetSqlTime(i int, tup Tuple) (v string, ok bool)
- func (td TupleDesc) GetString(i int, tup Tuple) (v string, ok bool)
- func (td TupleDesc) GetTimestamp(i int, tup Tuple) (v time.Time, ok bool)
- func (td TupleDesc) GetUint16(i int, tup Tuple) (v uint16, ok bool)
- func (td TupleDesc) GetUint32(i int, tup Tuple) (v uint32, ok bool)
- func (td TupleDesc) GetUint64(i int, tup Tuple) (v uint64, ok bool)
- func (td TupleDesc) GetUint8(i int, tup Tuple) (v uint8, ok bool)
- func (td TupleDesc) GetYear(i int, tup Tuple) (v int16, ok bool)
- func (td TupleDesc) IsNull(i int, tup Tuple) bool
- type Type
Constants ¶
This section is empty.
Variables ¶
var EmptyTuple = Tuple([]byte{0, 0})
var KeylessCardType = Type{ Enc: Uint64Enc, Nullable: false, }
var KeylessTupleDesc = TupleDesc{ Types: []Type{{Enc: Hash128Enc, Nullable: false}}, // contains filtered or unexported fields }
Functions ¶
func ReadKeylessCardinality ¶
Types ¶
type Encoding ¶
type Encoding uint8
const ( NullEnc Encoding = 0 Int8Enc Encoding = 1 Uint8Enc Encoding = 2 Int16Enc Encoding = 3 Uint16Enc Encoding = 4 Int32Enc Encoding = 7 Uint32Enc Encoding = 8 Int64Enc Encoding = 9 Uint64Enc Encoding = 10 Float32Enc Encoding = 11 Float64Enc Encoding = 12 // todo(andy): experimental encodings TimestampEnc Encoding = 14 DateEnc Encoding = 15 DatetimeEnc Encoding = 16 YearEnc Encoding = 17 Hash128Enc Encoding = 18 )
Constant Size Encodings
type OrdinalMapping ¶
type OrdinalMapping []int
OrdinalMapping is a mapping from one field ordering to another. It's used to construct index tuples from another index's tuples.
func (OrdinalMapping) MapOrdinal ¶
func (om OrdinalMapping) MapOrdinal(to int) (from int)
type SlicedBuffer ¶
type SlicedBuffer struct { Buf []byte Offs offsets }
func (SlicedBuffer) GetSlice ¶
func (sb SlicedBuffer) GetSlice(i int) []byte
GetSlice returns the ith slice of |sb.Buf|.
func (SlicedBuffer) Len ¶
func (sb SlicedBuffer) Len() int
type Tuple ¶
type Tuple []byte
func (Tuple) FieldIsNull ¶
type TupleBuilder ¶
type TupleBuilder struct { Desc TupleDesc // contains filtered or unexported fields }
func NewTupleBuilder ¶
func NewTupleBuilder(desc TupleDesc) *TupleBuilder
func (*TupleBuilder) Build ¶
func (tb *TupleBuilder) Build(pool pool.BuffPool) (tup Tuple)
Build materializes a Tuple from the fields written to the TupleBuilder.
func (*TupleBuilder) BuildPermissive ¶
func (tb *TupleBuilder) BuildPermissive(pool pool.BuffPool) (tup Tuple)
BuildPermissive materializes a Tuple from the fields written to the TupleBuilder without validating nullability.
func (*TupleBuilder) PutBool ¶
func (tb *TupleBuilder) PutBool(i int, v bool)
PutBool writes a bool to the ith field of the Tuple being built.
func (*TupleBuilder) PutByteString ¶
func (tb *TupleBuilder) PutByteString(i int, v []byte)
PutByteString writes a []byte to the ith field of the Tuple being built.
func (*TupleBuilder) PutDecimal ¶
func (tb *TupleBuilder) PutDecimal(i int, v string)
func (*TupleBuilder) PutFloat32 ¶
func (tb *TupleBuilder) PutFloat32(i int, v float32)
PutFloat32 writes a float32 to the ith field of the Tuple being built.
func (*TupleBuilder) PutFloat64 ¶
func (tb *TupleBuilder) PutFloat64(i int, v float64)
PutFloat64 writes a float64 to the ith field of the Tuple being built.
func (*TupleBuilder) PutGeometry ¶
func (tb *TupleBuilder) PutGeometry(i int, v []byte)
PutGeometry writes a []byte to the ith field of the Tuple being built.
func (*TupleBuilder) PutInt16 ¶
func (tb *TupleBuilder) PutInt16(i int, v int16)
PutInt16 writes an int16 to the ith field of the Tuple being built.
func (*TupleBuilder) PutInt32 ¶
func (tb *TupleBuilder) PutInt32(i int, v int32)
PutInt32 writes an int32 to the ith field of the Tuple being built.
func (*TupleBuilder) PutInt64 ¶
func (tb *TupleBuilder) PutInt64(i int, v int64)
PutInt64 writes an int64 to the ith field of the Tuple being built.
func (*TupleBuilder) PutInt8 ¶
func (tb *TupleBuilder) PutInt8(i int, v int8)
PutInt8 writes an int8 to the ith field of the Tuple being built.
func (*TupleBuilder) PutJSON ¶
func (tb *TupleBuilder) PutJSON(i int, v []byte)
PutJSON writes a []byte to the ith field of the Tuple being built.
func (*TupleBuilder) PutRaw ¶
func (tb *TupleBuilder) PutRaw(i int, buf []byte)
PutRaw writes a []byte to the ith field of the Tuple being built.
func (*TupleBuilder) PutSqlTime ¶
func (tb *TupleBuilder) PutSqlTime(i int, v string)
PutSqlTime writes a string to the ith field of the Tuple being built.
func (*TupleBuilder) PutString ¶
func (tb *TupleBuilder) PutString(i int, v string)
PutString writes a string to the ith field of the Tuple being built.
func (*TupleBuilder) PutTimestamp ¶
func (tb *TupleBuilder) PutTimestamp(i int, v time.Time)
func (*TupleBuilder) PutUint16 ¶
func (tb *TupleBuilder) PutUint16(i int, v uint16)
PutUint16 writes a uint16 to the ith field of the Tuple being built.
func (*TupleBuilder) PutUint32 ¶
func (tb *TupleBuilder) PutUint32(i int, v uint32)
PutUint32 writes a uint32 to the ith field of the Tuple being built.
func (*TupleBuilder) PutUint64 ¶
func (tb *TupleBuilder) PutUint64(i int, v uint64)
PutUint64 writes a uint64 to the ith field of the Tuple being built.
func (*TupleBuilder) PutUint8 ¶
func (tb *TupleBuilder) PutUint8(i int, v uint8)
PutUint8 writes a uint8 to the ith field of the Tuple being built.
func (*TupleBuilder) PutYear ¶
func (tb *TupleBuilder) PutYear(i int, v int16)
PutYear writes an int16-encoded year to the ith field of the Tuple being built.
func (*TupleBuilder) Recycle ¶
func (tb *TupleBuilder) Recycle()
Recycle resets the TupleBuilder so it can build a new Tuple.
type TupleComparator ¶
type TupleComparator interface { // Compare compares pairs of Tuples. Compare(left, right Tuple, desc TupleDesc) int // CompareValues compares pairs of values. CompareValues(left, right []byte, typ Type) int }
TupleComparator compares Tuples.
type TupleDesc ¶
type TupleDesc struct { Types []Type // contains filtered or unexported fields }
TupleDesc describes a Tuple set. Data structures that contain Tuples and algorithms that process Tuples use a TupleDesc's types to interpret the fields of a Tuple.
func NewTupleDescriptor ¶
NewTupleDescriptor makes a TupleDescriptor from |types|.
func NewTupleDescriptorWithComparator ¶
func NewTupleDescriptorWithComparator(cmp TupleComparator, types ...Type) (td TupleDesc)
NewTupleDescriptorWithComparator returns a TupleDesc from a slice of Types.
func (TupleDesc) Comparator ¶
func (td TupleDesc) Comparator() TupleComparator
Comparator returns the TupleDescriptor's TupleComparator.
func (TupleDesc) CompareField ¶
CompareField compares |value| with the ith field of |tup|.
func (TupleDesc) GetBool ¶
GetBool reads a bool from the ith field of the Tuple. If the ith field is NULL, |ok| is set to false.
func (TupleDesc) GetBytes ¶
GetBytes reads a []byte from the ith field of the Tuple. If the ith field is NULL, |ok| is set to false.
func (TupleDesc) GetDecimal ¶
GetDecimal reads a float64 from the ith field of the Tuple. If the ith field is NULL, |ok| is set to false.
func (TupleDesc) GetFloat32 ¶
GetFloat32 reads a float32 from the ith field of the Tuple. If the ith field is NULL, |ok| is set to false.
func (TupleDesc) GetFloat64 ¶
GetFloat64 reads a float64 from the ith field of the Tuple. If the ith field is NULL, |ok| is set to false.
func (TupleDesc) GetGeometry ¶
GetGeometry reads a []byte from the ith field of the Tuple. If the ith field is NULL, |ok| is set to false.
func (TupleDesc) GetInt16 ¶
GetInt16 reads an int16 from the ith field of the Tuple. If the ith field is NULL, |ok| is set to false.
func (TupleDesc) GetInt32 ¶
GetInt32 reads an int32 from the ith field of the Tuple. If the ith field is NULL, |ok| is set to false.
func (TupleDesc) GetInt64 ¶
GetInt64 reads an int64 from the ith field of the Tuple. If the ith field is NULL, |ok| is set to false.
func (TupleDesc) GetInt8 ¶
GetInt8 reads an int8 from the ith field of the Tuple. If the ith field is NULL, |ok| is set to false.
func (TupleDesc) GetJSON ¶
GetJSON reads a []byte from the ith field of the Tuple. If the ith field is NULL, |ok| is set to false.
func (TupleDesc) GetSqlTime ¶
GetSqlTime reads a string encoded Time value from the ith field of the Tuple. If the ith field is NULL, |ok| is set to false.
func (TupleDesc) GetString ¶
GetString reads a string from the ith field of the Tuple. If the ith field is NULL, |ok| is set to false.
func (TupleDesc) GetTimestamp ¶
GetTimestamp reads a time.Time from the ith field of the Tuple. If the ith field is NULL, |ok| is set to false.
func (TupleDesc) GetUint16 ¶
GetUint16 reads a uint16 from the ith field of the Tuple. If the ith field is NULL, |ok| is set to false.
func (TupleDesc) GetUint32 ¶
GetUint32 reads a uint32 from the ith field of the Tuple. If the ith field is NULL, |ok| is set to false.
func (TupleDesc) GetUint64 ¶
GetUint64 reads a uint64 from the ith field of the Tuple. If the ith field is NULL, |ok| is set to false.
func (TupleDesc) GetUint8 ¶
GetUint8 reads a uint8 from the ith field of the Tuple. If the ith field is NULL, |ok| is set to false.