BQ

gcp4zio.bq.BQ
See theBQ companion object
trait BQ

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class BQImpl

Members list

Value members

Abstract methods

def execute[T](f: BigQuery => T): Task[T]

Execute function with BigQuery as Input and return Generic o/p T

Execute function with BigQuery as Input and return Generic o/p T

Type parameters

T

Output

Value parameters

f

BigQuery => T

Attributes

def executeQuery(query: String): Task[Job]

Execute SQL query on BigQuery, this API does not returns any data. So it can be used to run any DML/DDL queries

Execute SQL query on BigQuery, this API does not returns any data. So it can be used to run any DML/DDL queries

Value parameters

query

SQL query(INSERT, CREATE) to execute

Attributes

def exportTable(sourceDataset: String, sourceTable: String, sourceProject: Option[String], targetPath: String, targetFormat: FileType, targetFileName: Option[String], targetCompressionType: String): Task[Unit]

Export data from BigQuery to GCS

Export data from BigQuery to GCS

Value parameters

sourceDataset

Source Dataset name

sourceProject

Source Google Project ID

sourceTable

Source Table name

targetCompressionType

Compression for destination files

targetFileName

Filename in case we want to create single file in target

targetFormat

File format for target GCS location

targetPath

Target GCS path

Attributes

def fetchResults[T](query: String)(fn: FieldValueList => T): Task[Iterable[T]]

This API can be used to run any SQL(SELECT) query on BigQuery to fetch rows

This API can be used to run any SQL(SELECT) query on BigQuery to fetch rows

Type parameters

T

Scala Type for output rows

Value parameters

fn

function to convert FieldValueList to Scala Type T

query

SQL query(SELECT) to execute

Attributes

def loadTable(sourcePath: String, sourceFormat: FileType, targetProject: Option[String], targetDataset: String, targetTable: String, writeDisposition: WriteDisposition, createDisposition: CreateDisposition, schema: Option[Schema]): Task[Map[String, Long]]

Load data into BigQuery from GCS

Load data into BigQuery from GCS

Value parameters

createDisposition

Create Disposition for table

schema

Schema for source files(Useful in case of CSV and JSON)

sourceFormat

File format of source data in GCS

sourcePath

Source GCS path from which we need to load data into BigQuery

targetDataset

Target Dataset name

targetProject

Target Google Project ID

targetTable

Target Table name

writeDisposition

Write Disposition for table

Attributes