final class ScioContextOps extends AnyVal
- Alphabetic
- By Inheritance
- ScioContextOps
- AnyVal
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new ScioContextOps(self: ScioContext)
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 avroFile[T <: SpecificRecord](path: String, suffix: String, datumFactory: AvroDatumFactory[T])(implicit arg0: ClassTag[T]): SCollection[T]
Get an SCollection of type SpecificRecord for an Avro file.
- def avroFile[T <: SpecificRecord](path: String, datumFactory: AvroDatumFactory[T])(implicit arg0: ClassTag[T]): SCollection[T]
Get an SCollection of type SpecificRecord for an Avro file.
- def avroFile[T <: SpecificRecord](path: String, suffix: String)(implicit arg0: ClassTag[T]): SCollection[T]
Get an SCollection of type SpecificRecord for an Avro file.
- def avroFile[T <: SpecificRecord](path: String)(implicit arg0: ClassTag[T]): SCollection[T]
Get an SCollection of type SpecificRecord for an Avro file.
- def avroFile(path: String, schema: Schema, suffix: String, datumFactory: AvroDatumFactory[GenericRecord]): SCollection[GenericRecord]
- def avroFile(path: String, schema: Schema, datumFactory: AvroDatumFactory[GenericRecord]): SCollection[GenericRecord]
- def avroFile(path: String, schema: Schema, suffix: String): SCollection[GenericRecord]
- def avroFile(path: String, schema: Schema): SCollection[GenericRecord]
- def getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def objectFile[T](path: String, suffix: String = ObjectFileIO.ReadParam.DefaultSuffix)(implicit arg0: Coder[T]): SCollection[T]
Get an SCollection for an object file using default serialization.
Get an SCollection for an object file using default serialization.
Serialized objects are stored in Avro files to leverage Avro's block file format. Note that serialization is not guaranteed to be compatible across Scio releases.
- def parseAvroFile[T](path: String, suffix: String = GenericRecordParseIO.ReadParam.DefaultSuffix, datumFactory: AvroDatumFactory[GenericRecord] = GenericRecordParseIO.ReadParam.DefaultDatumFactory)(parseFn: (GenericRecord) => T)(implicit arg0: Coder[T]): SCollection[T]
Get an SCollection of type T for data stored in Avro format after applying parseFn to map a serialized GenericRecord to type T.
Get an SCollection of type T for data stored in Avro format after applying parseFn to map a serialized GenericRecord to type T.
This API should be used with caution as the
parseFn
reads from aGenericRecord
and hence is not type checked.This is intended to be used when attempting to read
GenericRecord
s without specifying a schema (hence the writer schema is used to deserialize) and then directly converting to a type T using aparseFn
. This avoids creation of an intermediateSCollection[GenericRecord]
which can be in efficient becauseCoder[GenericRecord]
is inefficient without a known Avro schema.Example usage: This code reads Avro fields "id" and "name" and de-serializes only those two into CaseClass
val sColl: SCollection[CaseClass] = sc.parseAvroFile("gs://.....") { g => CaseClass(g.get("id").asInstanceOf[Int], g.get("name").asInstanceOf[String]) }
- Annotations
- @experimental()
- def protobufFile[T <: Message](path: String, suffix: String = ProtobufIO.ReadParam.DefaultSuffix)(implicit arg0: ClassTag[T]): SCollection[T]
Get an SCollection for a Protobuf file.
Get an SCollection for a Protobuf file.
Protobuf messages are serialized into
Array[Byte]
and stored in Avro files to leverage Avro's block file format. - def toString(): String
- Definition Classes
- Any
- def typedAvroFile[T <: HasAvroAnnotation](path: String, suffix: String = AvroTypedIO.ReadParam.DefaultSuffix)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T], arg1: Coder[T]): SCollection[T]
Get a typed SCollection from an Avro schema.
Get a typed SCollection from an Avro schema.
Note that
T
must be annotated with AvroType.fromSchema, AvroType.fromPath, or AvroType.toSchema.