Documentation ¶
Index ¶
- func ParseModel(row map[string]bigquery.Value, model interface{}) (interface{}, error)
- type TableInfo
- type TableUtil
- func (util *TableUtil) Dedup(src string, overwrite bool, ...)
- func (util *TableUtil) DedupInPlace(src string)
- func (util *TableUtil) DestinationQuery(query string, dest *bigquery.Table) *bigquery.Query
- func (util *TableUtil) GetInfoMatching(dataset, filter string) []TableInfo
- func (util *TableUtil) GetTableStats(table string) bigquery.TableMetadata
- func (util *TableUtil) QueryAndParse(q string, model interface{}) (interface{}, error)
- func (util *TableUtil) ResultQuery(query string, dryRun bool) *bigquery.Query
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type TableInfo ¶
type TableInfo struct { Name string IsPartitioned bool NumBytes int64 NumRows uint64 CreationTime time.Time LastModifiedTime time.Time }
TableInfo contains the critical stats for a specific table or partition.
type TableUtil ¶
TableUtil provides utility functions on tables in a dataset. It encapsulates the client and Dataset to simplify methoDataset. TODO(gfr) Should this be called DatasetUtil ?
func NewTableUtil ¶
NewTableUtil creates a TableUtil for a project. httpClient is used to inject mocks for the bigquery client. if nil, a suitable default client is used.
func (*TableUtil) Dedup ¶
func (util *TableUtil) Dedup(src string, overwrite bool, DatasettProject, DatasettDataset, DatasettTable string)
Dedup executes a query that dedups and writes to an appropriate partition.
func (*TableUtil) DedupInPlace ¶
DedupInPlace executes a query that dedups a table. TODO interpret and return status.
func (*TableUtil) DestinationQuery ¶
DestinationQuery constructs a query with common Config settings for writing results to a table. Generally, may need to change WriteDisposition.
func (*TableUtil) GetInfoMatching ¶
GetInfoMatching finDataset all tables matching table filter. and collects the basic stats about each of them. Returns slice ordered by decreasing age.
func (*TableUtil) GetTableStats ¶
func (util *TableUtil) GetTableStats(table string) bigquery.TableMetadata
GetTableStats fetches the Metadata for a table. TODO(gfr) Is this worth having, or is it non-idiomatic?
func (*TableUtil) QueryAndParse ¶
QueryAndParse executes a query that should return a single row, with column labels matching the qfields tags in the provided model struct.