Commit ce159468 authored by 高雅喆's avatar 高雅喆

update

parent 99b665ac
...@@ -150,11 +150,10 @@ if __name__ == '__main__': ...@@ -150,11 +150,10 @@ if __name__ == '__main__':
result_last = spark.createDataFrame([("10", "a", "aa"), ("11", "b", "bb"), ("13", "c", "cc")], result_last = spark.createDataFrame([("10", "a", "aa"), ("11", "b", "bb"), ("13", "c", "cc")],
["stat_date", "cl_id", "tag_list"]) ["stat_date", "cl_id", "tag_list"])
result_last.show() result_last.show()
result_last.write.format("jdbc").options( result_last.write.jdbc(
url='jdbc:mysql://172.16.40.158/jerry_test', url='jdbc:mysql://172.16.40.158/jerry_test?user=root&password=3SYz54LS9#^9sBvC',
driver='com.mysql.jdbc.Driver', mode="overwrite",
dbtable='user_portrait_tags', table="user_portrait_tags",
user='root', properties={"driver": 'com.mysql.jdbc.Driver'})
password='3SYz54LS9#^9sBvC').mode('overwrite').save()
except Exception as e: except Exception as e:
print(e) print(e)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment