Sfoglia il codice sorgente

feat:修改分桶脚本

zhaohaipeng 9 mesi fa
parent
commit
ad4c56eff6
1 ha cambiato i file con 15 aggiunte e 1 eliminazioni
  1. 15 1
      zhangbo/utils.py

+ 15 - 1
zhangbo/utils.py

@@ -78,6 +78,18 @@ def check_hive(args):
         print("0")
 
 
+def check_ad_origin_hive(args):
+    project = "loghubods"
+    table = "alg_recsys_ad_sample_all_new"
+    partition = args.partition
+    count = check_data(project, table, partition)
+    if count == 0:
+        print("1")
+        exit(1)
+    else:
+        print("0")
+
+
 if __name__ == '__main__':
     parser = argparse.ArgumentParser(description='脚本utils')
     parser.add_argument('--excute_program', type=str, help='执行程序')
@@ -91,8 +103,10 @@ if __name__ == '__main__':
         check_item_hive(args)
     elif args.excute_program == "check_user_hive":
         check_user_hive(args)
+    elif args.excute_program == "check_ad_origin_hive":
+        check_ad_origin_hive(args)
     elif args.excute_program == "check_hive":
-            check_hive(args)
+        check_hive(args)
     else:
         print("无合法参数,验证失败。")
         exit(999)