This commit is contained in:
guange 2019-01-18 10:24:34 +08:00
parent 411e14684f
commit ed358a8a59
1 changed files with 1 additions and 1 deletions

View File

@ -53,7 +53,7 @@ def collect_crawl_info(spark):
def collect_news(spark):
df = spark.sql("select * from jd_comment order by created_at desc limit 20")
for row in df.rdd.collect():
mysql_execute("insert into news (comment_time, content, comment_id) values ('{}', '{}', '{}'')".format(
mysql_execute("insert into news (comment_time, content, comment_id) values ('{}', '{}', '{}')".format(
row["comment_time"], row["content"], row["id"]))