Created
March 31, 2015 18:08
-
-
Save ldacosta/801afe65d783bc2d7f3c to your computer and use it in GitHub Desktop.
StructField from case class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.spark.sql._ | |
case class CC1(i: Int, s: Option[Int]) | |
case class MockExpected2(i: Int, s: String, d: Option[Double], cc1: Option[CC1]) | |
object MockExpected2 { | |
val expectedSchema2: StructType = { | |
StructType(Seq( | |
StructField(name = "cc1", dataType = StructType({ | |
Seq( | |
StructField(name = "i", dataType = IntegerType, nullable = false), | |
StructField(name = "s", dataType = StringType, nullable = true)) | |
}), nullable = false), | |
StructField(name = "i", dataType = IntegerType, nullable = false), | |
StructField(name = "s", dataType = StringType, nullable = false), | |
StructField(name = "d", dataType = DoubleType, nullable = true))) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment