diff --git a/chapter3/spark.py b/chapter3/spark.py index 660953f..3b78bcc 100644 --- a/chapter3/spark.py +++ b/chapter3/spark.py @@ -46,7 +46,7 @@ def get_last_month(num): if month<=0: month = 12 - (num-1) year -= 1 - return "%d-%d" % (year, month) + return "%d-%02d" % (year, month) def collect_last_month_sells(spark): data = {}