block

package
v1.1.12 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Read

func Read(buffer []byte, desiredSchema typeof.Schema) (column.Columns, error)

Read decodes the block and selects the columns

Types

type Block

type Block struct {
	Size    int64          // The unencoded size of the block
	Key     nocopy.String  // The key of the block
	Columns nocopy.ByteMap // The encoded column metadata
	Data    nocopy.Bytes   // The set of columnar data
	Expires int64          // The expiration time for the block, in unix seconds
	// contains filtered or unexported fields
}

Block represents a serialized block

func FromBatchBy

func FromBatchBy(batch *talaria.Batch, partitionBy string, filter *typeof.Schema, computed ...column.Computed) ([]Block, error)

FromBatchBy creates a block from a talaria protobuf-encoded batch. It repartitions the batch by a given partition key at the same time.

func FromBuffer

func FromBuffer(b []byte) (block Block, err error)

FromBuffer unmarshals a block from a in-memory buffer.

func FromCSVBy added in v1.1.6

func FromCSVBy(input []byte, partitionBy string, filter *typeof.Schema, computed ...column.Computed) ([]Block, error)

FromCSVBy creates a block from a comma-separated file. It repartitions the batch by a given partition key at the same time.

func FromColumns

func FromColumns(key string, columns column.Columns) (blk Block, err error)

FromColumns creates a block from a set of presto named columns

func FromOrcBy

func FromOrcBy(payload []byte, partitionBy string, filter *typeof.Schema, computed ...column.Computed) ([]Block, error)

FromOrcBy decodes a set of blocks from an orc file and repartitions it by the specified partition key.

func FromRequestBy

func FromRequestBy(request *talaria.IngestRequest, partitionBy string, filter *typeof.Schema, computed ...column.Computed) ([]Block, error)

FromRequestBy creates a block from a talaria protobuf-encoded request. It repartitions the batch by a given partition key at the same time.

func FromURLBy added in v1.1.6

func FromURLBy(uri string, partitionBy string, filter *typeof.Schema, computed ...column.Computed) ([]Block, error)

FromURLBy creates a block from a remote url which should be loaded. It repartitions the batch by a given partition key at the same time.

func (*Block) Encode

func (b *Block) Encode() ([]byte, error)

Encode encodes the block as bytes

func (*Block) LastRow

func (b *Block) LastRow() (map[string]interface{}, error)

LastRow returns the last row of the block

func (*Block) Min

func (b *Block) Min(column string) (int64, bool)

Min selects the smallest value for a column (must be an integer or a bigint)

func (*Block) Schema

func (b *Block) Schema() typeof.Schema

Schema returns a schema of the block.

func (*Block) Select

func (b *Block) Select(columns typeof.Schema) (column.Columns, error)

Select selects a set of thrift columns

Jump to

Keyboard shortcuts

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