ScioIO
Scio 0.7.0
introduces a new ScioIO[T]
trait to simplify IO implementation and stubbing in JobTest
. This page lists some major changes to this new API.
Dependencies
Avro and BigQuery logic was decoupled from scio-core
as part of the refactor.
- Before
0.7.0
scio-core
depends onscio-avro
andscio-bigquery
ScioContext
andSCollection[T]
include Avro, object, Protobuf and BigQuery IO methods out of the box- After
0.7.0
scio-core
no longer depends onscio-avro
andscio-bigquery
- Import
com.spotify.scio.avro._
to get Avro, object, Protobuf IO methods onScioContext
andSCollection[T]
- Import
com.spotify.scio.bigquery._
to get BigQuery IO methods onScioContext
andSCollection[T]
ScioIO[T]
for JobTest
As part of the refactor TestIO[T]
was replaced by ScioIO[T]
for JobTest
. Some of them were moved to different packages for consistency but most test code should work with minor import
changes. Below is a list of ScioIO[T]
implementations.
com.spotify.scio.avro
AvroIO[T]
ObjectFileIO[T]
ProtobufIO[T]
com.spotify.scio.bigquery
BigQueryIO[T]
TableRowJsonIO
whereT =:= TableRow
com.spotify.scio.io
DatastoreIO
whereT =:= Entity
PubsubIO[T]
TextIO
whereT =:= String
CustomIO[T]
for use withScioContext#customInput
andSCollection#customOutput
com.spotify.scio.bigtable
BigtableIO[T]
whereT =:= Row
for input andT =:= Mutation
for output- This replaces
BigtableInput
andBigtableOutput
com.spotify.scio.cassandra
CassandraIO[T]
com.spotify.scio.elasticsearch
ElasticsearchIO[T]
com.spotify.scio.extra.json
JsonIO[T]
com.spotify.scio.jdbc
JdbcIO[T]
com.spotify.scio.parquet.avro
ParquetAvroIO[T]
com.spotify.scio.spanner
SpannerIO[T]
com.spotify.scio.tensorflow
TFRecordIO
whereT =:= Array[Byte]
TFExampleIO
whereT =:= Example
Using ScioIO[T]
directly
2 methods, ScioContext#read
and SCollection#write
were added to leverage ScioIO[T]
directly without needing the extra ScioContext#{textFile,AvroFile,...}
and SCollection#saveAs{TextFile,AvroFile,...}
syntactic sugar. See WordCountScioIO and WordCountScioIOTest for concrete examples.
0.14.8-23-c45685a-20241105T161920Z*