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