Spark refresh date selected month data

Yesterday, the data found no data No. 4.30, horse of God?
Before are not the problem, and quickly check the cause. . .
According to regional data design documents, insert overwrite refresh of the month

Current practice:

create_date  > date_format(current_date,'yyyy-MM-01')

No. 4.30 executor (updated data of 4.1-4.30)
No. 5.1 implementation of the program (update of data 5.1-5.1)
5.2, the implementation of the program (update of data 5.1-5.2)
if business people number 5.1 updated data number of 4.30, and procedures no update!

The right way:

create_date  > date_format(date_sub(current_date,1),'yyyy-MM-01')

No. 4.30 executor (updated data of 4.1-4.29)
No. 5.1 executor (updated data of 4.1-4.30)
5.2, the implementation of the program (update of data 4.1-5.1)

Published 118 original articles · won praise 25 · Views 150,000 +

Guess you like

Origin blog.csdn.net/lhxsir/article/details/90479413
Recommended