bigquery

package
v0.0.0-...-7eb01b3 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const BigQuery string = "BigQuery"

Variables

View Source
var QList = map[string]string{
	"Movies count":                        "SELECT count(*) FROM `%s.%s`",
	"Movies count per year":               "SELECT count(*) FROM `%s.%s` WHERE year = \"2000\"",
	"Moives count grouped by year":        "SELECT year, count(movie_id) as ctn FROM `%s.%s` GROUP BY year ORDER BY count(movie_id) DESC",
	"display a movie info":                "SELECT name, year, rating, `desc` FROM `%s.%s` LIMIT 1",
	"the highest voting count":            "SELECT MAX(vote) FROM `%s.%s`",
	"Movie with the highest voting count": "TBI",
}

Functions

func CreateBqClient

func CreateBqClient(projectID string) *bq.Client

func CreateDataSet

func CreateDataSet(datasetName string, bqClinet *bq.Client)

func CreateTable

func CreateTable(datasetName string, tableName string, bqClinet *bq.Client)

func ImportParquet

func ImportParquet(projectID, datasetID, tableID string) error

func InsertIntoBq

func InsertIntoBq(datasetName string, tableName string, bqClinet *bq.Client, mvs []parser.Movie) error

func QueriesList

func QueriesList() []map[string]string

func ReadFromBq

func ReadFromBq(sqlText string, bqClinet *bq.Client) error

func ReadFromBqDryRun

func ReadFromBqDryRun(sqlText string, bqClinet *bq.Client) error

Types

type Query

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

Jump to

Keyboard shortcuts

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