Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def printMinorMax(rdd, what):
- if what == 'min':
- val = rdd.min()
- elif what == 'max':
- val = rdd.max()
- val2 = datetime.fromtimestamp(val)
- print("\n#### Printing at %s" % datetime.today().strftime("%y-%m-%d %H:%M:%S") )
- print("### %s %s (epoch = %s)" % (what, val2.strftime("%y-%m-%d %H:%M:%S"), val))
- epochs.foreachRDD(lambda rdd: printMinorMax(rdd, 'min'))
- epochs.foreachRDD(lambda rdd: printMinorMax(rdd, 'max'))
Advertisement
Add Comment
Please, Sign In to add comment