Commit fa8a7fbb by chenyuanjie

ABA主题标签优化

parent 63a52979
import os
import sys
import random
import string
sys.path.append(os.path.dirname(sys.path[0]))
from utils.db_util import DBUtil
from utils.ssh_util import SSHUtil
from utils.common_util import CommonUtil,DateTypes
from utils.common_util import CommonUtil
if __name__ == '__main__':
site_name = CommonUtil.get_sys_arg(1, None)
date_type = CommonUtil.get_sys_arg(2, None)
date_info = CommonUtil.get_sys_arg(3, None)
# 获取最后一个参数
test_flag = CommonUtil.get_sys_arg(len(sys.argv) - 1, None)
print(f"执行参数为{sys.argv}")
......@@ -22,8 +20,6 @@ if __name__ == '__main__':
db_type = 'postgresql_test'
print("导出到测试库中")
else:
# db_type = "postgresql"
# print("导出到PG库中")
db_type = "postgresql_cluster"
print("导出到PG集群库库中")
......@@ -39,12 +35,11 @@ if __name__ == '__main__':
# 保证幂等性,先删除原始表同周期的数据
sql = f"""
drop table if exists {export_tb};
create table if not exists {export_tb}
(
like {export_master_tb} including ALL
);
"""
drop table if exists {export_tb};
create table if not exists {export_tb} (
like {export_master_tb} including ALL
);
"""
DBUtil.engine_exec_sql(engine, sql)
# 导出agg表
......@@ -67,7 +62,13 @@ if __name__ == '__main__':
"pattern_num_rate",
"date_info",
"created_time",
"updated_time"
"updated_time",
"pattern_word_num",
"pattern_category_id",
"pattern_category_current_id",
"pattern_rank",
"pattern_rank_change_rate",
"pattern_rank_rate_of_change"
],
partition_dict={
"site_name": site_name,
......
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