Skip to content

Instantly share code, notes, and snippets.

@rupeshtr78
Last active November 4, 2020 01:35
Show Gist options
  • Save rupeshtr78/5d073016dfa61116bf26c3e5dfe79135 to your computer and use it in GitHub Desktop.
Save rupeshtr78/5d073016dfa61116bf26c3e5dfe79135 to your computer and use it in GitHub Desktop.
val userSchema = new StructType()
.add("id", "integer")
.add("name", "string")
.add("age", "integer")
.add("friends", "integer")
val carSchema = StructType(Array(
StructField("Name", StringType),
StructField("Miles_per_Gallon", DoubleType),
StructField("Cylinders", LongType),
StructField("Displacement", DoubleType)
val myRowSchema = new StructType(Array(
new StructField("some", StringType, true),
new StructField("col", StringType, true),
new StructField("names", LongType, false)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment