diff --git a/chapter3/spark.py b/chapter3/spark.py index b5c0b71..d51df35 100644 --- a/chapter3/spark.py +++ b/chapter3/spark.py @@ -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"]))