from utils.read_sql_files import read_one_game_sql_files from utils.execute_sql import select_execute_sql def dim(game_information): read_one_game_sql_files('dim', game_information) def dwd(game_information): read_one_game_sql_files('dwd_before', game_information) read_one_game_sql_files('dwd_after', game_information) def dws(game_information): read_one_game_sql_files('dws_before', game_information) read_one_game_sql_files('dws_after', game_information) def ads(game_information): read_one_game_sql_files('ads', game_information) def job_one_game(): sql_params = "123,122" sql_str = f"select relation_id,game_channel_id,game_identity,game_platform_id from dim.game_product_relation where relation_id IN ({sql_params})" game_information = select_execute_sql(sql_str) for game in game_information: game_information_dic = { "${relation_id}": str(game[0]), "${channel_id}": str(game[1]), "${game_identity}": game[2], "${platform_id}": str(game[3]) } print(game_information_dic) dim(game_information_dic) dwd(game_information_dic) dws(game_information_dic) ads(game_information_dic) if __name__ == '__main__': job_one_game()