Documentation ¶
Overview ¶
Package bigtable implements a data source (backend) to allow dataux to query google bigtable
Index ¶
- Constants
- Variables
- func Mutation(fam string, vals []driver.Value, cols []string) *bigtable.Mutation
- type Mutator
- type ResultReader
- type ResultReaderNext
- type Source
- func (m *Source) Close() error
- func (m *Source) DataSource() schema.Source
- func (m *Source) Init()
- func (m *Source) Open(tableName string) (schema.Conn, error)
- func (m *Source) Setup(ss *schema.Schema) error
- func (m *Source) Table(table string) (*schema.Table, error)
- func (m *Source) Tables() []string
- type SqlToBT
- func (m *SqlToBT) CreateMutator(pc interface{}) (schema.ConnMutator, error)
- func (m *SqlToBT) Delete(key driver.Value) (int, error)
- func (m *SqlToBT) DeleteExpression(p interface{}, where expr.Node) (int, error)
- func (m *SqlToBT) Put(ctx context.Context, key schema.Key, val interface{}) (schema.Key, error)
- func (m *SqlToBT) PutMulti(ctx context.Context, keys []schema.Key, src interface{}) ([]schema.Key, error)
- func (m *SqlToBT) WalkExecSource(p *plan.Source) (exec.Task, error)
- func (m *SqlToBT) WalkSourceSelect(planner plan.Planner, p *plan.Source) (plan.Task, error)
Constants ¶
const (
DataSourceLabel = "bigtable"
)
Variables ¶
var ( ErrNoSchema = fmt.Errorf("No schema or configuration exists") SchemaRefreshInterval = time.Duration(time.Minute * 5) )
var ( // DefaultLimit for rows from bigtable DefaultLimit = 5000 // Timeout default Timeout = 10 * time.Second )
Functions ¶
Types ¶
type Mutator ¶
type Mutator struct {
// contains filtered or unexported fields
}
Mutator a bigtable mutator connection
type ResultReader ¶
type ResultReader struct { *exec.TaskBase Total int Req *SqlToBT // contains filtered or unexported fields }
ResultReader implements result paging, reading
func NewResultReader ¶
func NewResultReader(req *SqlToBT) *ResultReader
func (*ResultReader) Close ¶
func (m *ResultReader) Close() error
type ResultReaderNext ¶
type ResultReaderNext struct {
*ResultReader
}
A wrapper, allowing us to implement sql/driver Next() interface
which is different than qlbridge/datasource Next()
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source is a BigTable datasource, this provides Reads, Insert, Update, Delete - singleton shared instance - creates clients to bigtable (clients perform queries) - provides schema info about bigtable table/column-families
func (*Source) DataSource ¶
type SqlToBT ¶
SqlToBT Convert a Sql Query to a bigtable read/write rows - responsible for pushing down as much logic to bigtable as possible - dialect translator
func NewSqlToBT ¶
NewSqlToBT create a SQL ast -> BigTable Rows/Filters/Mutations converter
func (*SqlToBT) CreateMutator ¶
func (m *SqlToBT) CreateMutator(pc interface{}) (schema.ConnMutator, error)
CreateMutator part of Mutator interface to allow data sources create a stateful mutation context for update/delete operations.
func (*SqlToBT) DeleteExpression ¶
DeleteExpression - delete by expression (where clause) - For where columns contained in Partition Keys we can push to bigtable - for others we might have to do a select -> delete
func (*SqlToBT) PutMulti ¶
func (m *SqlToBT) PutMulti(ctx context.Context, keys []schema.Key, src interface{}) ([]schema.Key, error)
PutMulti write multiple rows.
func (*SqlToBT) WalkExecSource ¶
WalkExecSource an interface of executor that allows this source to create its own execution Task so that it can push down as much as it can to bigtable.