Documentation ¶
Overview ¶
package bigquery implements a data source (backend) to allow dataux to query google bigquery so that bigquery power is available via the pervasive mysql protocol.
Index ¶
- Constants
- Variables
- type Mutator
- type ResultReader
- type ResultReaderNext
- type RowVals
- 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 SqlToBQ
- func (m *SqlToBQ) CreateMutator(pc interface{}) (schema.ConnMutator, error)
- func (m *SqlToBQ) Delete(key driver.Value) (int, error)
- func (m *SqlToBQ) DeleteExpression(p interface{}, where expr.Node) (int, error)
- func (m *SqlToBQ) Put(ctx context.Context, key schema.Key, val interface{}) (schema.Key, error)
- func (m *SqlToBQ) PutMulti(ctx context.Context, keys []schema.Key, src interface{}) ([]schema.Key, error)
- func (m *SqlToBQ) WalkExecSource(p *plan.Source) (exec.Task, error)
- func (m *SqlToBQ) WalkSourceSelect(planner plan.Planner, p *plan.Source) (plan.Task, error)
Constants ¶
const (
// DataSourceLabel is public sourcetype for bigquery.
DataSourceLabel = "bigquery"
)
Variables ¶
var ( // ErrNoSchema is an error that no schema could be found. ErrNoSchema = fmt.Errorf("No schema or configuration exists") // SchemaRefreshInterval is time between checking for schema changes SchemaRefreshInterval = time.Duration(time.Minute * 5) )
var ( // DefaultLimit ie page-size defaut DefaultLimit = 5000 // Timeout default for BigQuery queries Timeout = 10 * time.Second )
Functions ¶
This section is empty.
Types ¶
type Mutator ¶
type Mutator struct {
// contains filtered or unexported fields
}
Mutator a bigquery mutator connection
type ResultReader ¶
type ResultReader struct { *exec.TaskBase Total int Req *SqlToBQ // contains filtered or unexported fields }
ResultReader implements result paging, reading
func NewResultReader ¶
func NewResultReader(req *SqlToBQ) *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 BigQuery datasource, this provides Reads, Insert, Update, Delete - singleton shared instance - creates clients to bigquery (clients perform queries) - provides schema info about bigquery table/column-families
func (*Source) DataSource ¶
type SqlToBQ ¶
SqlToBQ Convert a Sql Query to a bigquery read/write rows
- responsible for passing through query if possible, or rewrite if necessary
func NewSqlToBQ ¶
NewSqlToBQ create a SQL ast -> BigQuery Converter
func (*SqlToBQ) CreateMutator ¶
func (m *SqlToBQ) 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 (*SqlToBQ) 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 (*SqlToBQ) 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 bigquery.