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

change test fliw

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