bigquery

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

README

Google BigQuery Service

This service is google.golang.org/api/bigquery/v2.Service proxy

To check all supported method run

     endly -s='gcp/bigquery'

To check method contract run endly -s='gcp/bigquery' -a=methodName

    endly -s='gcp/bigquery' -a='datasetsList'

References:

Usage:
  1. Listing dataset
    endy -run='gcp/bigquery:datasetsList' projectID=myProject
    
  2. Query with destination table
    endy -r=query
    
    @query.yaml
    init:
      dataset: myDataset
    defaults:
      credentials: gc
    pipeline:
      query:
        action: gcp/bigquery:query
        query: SELECT * FROM mySourceTable
        allowlargeresults: false
        defaultdataset:
          projectid: ${gcp.projectID}
          datasetid: $dataset
        destinationtable:
          projectid: ${gcp.projectID}
          datasetid: $dataset
          tableid: myTable
        writedisposition: WRITE_APPEND
    
  3. Creating Materialize View
    endy -r=mv
    
    @mv.yaml
    pipeline:
      createMv:
        action: gcp/bigquery:tablesInsert
        kind: bigquery#table
        projectId: ${gcp.projectID}
        datasetId: myDataset
        table:
          tableReference:
            projectId: ${gcp.projectID}
            datasetId: myDataset
            tableId: myTable_mv
          materializedView:
            query: SELECT SUM(columnA) AS columnA, MIN(columnA) AS min_columnA FROM myTable
    

Documentation

Index

Constants

View Source
const (
	//ServiceID Google BigQuery Service ID.
	ServiceID = "gcp/bigquery"
)

Variables

This section is empty.

Functions

func InitRequest

func InitRequest(context *endly.Context, rawRequest map[string]interface{}) error

func New

func New() endly.Service

New creates a new BigQuery service.

Types

type CopyRequest added in v0.30.2

type CopyRequest struct {
	bigquery.JobConfigurationTableCopy
	Project string
	Job     *bigquery.JobReference
	Async   bool `description:"if set true, function does not wait for job completion"`
}

CopyRequest represents copy request

func (*CopyRequest) Validate added in v0.30.2

func (r *CopyRequest) Validate() error

Validate checks if request is valid

type CtxClient

type CtxClient struct {
	*gcp.AbstractClient
	// contains filtered or unexported fields
}

CtxClient represents context client

func GetClient

func GetClient(context *endly.Context) (*CtxClient, error)

func (*CtxClient) Service

func (s *CtxClient) Service() interface{}

func (*CtxClient) SetService

func (s *CtxClient) SetService(service interface{}) error

type JobWaitRequest added in v0.30.2

type JobWaitRequest struct {
	Job *bigquery.JobReference
}

func (*JobWaitRequest) Validate added in v0.30.2

func (r *JobWaitRequest) Validate() error

Validate checks if request is valid

type LoadRequest added in v0.30.2

type LoadRequest struct {
	bigquery.JobConfigurationLoad
	Job     *bigquery.JobReference
	Project string
	Async   bool `description:"if set true, function does not wait for job completion"`
}

LoadRequest represents load request

func (*LoadRequest) Validate added in v0.30.2

func (r *LoadRequest) Validate() error

Validate checks if request is valid

type QueryRequest added in v0.30.2

type QueryRequest struct {
	bigquery.JobConfigurationQuery
	Job     *bigquery.JobReference
	Project string
	Async   bool `description:"if set true, function does not wait for job completion"`
}

QueryRequest represents query request

func (*QueryRequest) Validate added in v0.30.2

func (r *QueryRequest) Validate() error

Validate checks if request is valid

Jump to

Keyboard shortcuts

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