Created
March 12, 2016 00:27
-
-
Save markmo/87e2a11bce0fadf8e773 to your computer and use it in GitHub Desktop.
Event schemas
This file contains 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
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