Commit 037a733c authored by 张彦钊's avatar 张彦钊

change test file

parent 274a1445
......@@ -103,6 +103,13 @@ def user_to_csv():
df.to_csv('/tmp/device/user.csv', index=False)
def location_to_csv():
sql = "select device_id,lat,lng,partition_date from device_location"
df = pd.DataFrame(list(get_mysql_data(host, port, user, passwd, db, sql)))
df = df.rename(columns={0: "device_id", 1: "lat", 2: "lng", 3: "partition_date"})
df.to_csv('/tmp/device/location.csv', index=False)
if __name__ == "__main__":
# host = "172.16.30.141"
# port = 3306
......@@ -118,8 +125,9 @@ if __name__ == "__main__":
passwd = "3SYz54LS9#^9sBvC"
db = "jerry_test"
user_device_to_csv()
print("ud ok")
location_to_csv()
......
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