From b2382f4f044e5f05c6b1d6742ea1ff0190fd0aa6 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 18 Jan 2019 16:20:18 +0800 Subject: [PATCH] . --- chapter3/spark.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter3/spark.py b/chapter3/spark.py index 4044f42..bc1c870 100644 --- a/chapter3/spark.py +++ b/chapter3/spark.py @@ -82,7 +82,7 @@ def collect_top10_sells(spark): df = spark.sql("select * from jd order by good_count desc limit 10") i = 1 for row in df.rdd.collect(): - mysql_execute("update top10_sells set product_name = {}, good_c = {}, price={} where order_n = {} ".format( + mysql_execute("update top10_sells set product_name = '{}', good_c = {}, price={} where order_n = {} ".format( row["name"], row["good_count"], int(float(row["price"])),i)) i += 1