diff --git a/chapter3/spark.py b/chapter3/spark.py index 750e795..95603f0 100644 --- a/chapter3/spark.py +++ b/chapter3/spark.py @@ -142,8 +142,8 @@ def collect_sentiments(spark): #荣耀10 df2 = spark.sql("select * from jd_comment where id like '7081550%'") - xiaomi_s = get_sentiments(df1) - huawei_s = get_sentiments(df2) + xiaomi_s = _get_sentiments(df1) + huawei_s = _get_sentiments(df2) data = {"xiaomi_s": xiaomi_s, "huawei_s": huawei_s} mysql_execute("update datas set data = '{}' where `key` = 'sentiments'".format(