Skip to content

silver_device_activity_statistics

SilverDeviceActivityStatistics

Bases: ParquetDataObject

Class that models the cleaned MNO Event data.

Source code in multimno/core/data_objects/silver/silver_device_activity_statistics.py
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
class SilverDeviceActivityStatistics(ParquetDataObject):
    """
    Class that models the cleaned MNO Event data.
    """

    ID = "SilverDeviceActivityStatisticsDO"
    SCHEMA = StructType(
        [
            StructField(ColNames.user_id, BinaryType(), nullable=False),
            StructField(ColNames.event_cnt, IntegerType(), nullable=False),
            StructField(ColNames.unique_cell_cnt, ShortType(), nullable=False),
            StructField(ColNames.unique_location_cnt, ShortType(), nullable=False),
            StructField(ColNames.sum_distance_m, IntegerType(), nullable=True),
            StructField(ColNames.unique_hour_cnt, ByteType(), nullable=False),
            StructField(ColNames.mean_time_gap, IntegerType(), nullable=True),
            StructField(ColNames.stdev_time_gap, FloatType(), nullable=True),
            # partition columns
            StructField(ColNames.year, ShortType(), nullable=False),
            StructField(ColNames.month, ByteType(), nullable=False),
            StructField(ColNames.day, ByteType(), nullable=False),
        ]
    )

    PARTITION_COLUMNS = [ColNames.year, ColNames.month, ColNames.day]