|
@@ -35,7 +35,7 @@ def check_data(project, table, partition) -> int:
|
|
return data_count
|
|
return data_count
|
|
|
|
|
|
|
|
|
|
-def check_data_hh(project, table, partition) -> int:
|
|
|
|
|
|
+def check_data_hh(project, table, partition, hh) -> int:
|
|
"""检查数据是否准备好,输出数据条数"""
|
|
"""检查数据是否准备好,输出数据条数"""
|
|
odps = ODPS(
|
|
odps = ODPS(
|
|
access_id=ODPS_CONFIG['ACCESSID'],
|
|
access_id=ODPS_CONFIG['ACCESSID'],
|
|
@@ -49,7 +49,7 @@ def check_data_hh(project, table, partition) -> int:
|
|
)
|
|
)
|
|
try:
|
|
try:
|
|
t = odps.get_table(name=table)
|
|
t = odps.get_table(name=table)
|
|
- check_res = t.exist_partition(partition_spec=f'dt={partition},hh=0')
|
|
|
|
|
|
+ check_res = t.exist_partition(partition_spec=f'dt={partition},hh={hh}')
|
|
if check_res:
|
|
if check_res:
|
|
sql = f'select * from {project}.{table} where dt = {partition}'
|
|
sql = f'select * from {project}.{table} where dt = {partition}'
|
|
with odps.execute_sql(sql=sql).open_reader() as reader:
|
|
with odps.execute_sql(sql=sql).open_reader() as reader:
|
|
@@ -108,7 +108,8 @@ def check_ad_origin_hive(args):
|
|
project = "loghubods"
|
|
project = "loghubods"
|
|
table = "alg_recsys_ad_sample_all_new"
|
|
table = "alg_recsys_ad_sample_all_new"
|
|
partition = args.partition
|
|
partition = args.partition
|
|
- count = check_data_hh(project, table, partition)
|
|
|
|
|
|
+ hh = args.hh
|
|
|
|
+ count = check_data_hh(project, table, partition, hh)
|
|
if count == 0:
|
|
if count == 0:
|
|
print("1")
|
|
print("1")
|
|
exit(1)
|
|
exit(1)
|