|
1 | 1 | from datetime import timedelta, datetime |
2 | | -import math |
3 | | -from pyspark.sql.types import StructType, StructField, IntegerType, StringType, FloatType, TimestampType |
4 | | -from dbldatagen import DateRange |
5 | | -import dbldatagen as dg |
6 | | -from pyspark.conf import SparkConf |
| 2 | + |
7 | 3 | from pyspark.sql import SparkSession |
8 | 4 |
|
| 5 | +import dbldatagen as dg |
| 6 | + |
9 | 7 | interval = timedelta(days=1, hours=1) |
10 | 8 | start = datetime(2017, 10, 1, 0, 0, 0) |
11 | 9 | end = datetime(2018, 10, 1, 6, 0, 0) |
|
37 | 35 | .withColumn("sector_status_desc", "string", dataRange=range(1, 5), prefix='status', random=True) |
38 | 36 | # withColumn adds specification for new column |
39 | 37 | .withColumn("rand", "float", expr="floor(rand() * 350) * (86400 + 3600)") |
40 | | - .withColumn("last_sync_dt", "timestamp", dataRange=DateRange(start, end, timedelta(days=1, hours=1)), |
| 38 | + .withColumn("last_sync_dt", "timestamp", dataRange=dg.DateRange(start, end, timedelta(days=1, hours=1)), |
41 | 39 | random=True) |
42 | 40 | .withColumnSpec("sector_technology_desc", values=["GSM", "UMTS", "LTE", "UNKNOWN"], random=True) |
43 | 41 | .withColumn("test_cell_flg", "int", values=[0, 1], random=True) |
|
0 commit comments