final class SCollectionTypedOps[T <: HasAnnotation] extends AnyVal
Enhanced version of SCollection with BigQuery methods.
- Source
- SCollectionSyntax.scala
- Alphabetic
- By Inheritance
- SCollectionTypedOps
- AnyVal
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new SCollectionTypedOps(self: SCollection[T])
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- Any
- final def ##: Int
- Definition Classes
- Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def saveAsTypedBigQueryTable(table: Table, timePartitioning: TimePartitioning = TableWriteParam.DefaultTimePartitioning, writeDisposition: WriteDisposition = TableWriteParam.DefaultWriteDisposition, createDisposition: CreateDisposition = TableWriteParam.DefaultCreateDisposition, clustering: Clustering = TableWriteParam.DefaultClustering, method: Method = TableWriteParam.DefaultMethod, triggeringFrequency: Duration = TableWriteParam.DefaultTriggeringFrequency, sharding: Sharding = TableWriteParam.DefaultSharding, failedInsertRetryPolicy: InsertRetryPolicy = TableWriteParam.DefaultFailedInsertRetryPolicy, successfulInsertsPropagation: Boolean = TableWriteParam.DefaultSuccessfulInsertsPropagation, extendedErrorInfo: Boolean = TableWriteParam.DefaultExtendedErrorInfo, configOverride: BigQueryTyped.Table.WriteParam.ConfigOverride[T] = TableWriteParam.DefaultConfigOverride)(implicit tt: scala.reflect.api.JavaUniverse.TypeTag[T], coder: Coder[T]): ClosedTap[T]
Save this SCollection as a BigQuery table.
Save this SCollection as a BigQuery table. Note that element type
T
must be annotated with BigQueryType.This could be a complete case class with BigQueryType.toTable. For example:
@BigQueryType.toTable case class Result(name: String, score: Double) val p: SCollection[Result] = // process data and convert elements to Result p.saveAsTypedBigQueryTable(Table.Spec("myproject:mydataset.mytable"))
It could also be an empty class with schema from BigQueryType.fromSchema, BigQueryType.fromTable, or BigQueryType.fromQuery. For example:
@BigQueryType.fromTable("bigquery-public-data:samples.gsod") class Row sc.typedBigQuery[Row]() .sample(withReplacement = false, fraction = 0.1) .saveAsTypedBigQueryTable(Table.Spec("myproject:samples.gsod"))
*
- returns
a ClosedTap containing some side output(s) depending on the given parameters
- BigQueryIO.SuccessfulTableLoads if
method
is Method.FILE_LOADS. - BigQueryIO.SuccessfulInserts if
method
is Method.STREAMING_INSERTS andsuccessfulInsertsPropagation
istrue
. - BigQueryIO.SuccessfulStorageApiInserts if
method
id Method.STORAGE_WRITE_API or Method.STORAGE_API_AT_LEAST_ONCE. - BigQueryIO.FailedInserts if
method
is Method.STREAMING_INSERTS. - BigQueryIO.FailedInsertsWithErr if
method
is Method.STREAMING_INSERTS andextendedErrorInfo
istrue
. - BigQueryIO.FailedStorageApiInserts if
method
id Method.STORAGE_WRITE_API or Method.STORAGE_API_AT_LEAST_ONCE.
- BigQueryIO.SuccessfulTableLoads if
- def toString(): String
- Definition Classes
- Any