-
Notifications
You must be signed in to change notification settings - Fork 0
/
schemas.py
29 lines (23 loc) · 1022 Bytes
/
schemas.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import pyspark.sql.types as T
mobile_app_clickstream_schema = T.StructType([
T.StructField("userId" , T.StringType()),
T.StructField("eventId" , T.StringType()),
T.StructField("eventType" , T.StringType()),
T.StructField("eventTime" , T.TimestampType()),
T.StructField("attributes", T.MapType(T.StringType(), T.StringType())),
])
user_purchases_schema = T.StructType([
T.StructField("purchaseId" , T.StringType()),
T.StructField("purchaseTime", T.TimestampType()),
T.StructField("billingCost" , T.DoubleType()),
T.StructField("isConfirmed" , T.BooleanType()),
])
purchases_attribution_schema = T.StructType([
T.StructField("purchaseId" , T.StringType()),
T.StructField("purchaseTime", T.TimestampType()),
T.StructField("billingCost" , T.DoubleType()),
T.StructField("isConfirmed" , T.BooleanType()),
T.StructField("sessionId" , T.StringType()),
T.StructField("campaignId" , T.StringType()),
T.StructField("channelId" , T.StringType()),
])