|
| 1 | +from pyspark.sql.types import StructType, StructField, StringType, TimestampType, DateType, IntegerType |
| 2 | + |
| 3 | +movie_schema: StructType = StructType([ |
| 4 | + StructField("_id", StringType(), nullable=False), |
| 5 | + StructField("_key", StringType(), nullable=False), |
| 6 | + StructField("description", StringType()), |
| 7 | + StructField("genre", StringType()), |
| 8 | + StructField("homepage", StringType()), |
| 9 | + StructField("imageUrl", StringType()), |
| 10 | + StructField("imdbId", StringType()), |
| 11 | + StructField("language", StringType()), |
| 12 | + StructField("lastModified", TimestampType()), |
| 13 | + StructField("releaseDate", DateType()), |
| 14 | + StructField("runtime", IntegerType()), |
| 15 | + StructField("studio", StringType()), |
| 16 | + StructField("tagline", StringType()), |
| 17 | + StructField("title", StringType()), |
| 18 | + StructField("trailer", StringType()) |
| 19 | +]) |
| 20 | +person_schema: StructType = StructType([ |
| 21 | + StructField("_id", StringType(), nullable=False), |
| 22 | + StructField("_key", StringType(), nullable=False), |
| 23 | + StructField("biography", StringType()), |
| 24 | + StructField("birthday", DateType()), |
| 25 | + StructField("birthplace", StringType()), |
| 26 | + StructField("lastModified", TimestampType()), |
| 27 | + StructField("name", StringType()), |
| 28 | + StructField("profileImageUrl", StringType()) |
| 29 | +]) |
| 30 | +edges_schema: StructType = StructType([ |
| 31 | + StructField("_key", StringType(), nullable=False), |
| 32 | + StructField("_from", StringType(), nullable=False), |
| 33 | + StructField("_to", StringType(), nullable=False), |
| 34 | + StructField("$label", StringType()), |
| 35 | + StructField("name", StringType()), |
| 36 | + StructField("type", StringType()), |
| 37 | +]) |
| 38 | +acts_in_schema: StructType = StructType([ |
| 39 | + StructField("_id", StringType(), nullable=False), |
| 40 | + StructField("_key", StringType(), nullable=False), |
| 41 | + StructField("_from", StringType(), nullable=False), |
| 42 | + StructField("_to", StringType(), nullable=False), |
| 43 | + StructField("name", StringType()) |
| 44 | +]) |
| 45 | +directed_schema: StructType = StructType([ |
| 46 | + StructField("_id", StringType(), nullable=False), |
| 47 | + StructField("_key", StringType(), nullable=False), |
| 48 | + StructField("_from", StringType(), nullable=False), |
| 49 | + StructField("_to", StringType(), nullable=False) |
| 50 | +]) |
0 commit comments