object BigQueryType
Macro annotations and converter generators for BigQuery types.
The following table lists each legacy SQL data type, its standard SQL equivalent and Scala type.
Legacy SQL | Standard SQL | Scala type |
|---|---|---|
BOOLEAN | BOOL | |
INTEGER | INT64 | |
FLOAT | FLOAT64 | |
STRING | STRING | |
NUMERIC | NUMERIC | |
BYTES | BYTES | |
RECORD | STRUCT | Nested case class |
REPEATED | ARRAY | |
TIMESTAMP | TIMESTAMP | |
DATE | DATE | |
TIME | TIME | |
DATETIME | DATETIME | |
- Annotations
- @deprecated
- Deprecated
(Since version 0.15.0) Use magnolify API instead.
- Source
- BigQueryType.scala
- Alphabetic
- By Inheritance
- BigQueryType
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- trait HasAnnotation extends AnyRef
Trait for case classes with generated companion objects.
- trait HasQuery extends AnyRef
Trait for companion objects of case classes generated with SELECT query.
- trait HasSchema[T] extends AnyRef
Trait for companion objects of case classes generated with schema.
- trait HasStorageOptions extends AnyRef
Trait for companion objects of case classes generated with storage API.
- trait HasTable extends AnyRef
Trait for companion objects of case classes generated with table.
- trait HasTableDescription extends AnyRef
Trait for companion objects of case classes generated with table description.
- trait Query[T] extends HasQuery
Trait for companion objects of case classes generated with query.
Trait for companion objects of case classes generated with query. Instance of this trait are provided as implicits allowing static discovery. That trait provide evidence that a BQ query is statically known for a given type T.
- trait StorageOptions[T] extends HasStorageOptions
Trait for companion objects of case classes generated with storage API.
Trait for companion objects of case classes generated with storage API. Instance of this trait are provided as implicits allowing static discovery. That trait provide evidence that a BQ table is statically known for a given type T.
- trait Table[T] extends HasTable
Trait for companion objects of case classes generated with table.
Trait for companion objects of case classes generated with table. Instance of this trait are provided as implicits allowing static discovery. That trait provide evidence that a BQ table is statically known for a given type T.
Deprecated Type Members
- macro class fromQuery extends Annotation with StaticAnnotation
Macro annotation for a BigQuery SELECT query.
Macro annotation for a BigQuery SELECT query.
Generate case classes for a BigQuery SELECT query. Note that
querymust be a string literal of the SELECT query with optional.stripMarginat the end. For example:@BigQueryType.fromQuery("SELECT field1, field2 FROM [project:dataset.table]")String formatting syntax can be used in
querywhen additionalargsare supplied. For example:@BigQueryType.fromQuery("SELECT field1, field2 FROM [%s]", "table")
"$LATEST" can be used as a placeholder for table partitions. The latest common partition available for all tables with the placeholder will be used. For example:
@BigQueryType.fromQuery( "SELECT field1, field2 FROM [project:d1.t1_%s] JOIN [project:d2.t2_%s] USING field3", "$LATEST", "$LATEST")
Also generate a companion object with convenience methods.
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
#legacysqlor#standardsql.- Annotations
- @compileTimeOnly("enable macro paradise (2.12) or -Ymacro-annotations (2.13) to expand macro annotations") @deprecated
- Deprecated
(Since version 0.15.0) Use magnolify API instead.
- macro class fromSchema extends Annotation with StaticAnnotation
Macro annotation for a BigQuery schema.
Macro annotation for a BigQuery schema.
Generate case classes for a BigQuery schema. Note that
schemamust be a string literal of the JSON schema with optional.stripMarginat the end. For example:@BigQueryType.fromSchema( """ |{ | "fields": [ | {"mode": "REQUIRED", "name": "f1", "type": "INTEGER"}, | {"mode": "REQUIRED", "name": "f2", "type": "FLOAT"}, | {"mode": "REQUIRED", "name": "f3", "type": "STRING"}, | {"mode": "REQUIRED", "name": "f4", "type": "TIMESTAMP"} | ] |} """.stripMargin) class MyRecordAlso generate a companion object with convenience methods.
- Annotations
- @compileTimeOnly("enable macro paradise (2.12) or -Ymacro-annotations (2.13) to expand macro annotations") @deprecated
- Deprecated
(Since version 0.15.0) Use magnolify API instead.
- macro class fromStorage extends Annotation with StaticAnnotation
Macro annotation for a BigQuery table using the storage API.
Macro annotation for a BigQuery table using the storage API.
Generate case classes for BigQuery storage API, including column projection and filtering. Note that
tableSpecmust be a string literal in the form ofproject:dataset.tablewith optional.stripMarginat the end. For example:@BigQueryType.fromStorage("project:dataset.table") class MyRecord
- Annotations
- @compileTimeOnly("enable macro paradise (2.12) or -Ymacro-annotations (2.13) to expand macro annotations") @deprecated
- Deprecated
(Since version 0.15.0) Use magnolify API instead.
- macro class fromTable extends Annotation with StaticAnnotation
Macro annotation for a BigQuery table.
Macro annotation for a BigQuery table.
Generate case classes for a BigQuery table. Note that
tableSpecmust be a string literal in the form ofproject:dataset.tablewith optional.stripMarginat the end. For example:@BigQueryType.fromTable("project:dataset.table") class MyRecord
String formatting syntax can be used in
tableSpecwhen additionalargsare supplied. For example:@BigQueryType.fromTable("project:dataset.%s", "table")
"$LATEST" can be used as a placeholder for table partitions. The latest partition available will be used. For example:
@BigQueryType.fromTable("project:dataset.table_%s", "$LATEST")
Also generate a companion object with convenience methods.
- Annotations
- @compileTimeOnly("enable macro paradise (2.12) or -Ymacro-annotations (2.13) to expand macro annotations") @deprecated
- Deprecated
(Since version 0.15.0) Use magnolify API instead.
- macro class toTable extends Annotation with StaticAnnotation
Macro annotation for case classes to be saved to a BigQuery table.
Macro annotation for case classes to be saved to a BigQuery table.
Note that this annotation does not generate case classes, only a companion object with convenience methods. You need to define a complete case class for as output record. For example:
@BigQueryType.toTable case class Result(name: String, score: Double)
- Annotations
- @compileTimeOnly("enable macro paradise (2.12) or -Ymacro-annotations (2.13) to expand macro annotations") @deprecated
- Deprecated
(Since version 0.15.0) Use magnolify API instead.
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- final def apply[T](implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): BigQueryType[T]
Create a new BigQueryType instance.
Create a new BigQueryType instance.
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 0.15.0) Use magnolify API instead.
- def avroSchemaOf[T](implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): Schema
Generate Schema for a case class.
Generate Schema for a case class.
- Annotations
- @deprecated
- Deprecated
(Since version 0.15.0) Use magnolify API instead.
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)
- macro def fromAvro[T]: (GenericRecord) => T
Generate a converter function from Avro GenericRecord to the given case class
T.Generate a converter function from Avro GenericRecord to the given case class
T.- Annotations
- @deprecated
- Deprecated
(Since version 0.15.0) Use magnolify API instead.
- macro def fromTableRow[T]: (google.api.services.bigquery.model.TableRow) => T
Generate a converter function from TableRow to the given case class
T.Generate a converter function from TableRow to the given case class
T.- Annotations
- @deprecated
- Deprecated
(Since version 0.15.0) Use magnolify API instead.
- def schemaOf[T](implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): TableSchema
Generate TableSchema for a case class.
Generate TableSchema for a case class.
- Annotations
- @deprecated
- Deprecated
(Since version 0.15.0) Use magnolify API instead.
- macro def toAvro[T]: (T) => GenericRecord
Generate a converter function from the given case class
Tto GenericRecord.Generate a converter function from the given case class
Tto GenericRecord.- Annotations
- @deprecated
- Deprecated
(Since version 0.15.0) Use magnolify API instead.
- macro def toTableRow[T]: (T) => google.api.services.bigquery.model.TableRow
Generate a converter function from the given case class
Tto TableRow.Generate a converter function from the given case class
Tto TableRow.- Annotations
- @deprecated
- Deprecated
(Since version 0.15.0) Use magnolify API instead.