Commit 8cb2656b authored by 张彦钊's avatar 张彦钊

change test fliw

parent ea23b1d6
...@@ -139,7 +139,7 @@ def feature_engineer(): ...@@ -139,7 +139,7 @@ def feature_engineer():
validate_date = con_sql(db, sql)[0].values.tolist()[0] validate_date = con_sql(db, sql)[0].values.tolist()[0]
print("validate_date:" + validate_date) print("validate_date:" + validate_date)
temp = datetime.datetime.strptime(validate_date, "%Y-%m-%d") temp = datetime.datetime.strptime(validate_date, "%Y-%m-%d")
start = (temp - datetime.timedelta(days=100)).strftime("%Y-%m-%d") start = (temp - datetime.timedelta(days=6)).strftime("%Y-%m-%d")
print(start) print(start)
db = pymysql.connect(host='172.16.40.158', port=4000, user='root', passwd='3SYz54LS9#^9sBvC') db = pymysql.connect(host='172.16.40.158', port=4000, user='root', passwd='3SYz54LS9#^9sBvC')
...@@ -337,7 +337,7 @@ if __name__ == '__main__': ...@@ -337,7 +337,7 @@ if __name__ == '__main__':
local_path = "/home/gmuser/esmm/" local_path = "/home/gmuser/esmm/"
validate_date, value_map, app_list_map, leve2_map, leve3_map = feature_engineer() validate_date, value_map, app_list_map, leve2_map, leve3_map = feature_engineer()
get_predict(validate_date, value_map, app_list_map, leve2_map, leve3_map) # get_predict(validate_date, value_map, app_list_map, leve2_map, leve3_map)
spark.stop() spark.stop()
......
...@@ -348,19 +348,19 @@ def main(_): ...@@ -348,19 +348,19 @@ def main(_):
elif FLAGS.task_type == 'export': elif FLAGS.task_type == 'export':
print("Not Implemented, Do It Yourself!") print("Not Implemented, Do It Yourself!")
def get_filename(dir_in): # def get_filename(dir_in):
pre_path = "hdfs://172.16.32.4:8020" # pre_path = "hdfs://172.16.32.4:8020"
args = "hdfs dfs -ls " + dir_in + " | awk '{print $8}'" # args = "hdfs dfs -ls " + dir_in + " | awk '{print $8}'"
proc = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) # proc = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
s_output, s_err = proc.communicate() # s_output, s_err = proc.communicate()
all_dart_dirs = s_output.split() # all_dart_dirs = s_output.split()
a = [] # a = []
for i in all_dart_dirs: # for i in all_dart_dirs:
b = str(i).split("/")[4] # b = str(i).split("/")[4]
if b[:4] == "part": # if b[:4] == "part":
tmp = pre_path + str(i)[2:-1] # tmp = pre_path + str(i)[2:-1]
a.append(tmp) # a.append(tmp)
return a # return a
if __name__ == "__main__": if __name__ == "__main__":
b = time.time() b = time.time()
......
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