import os import sys sys.path.append(os.path.dirname(sys.path[0])) from utils.ssh_util import SSHUtil from utils.common_util import CommonUtil from utils.hdfs_utils import HdfsUtils from utils.db_util import DBUtil if __name__ == '__main__': # 导出到pg数据库 db_type = "postgresql" export_tb = f"us_st_year_week" sh = CommonUtil.build_export_sh( site_name="us", db_type=db_type, hive_tb="dim_st_year_week", export_tb=export_tb, col=[ "search_term", "st_key", "year_week" ], partition_dict={ "site_name": "us", } ) client = SSHUtil.get_ssh_client() SSHUtil.exec_command_async(client, sh, ignore_err=False) client.close() pass