package json
Main package for JSON APIs. Import all.
This package uses Circe for JSON handling under the hood.
import com.spotify.scio.extra.json._ // define a type-safe JSON schema case class Record(i: Int, d: Double, s: String) // read JSON as case classes sc.jsonFile[Record]("input.json") // write case classes as JSON sc.parallelize((1 to 10).map(x => Record(x, x.toDouble, x.toString)) .saveAsJsonFile("output")
- Source
- package.scala
- Alphabetic
- By Inheritance
- json
- AutoDerivation
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- final case class DecodeError(error: Error, input: String) extends Product with Serializable
A wrapper for
io.circe.Error
that also retains the original input string. - type Decoder[T] = io.circe.Decoder[T]
- type Encoder[T] = io.circe.Encoder[T]
- final case class JsonIO[T](path: String)(implicit evidence$1: Encoder[T], evidence$2: Decoder[T], evidence$3: Coder[T]) extends ScioIO[T] with Product with Serializable
- implicit final class JsonSCollection[T] extends Serializable
Enhanced version of SCollection with JSON methods.
- implicit final class JsonScioContext extends AnyVal
Enhanced version of ScioContext with JSON methods.
Value Members
- implicit macro def exportDecoder[A]: Exported[io.circe.Decoder[A]]
- Definition Classes
- AutoDerivation
- implicit macro def exportEncoder[A]: Exported[AsObject[A]]
- Definition Classes
- AutoDerivation
- object JsonIO extends Serializable