I am new to Bigdata and Python. Kindly explain the meaning of
.filter("year*10000+month*100+day between {0} and {1}".format(start,end))
I am new to Bigdata and Python. Kindly explain the meaning of
.filter("year*10000+month*100+day between {0} and {1}".format(start,end))
The author of the following code
.filter("year*10000+month*100+day between {0} and {1}".format(start, end))
tries to filter the rows from data frame that are between start
and end
date.
Obviously the author does not have a column "date", so they make a date out of year
, month
, and day
columns, e. g. if year = 2020, month=10, and day=15, the product is date 20201015. Maybe, it would be helpful, when there are parenthesis in the equation:
.filter("(year * 10000) + (month * 100) + day between {0} and {1}".format(start, end))
However, this code is wrong, because you cannot make the date like this for months from January to September, so I would recommend to rewrite it.