Packages

c

com.spotify.scio.avro.syntax

ScioContextOps

final class ScioContextOps extends AnyVal

Enhanced version of ScioContext with Avro methods.

Source
ScioContextSyntax.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ScioContextOps
  2. AnyVal
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new ScioContextOps(self: ScioContext)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  2. final def ##: Int
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. 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.

  6. 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.

  7. def avroFile[T <: SpecificRecord](path: String, suffix: String)(implicit arg0: ClassTag[T]): SCollection[T]

    Get an SCollection of type SpecificRecord for an Avro file.

  8. def avroFile[T <: SpecificRecord](path: String)(implicit arg0: ClassTag[T]): SCollection[T]

    Get an SCollection of type SpecificRecord for an Avro file.

  9. def avroFile(path: String, schema: Schema, suffix: String, datumFactory: AvroDatumFactory[GenericRecord]): SCollection[GenericRecord]
  10. def avroFile(path: String, schema: Schema, datumFactory: AvroDatumFactory[GenericRecord]): SCollection[GenericRecord]
  11. def avroFile(path: String, schema: Schema, suffix: String): SCollection[GenericRecord]
  12. def avroFile(path: String, schema: Schema): SCollection[GenericRecord]
  13. def getClass(): Class[_ <: AnyVal]
    Definition Classes
    AnyVal → Any
  14. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  15. 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.

  16. 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 a GenericRecord and hence is not type checked.

    This is intended to be used when attempting to read GenericRecords without specifying a schema (hence the writer schema is used to deserialize) and then directly converting to a type T using a parseFn. This avoids creation of an intermediate SCollection[GenericRecord] which can be in efficient because Coder[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()
  17. 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.

  18. def toString(): String
    Definition Classes
    Any
  19. 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.

Inherited from AnyVal

Inherited from Any

Ungrouped