This commit is contained in:
parent
cf8d1da3ff
commit
7e4c268fb6
|
@ -67,10 +67,10 @@ def collect_news(spark):
|
|||
def get_last_day_count(spark):
|
||||
"""获取过去几天的采集量"""
|
||||
for i in range(5):
|
||||
df = spark.sql("select count(*) as N from jd where created_at like '"+getYesterday(i+1)+"%'")
|
||||
df = spark.sql("select count(*) as N from jd where created_at like '"+getYesterday(i)+"%'")
|
||||
jd_last_count = df.rdd.collect()[0]["N"]
|
||||
|
||||
df = spark.sql("select count(*) as N from jd_comment where created_at like '"+getYesterday(i+1)+"%'")
|
||||
df = spark.sql("select count(*) as N from jd_comment where created_at like '"+getYesterday(i)+"%'")
|
||||
jd_comment_last_count = df.rdd.collect()[0]["N"]
|
||||
|
||||
mysql_execute("update last_day_counts set product_c = {}, comment_c = {} where last_day = {}".format(
|
||||
|
|
Loading…
Reference in New Issue