Skip to content

Instantly share code, notes, and snippets.

@markmo
Created March 12, 2016 00:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markmo/87e2a11bce0fadf8e773 to your computer and use it in GitHub Desktop.
Save markmo/87e2a11bce0fadf8e773 to your computer and use it in GitHub Desktop.
Event schemas
package diamond.transform
import org.apache.spark.sql.types.{IntegerType, StringType, StructField, StructType, TimestampType}
/**
* Created by markmo on 12/12/2015.
*/
object schemas {
val inputSchema = StructType(Seq(
StructField("entityIdType", StringType),
StructField("entityId", StringType),
StructField("attribute", StringType),
StructField("ts", StringType),
StructField("namespace", StringType),
StructField("value", StringType, nullable = true),
StructField("properties", StringType, nullable = true),
StructField("processId", StringType),
StructField("processTime", StringType),
StructField("version", IntegerType)
))
val formattedSchema = StructType(Seq(
StructField("entity", StringType),
StructField("attribute", StringType),
StructField("ts", TimestampType),
StructField("namespace", StringType),
StructField("value", StringType, nullable = true),
StructField("properties", StringType, nullable = true),
StructField("processId", StringType),
StructField("processTime", TimestampType),
StructField("version", IntegerType)
))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment