Joe 9 ماه پیش
والد
کامیت
d682cd3f67
1فایلهای تغییر یافته به همراه11 افزوده شده و 14 حذف شده
  1. 11 14
      qiaojialiang/checkHiveDataUtil.py

+ 11 - 14
qiaojialiang/checkHiveDataUtil.py

@@ -1,10 +1,7 @@
 # -*- coding: utf-8 -*-
-# import argparse
-# import sys
-
 from odps import ODPS
 
-# import argparse
+import argparse
 
 ODPS_CONFIG = {
     'ENDPOINT': 'http://service.cn.maxcompute.aliyun.com/api',
@@ -13,11 +10,11 @@ ODPS_CONFIG = {
 }
 
 
-def check_origin_hive(table, partition):
+def check_origin_hive(args):
     project = "loghubods"
     # table = "alg_recsys_view_sample_v2"
-    # table = args.table
-    # partition = args.partition
+    table = args.table
+    partition = args.partition
     count = check_data(project, table, partition)
     if count == 0:
         print("1")
@@ -55,15 +52,15 @@ def check_data(project, table, partition) -> int:
 
 
 if __name__ == '__main__':
-    # parser = argparse.ArgumentParser(description='脚本utils')
+    parser = argparse.ArgumentParser(description='脚本utils')
     # parser.add_argument('--excute_program', type=str, help='执行程序')
-    # parser.add_argument('--partition', type=str, help='表分区')
+    parser.add_argument('--partition', type=str, help='表分区')
     # parser.add_argument('--project', type=str, help='表空间')
-    # parser.add_argument('--table', type=str, help='表名')
-    # argv = sys.argv
+    parser.add_argument('--table', type=str, help='表名')
+    argv = parser.parse_args()
     # args = parser.parse_args()
     # table = argv[1]
     # partition = argv[2]
-    table = 'alg_recsys_sample_all'
-    partition = '20240703'
-    print(check_origin_hive(table, partition))
+    # table = 'alg_recsys_sample_all'
+    # partition = '20240703'
+    print(check_origin_hive(argv))