This commit is contained in:
guange 2019-01-18 16:20:18 +08:00
parent 2bb9f61d28
commit b2382f4f04
1 changed files with 1 additions and 1 deletions

View File

@ -82,7 +82,7 @@ def collect_top10_sells(spark):
df = spark.sql("select * from jd order by good_count desc limit 10") df = spark.sql("select * from jd order by good_count desc limit 10")
i = 1 i = 1
for row in df.rdd.collect(): 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)) row["name"], row["good_count"], int(float(row["price"])),i))
i += 1 i += 1