package bigquery
Main package for BigQuery APIs. Import all.
import com.spotify.scio.bigquery._
There are two BigQuery dialects,
legacy and
standard. APIs that take a
BigQuery query string as argument, e.g. com.spotify.scio.bigquery.client.BigQuery.query.rows,
com.spotify.scio.bigquery.client.BigQuery.query.schema,
com.spotify.scio.bigquery.client.BigQuery.getTypedRows and
BigQueryType.fromQuery, automatically
detects the query's dialect. To override this, start the query with either #legacysql
or
#standardsql
comment line.
- Alphabetic
- By Inheritance
- bigquery
- CoderInstances
- TableReferenceSyntax
- TableRowSyntax
- SCollectionSyntax
- ScioContextSyntax
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Package Members
Type Members
- sealed trait BigQueryIO[T] extends ScioIO[T]
- final case class BigQuerySelect(sqlQuery: Query) extends BigQueryIO[TableRow] with Product with Serializable
Get an SCollection for a BigQuery SELECT query.
Get an SCollection for a BigQuery SELECT query. Both Legacy SQL and Standard SQL dialects are supported. By default the query dialect will be automatically detected. To override this behavior, start the query string with
#legacysql
or#standardsql
. - final case class BigQueryStorage(table: Table, selectedFields: List[String], rowRestriction: Option[String]) extends BigQueryIO[TableRow] with Product with Serializable
Get an IO for a BigQuery table using the storage API.
- final case class BigQueryStorageSelect(sqlQuery: Query) extends BigQueryIO[TableRow] with Product with Serializable
- final case class BigQueryStorageTap(table: Table, readOptions: TableReadOptions) extends Tap[TableRow] with Product with Serializable
Tap for BigQuery tables using storage api.
- type BigQueryTag = bigquery.types.BigQueryTag
BigQuery tag for macro generated classes/fields.
- final case class BigQueryTap(table: TableReference) extends Tap[TableRow] with Product with Serializable
Tap for BigQuery tables.
- final case class BigQueryTaps(self: Taps) extends Product with Serializable
- final case class BigQueryTypedSelect[T](reader: TypedRead[T], sqlQuery: Query, fromTableRow: (TableRow) => T)(implicit evidence$1: Coder[T]) extends BigQueryIO[T] with Product with Serializable
- final case class BigQueryTypedTable[T](reader: TypedRead[T], writer: Write[T], table: Table, fn: (GenericRecord, TableSchema) => T)(implicit evidence$5: Coder[T]) extends BigQueryIO[T] with Product with Serializable
- final case class BigQueryTypedTap[T](table: Table, fn: (GenericRecord, TableSchema) => T)(implicit evidence$1: Coder[T]) extends Tap[T] with Product with Serializable
- sealed trait ExtendedErrorInfo extends AnyRef
- class MockBigQuery extends AnyRef
Mock BigQuery environment for integration test.
Mock BigQuery environment for integration test.
Use mockTable to feed data into live BigQuery service and queryResult to query them.
- class MockTable extends AnyRef
A BigQuery table being mocked for test.
- final case class Query(underlying: String) extends Source with Product with Serializable
A wrapper type Query which wraps a SQL String.
- sealed trait Source extends AnyRef
- sealed trait Table extends Source
Table abstracts the multiple ways of referencing Bigquery tables.
Table abstracts the multiple ways of referencing Bigquery tables. Tables can be referenced by a table spec
String
or by a table reference GTableReference.Example:
val table = Table.Spec("bigquery-public-data:samples.shakespeare") sc.bigQueryTable(table) .filter(r => "hamlet".equals(r.getString("corpus")) && "Polonius".equals(r.getString("word"))) .saveAsTextFile("./output.txt") sc.run()
Or create a Table from a GTableReference:
val tableReference = new TableReference tableReference.setProjectId("bigquery-public-data") tableReference.setDatasetId("samples") tableReference.setTableId("shakespeare") val table = Table.Ref(tableReference)
A helper method is provided to replace the "$LATEST" placeholder in the table name to the latest common partition.
val table = Table.Spec("some_project:some_data.some_table_$LATEST").latest()
- type TableRow = google.api.services.bigquery.model.TableRow
Alias for BigQuery
TableRow
. - final case class TableRowJsonIO(path: String) extends ScioIO[TableRow] with Product with Serializable
Get an IO for a BigQuery TableRow JSON file.
- final case class TableRowJsonTap(path: String) extends Tap[TableRow] with Product with Serializable
Tap for BigQuery TableRow JSON files.
- case class TimePartitioning(type: String, field: String = null, expirationMs: Long = 0, requirePartitionFilter: Boolean = false) extends Product with Serializable
Scala wrapper for com.google.api.services.bigquery.model.TimePartitioning.
- type description = bigquery.types.description
Annotation for BigQuery field description.
Value Members
- val BigQueryType: bigquery.types.BigQueryType.type
Typed BigQuery annotations and converters.
- val CREATE_IF_NEEDED: CreateDisposition
Alias for BigQuery
CreateDisposition
. - val CREATE_NEVER: CreateDisposition
Alias for BigQuery
CreateDisposition
. - val WRITE_APPEND: WriteDisposition
Alias for BigQuery
WriteDisposition
. - val WRITE_EMPTY: WriteDisposition
Alias for BigQuery
WriteDisposition
. - val WRITE_TRUNCATE: WriteDisposition
Alias for BigQuery
WriteDisposition
. - implicit def bigQuerySCollectionGenericRecordOps[T <: GenericRecord](sc: SCollection[T]): SCollectionGenericRecordOps[T]
- Definition Classes
- SCollectionSyntax
- implicit def bigQuerySCollectionTableRowOps[T <: TableRow](sc: SCollection[T]): SCollectionTableRowOps[T]
- Definition Classes
- SCollectionSyntax
- implicit def bigQuerySCollectionTypedOps[T <: HasAnnotation](sc: SCollection[T]): SCollectionTypedOps[T]
- Definition Classes
- SCollectionSyntax
- implicit def bigQueryScioContextOps(sc: ScioContext): ScioContextOps
- Definition Classes
- ScioContextSyntax
- implicit def bigQueryTableRefOps(r: TableReference): TableReferenceOps
- Definition Classes
- TableReferenceSyntax
- implicit def bigQueryTableRowOps(tr: TableRow): TableRowOps
- Definition Classes
- TableRowSyntax
- implicit def tableRowCoder: Coder[google.api.services.bigquery.model.TableRow]
- Definition Classes
- CoderInstances
- object BigQueryIO
- object BigQuerySelect extends Serializable
- object BigQueryStorage extends Serializable
- object BigQuerySysProps
- Annotations
- @registerSysProps()
- object BigQueryTaps extends Serializable
- object BigQueryTyped
- object BigQueryTypedSelect extends Serializable
- object BigQueryTypedTable extends Serializable
- object BigQueryUtil
Utility for BigQuery data types.
- object Date
Utility for BigQuery
DATE
type. - object DateTime
Utility for BigQuery
DATETIME
type. - object ExtendedErrorInfo
- object MockBigQuery
Companion object for MockBigQuery.
- object Numeric
- object StorageUtil
Utility for BigQuery Storage API.
- object Table
- object TableRow
Create a TableRow with
Map
-like syntax.Create a TableRow with
Map
-like syntax. For example:val r = TableRow("name" -> "Alice", "score" -> 100)
- object TableRowJsonIO extends Serializable
- object Time
Utility for BigQuery
TIME
type. - object Timestamp
Utility for BigQuery
TIMESTAMP
type.