histogram

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TimePartitioning represents date-based partitioning.
	TimePartitioning = "date"

	// RangePartitioning represents range-based partitioning.
	RangePartitioning = "range"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type QueryConfig added in v0.3.0

type QueryConfig struct {
	// Query is the SQL Query to run.
	Query string

	// DateField is the field to use to determine which rows must be deleted
	// on a table update. It can be the same as partitionField, or different.
	DateField string

	// PartitionField is the field to use for date or range partitioning.
	PartitionField string

	// PartitionType is the type of partitioning to use (date or range).
	PartitionType string
}

type Table

type Table struct {
	bqiface.Table
	// contains filtered or unexported fields
}

Table represents a bigquery table containing histogram data. It embeds bigquery.Table and extends it with an UpdateHistogram method.

func NewTable

func NewTable(name string, ds string, config QueryConfig,
	client bqiface.Client) *Table

NewTable returns a new Table with the specified destination table, query and BQ client.

func (*Table) UpdateHistogram

func (t *Table) UpdateHistogram(ctx context.Context, start, end time.Time) error

UpdateHistogram generates the histogram data for the specified time range. If any data for this time range exists already, it's overwritten.

Jump to

Keyboard shortcuts

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