private def rawType()

in scio-google-cloud-platform/src/main/scala/com/spotify/scio/bigquery/types/SchemaProvider.scala [71:96]


  private def rawType(tpe: Type): (String, Iterable[TableFieldSchema]) =
    tpe match {
      case t if provider.shouldOverrideType(t) =>
        (provider.getBigQueryType(t), Iterable.empty)
      case t if t =:= typeOf[Boolean]    => ("BOOLEAN", Iterable.empty)
      case t if t =:= typeOf[Int]        => ("INTEGER", Iterable.empty)
      case t if t =:= typeOf[Long]       => ("INTEGER", Iterable.empty)
      case t if t =:= typeOf[Float]      => ("FLOAT", Iterable.empty)
      case t if t =:= typeOf[Double]     => ("FLOAT", Iterable.empty)
      case t if t =:= typeOf[String]     => ("STRING", Iterable.empty)
      case t if t =:= typeOf[BigDecimal] => ("NUMERIC", Iterable.empty)
      case t if t =:= typeOf[BigNumeric] => ("BIGNUMERIC", Iterable.empty)

      case t if t =:= typeOf[ByteString]  => ("BYTES", Iterable.empty)
      case t if t =:= typeOf[Array[Byte]] => ("BYTES", Iterable.empty)

      case t if t =:= typeOf[Instant]       => ("TIMESTAMP", Iterable.empty)
      case t if t =:= typeOf[LocalDate]     => ("DATE", Iterable.empty)
      case t if t =:= typeOf[LocalTime]     => ("TIME", Iterable.empty)
      case t if t =:= typeOf[LocalDateTime] => ("DATETIME", Iterable.empty)
      case t if t =:= typeOf[Geography]     => ("GEOGRAPHY", Iterable.empty)
      case t if t =:= typeOf[Json]          => ("JSON", Iterable.empty)

      case t if isCaseClass(t) => ("RECORD", toFields(t))
      case _                   => throw new RuntimeException(s"Unsupported type: $tpe")
    }