soliton

package
v0.0.0-...-eed5818 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InitialCapacity = 32
	ZeroCapacity    = 0
)

Capacity constants.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	// contains filtered or unexported fields
}

Column stores one column of data in Apache Arrow format. See https://arrow.apache.org/docs/memory_layout.html

func NewColumn

func NewColumn(ft *types.FieldType, cap int) *Column

NewColumn creates a new column with the specific length and capacity.

func (*Column) AppendDuration

func (c *Column) AppendDuration(dur types.Duration)

AppendDuration appends a duration value into this Column.

func (*Column) AppendJSON

func (c *Column) AppendJSON(j json.BinaryJSON)

AppendJSON appends a BinaryJSON value into this Column.

func (*Column) AppendMyDecimal

func (c *Column) AppendMyDecimal(dec *types.MyDecimal)

AppendMyDecimal appends a MyDecimal value into this Column.

func (*Column) AppendSet

func (c *Column) AppendSet(set types.Set)

AppendSet appends a Set value into this Column.

func (*Column) CopyConstruct

func (c *Column) CopyConstruct(dst *Column) *Column

CopyConstruct copies this Column to dst. If dst is nil, it creates a new Column and returns it.

func (*Column) IsNull

func (c *Column) IsNull(rowIdx int) bool

IsNull returns if this row is null.

func (*Column) Reset

func (c *Column) Reset(eType types.EvalType)

Reset resets this Column according to the EvalType. Different from reset, Reset will reset the elemBuf.

type Row

type Row struct {
	// contains filtered or unexported fields
}

Row represents a row of data, can be used to access values.

func (Row) GetBytes

func (r Row) GetBytes(colIdx int) []byte

GetBytes returns the bytes value with the colIdx.

func (Row) GetDatum

func (r Row) GetDatum(colIdx int, tp *types.FieldType) types.Datum

GetDatum implements the soliton.Row interface.

func (Row) GetDatumRow

func (r Row) GetDatumRow(fields []*types.FieldType) []types.Datum

GetDatumRow converts soliton.Row to types.DatumRow. Keep in mind that GetDatumRow has a reference to r.c, which is a soliton, this function works only if the underlying soliton is valid or unchanged.

func (Row) GetDuration

func (r Row) GetDuration(colIdx int, fillFsp int) types.Duration

GetDuration returns the Duration value with the colIdx.

func (Row) GetEnum

func (r Row) GetEnum(colIdx int) types.Enum

GetEnum returns the Enum value with the colIdx.

func (Row) GetFloat32

func (r Row) GetFloat32(colIdx int) float32

GetFloat32 returns the float32 value with the colIdx.

func (Row) GetFloat64

func (r Row) GetFloat64(colIdx int) float64

GetFloat64 returns the float64 value with the colIdx.

func (Row) GetInt64

func (r Row) GetInt64(colIdx int) int64

GetInt64 returns the int64 value with the colIdx.

func (Row) GetJSON

func (r Row) GetJSON(colIdx int) json.BinaryJSON

GetJSON returns the JSON value with the colIdx.

func (Row) GetMyDecimal

func (r Row) GetMyDecimal(colIdx int) *types.MyDecimal

GetMyDecimal returns the MyDecimal value with the colIdx.

func (Row) GetSet

func (r Row) GetSet(colIdx int) types.Set

GetSet returns the Set value with the colIdx.

func (Row) GetString

func (r Row) GetString(colIdx int) string

GetString returns the string value with the colIdx.

func (Row) GetTime

func (r Row) GetTime(colIdx int) types.Time

GetTime returns the Time value with the colIdx.

func (Row) GetUint64

func (r Row) GetUint64(colIdx int) uint64

GetUint64 returns the uint64 value with the colIdx.

func (Row) Idx

func (r Row) Idx() int

Idx returns the row index of Soliton.

func (Row) IsEmpty

func (r Row) IsEmpty() bool

IsEmpty returns true if the Row is empty.

func (Row) Len

func (r Row) Len() int

Len returns the number of values in the row.

func (Row) Soliton

func (r Row) Soliton() *Soliton

Soliton returns the Soliton which the row belongs to.

type Soliton

type Soliton struct {
	// contains filtered or unexported fields
}

Soliton stores multiple rows of data in Apache Arrow format. See https://arrow.apache.org/docs/memory_layout.html Values are appended in compact format and can be directly accessed without decoding. When the soliton is done processing, we can reuse the allocated memory by resetting it.

func New

func New(fields []*types.FieldType, cap, maxSolitonsize int) *Soliton

New creates a new soliton.

cap: the limit for the max number of rows.
maxSolitonsize: the max limit for the number of rows.

func NewSolitonWithCapacity

func NewSolitonWithCapacity(fields []*types.FieldType, cap int) *Soliton

NewSolitonWithCapacity creates a new soliton with field types and capacity.

func Renew

func Renew(chk *Soliton, maxSolitonsize int) *Soliton

Renew creates a new Soliton based on an existing Soliton. The newly created Soliton has the same data schema with the old Soliton. The capacity of the new Soliton might be doubled based on the capacity of the old Soliton and the maxSolitonsize.

chk: old soliton(often used in previous call).
maxSolitonsize: the limit for the max number of rows.

Jump to

Keyboard shortcuts

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