scala.googleapis.bigquery.PartitioningDefinition.scala Maven / Gradle / Ivy
package googleapis.bigquery
import io.circe._
import io.circe.syntax._
final case class PartitioningDefinition(
/** Optional. Details about each partitioning column. This field is output only for all partitioning types other than metastore partitioned tables. BigQuery native tables only support 1 partitioning column. Other table types may support 0, 1 or more partitioning columns. For metastore partitioned tables, the order must match the definition order in the Hive Metastore, where it must match the physical layout of the table. For example, CREATE TABLE a_table(id BIGINT, name STRING) PARTITIONED BY (city STRING, state STRING). In this case the values must be ['city', 'state'] in that order.
*/
partitionedColumn: Option[List[PartitionedColumn]] = None
)
object PartitioningDefinition {
implicit val encoder: Encoder[PartitioningDefinition] = Encoder.instance { x =>
Json.obj("partitionedColumn" := x.partitionedColumn)
}
implicit val decoder: Decoder[
PartitioningDefinition
] = Decoder.instance { c =>
for {
v0 <- c.get[Option[List[PartitionedColumn]]]("partitionedColumn")
} yield PartitioningDefinition(v0)
}
}