query

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BigqueryExecutor

type BigqueryExecutor struct {
	// contains filtered or unexported fields
}

BigqueryExecutor to execute query in bigquery data warehouse

func NewBigqueryExecutor

func NewBigqueryExecutor(client bqiface.Client,
	store protocol.BigqueryJobStore,
	profileStore protocol.ProfileStore,
	statsFactory stats.ClientBuilder) *BigqueryExecutor

NewBigqueryExecutor constructor of BigqueryExecutor

func (*BigqueryExecutor) Run

func (qe *BigqueryExecutor) Run(profile *job.Profile, query string, queryType job.QueryType) ([]protocol.Row, error)

Run executes query and log the bigquery job progress and information to a storage

type SQLExpressionFactory

type SQLExpressionFactory struct {
	// contains filtered or unexported fields
}

SQLExpressionFactory create custom SQL expression

func NewSQLExpressionFactory

func NewSQLExpressionFactory(metadataStore protocol.MetadataStore) *SQLExpressionFactory

func (*SQLExpressionFactory) CreatePartitionExpression

func (p *SQLExpressionFactory) CreatePartitionExpression(urn string) (string, error)

CreatePartitionExpression create sql expression of __PARTITION__ macros that used on profile group only supported table with DATE and TIMESTAMP field partition or default _PARTITIONTIME partition field Here is the example of generated expression: When the data type is DATE

  • time partitioning DAY date_column
  • time partitioning MONTH DATE_TRUNC(date_column, MONTH)
  • time partitioning YEAR DATE_TRUNC(date_column, YEAR)

* time partitioning HOUR is not supported

When the data type is TIMESTAMP

  • time partitioning DAY DATE(ts_column, "UTC")
  • timepartioning HOUR TIMESTAMP_TRUNC(ts_column, HOUR, "UTC")
  • timepartitioning MONTH DATE_TRUNC(DATE(ts_column, "UTC"),MONTH)
  • timepartitioning YEAR DATE_TRUNC(DATE(ts_column, "UTC"),YEAR)

Jump to

Keyboard shortcuts

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