-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBusiness.py
78 lines (76 loc) · 4.18 KB
/
Business.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
from pyspark.sql import types as T
SCHEDULE_PER_DAY_SCHEMA = T.StructType([
T.StructField("monday", T.StringType()),
T.StructField("tuesday", T.StringType()),
T.StructField("wednesday", T.StringType()),
T.StructField("thursday", T.StringType()),
T.StructField("friday", T.StringType()),
T.StructField("saturday", T.StringType()),
T.StructField("sunday", T.StringType())
])
BUSINESS_SCHEMA = T.StructType(
[
T.StructField("business_id", T.StringType(), True),
T.StructField("name", T.StringType(), True),
T.StructField("address", T.StringType(), True),
T.StructField("city", T.StringType(), True),
T.StructField("state", T.StringType(), True),
T.StructField("postal_code", T.StringType(), True),
T.StructField("latitude", T.FloatType(), True),
T.StructField("longitude", T.FloatType(), True),
T.StructField("stars", T.FloatType(), True),
T.StructField("review_count", T.IntegerType(), True),
T.StructField("is_open", T.IntegerType(), True),
T.StructField("attributes", T.StructType([
T.StructField("AcceptsInsurance", T.StringType(), True),
T.StructField("AgesAllowed", T.StringType(), True),
T.StructField("Alcohol", T.StringType(), True),
T.StructField("Ambience", T.StringType(), True),
T.StructField("BYOB", T.StringType(), True),
T.StructField("BYOBCorkage", T.StringType(), True),
T.StructField("BestNights", T.StringType(), True),
T.StructField("BikeParking", T.StringType(), True),
T.StructField("BusinessAcceptsBitcoin", T.StringType(), True),
T.StructField("BusinessAcceptsCreditCards", T.StringType(), True),
T.StructField("BusinessParking", T.StringType(), True),
T.StructField("ByAppointmentOnly", T.StringType(), True),
T.StructField("Caters", T.StringType(), True),
T.StructField("CoatCheck", T.StringType(), True),
T.StructField("Corkage", T.StringType(), True),
T.StructField("DietaryRestrictions", T.StringType(), True),
T.StructField("DogsAllowed", T.StringType(), True),
T.StructField("DriveThru", T.StringType(), True),
T.StructField("GoodForDancing", T.StringType(), True),
T.StructField("GoodForKids", T.StringType(), True),
T.StructField("GoodForMeal", T.StringType(), True),
T.StructField("HairSpecializesIn", T.StringType(), True),
T.StructField("HappyHour", T.StringType(), True),
T.StructField("HasTV", T.StringType(), True),
T.StructField("Music", T.StringType(), True),
T.StructField("NoiseLevel", T.StringType(), True),
T.StructField("Open24Hours", T.StringType(), True),
T.StructField("OutdoorSeating", T.StringType(), True),
T.StructField("RestaurantsAttire", T.StringType(), True),
T.StructField("RestaurantsCounterService", T.StringType(), True),
T.StructField("RestaurantsDelivery", T.StringType(), True),
T.StructField("RestaurantsGoodForGroups", T.StringType(), True),
T.StructField("RestaurantsPriceRange2", T.StringType(), True),
T.StructField("RestaurantsReservations", T.StringType(), True),
T.StructField("RestaurantsTableService", T.StringType(), True),
T.StructField("RestaurantsTakeOut", T.StringType(), True),
T.StructField("Smoking", T.StringType(), True),
T.StructField("WheelchairAccessible", T.StringType(), True),
T.StructField("WiFi", T.StringType(), True),
]), True),
T.StructField("categories", T.StringType(), True),
T.StructField("hours", T.StructType([
T.StructField("Monday", T.StringType(), True),
T.StructField("Tuesday", T.StringType(), True),
T.StructField("Wednesday", T.StringType(), True),
T.StructField("Thursday", T.StringType(), True),
T.StructField("Friday", T.StringType(), True),
T.StructField("Saturday", T.StringType(), True),
T.StructField("Sunday", T.StringType(), True),
]), True)
]
)