Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] ysd_game_rating to tdy_game_rating #133

Merged
merged 1 commit into from
Mar 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ def elt():

# analytics.ANAL_YSD_GAME_CCU 테이블의 모든 데이터 삭제
sql = """
DELETE FROM analytics.ANAL_YSD_GAME_RATING;
DELETE FROM analytics.ANAL_TDY_GAME_RATING;
"""
cur.execute(sql)
print("Successfully deleted all data from analytics.ANAL_YSD_GAME_RATING")
print("Successfully deleted all data from analytics.ANAL_TDY_GAME_RATING")

# SELECT 쿼리의 결과를 analytics.ANAL_YSD_GAME_CCU 테이블에 삽입
sql = """
INSERT INTO analytics.ANAL_YSD_GAME_RATING(GAME_NM, POSITIVE_PERCENT, CREATED_DATE)
INSERT INTO analytics.ANAL_TDY_GAME_RATING(GAME_NM, POSITIVE_PERCENT, CREATED_DATE)
SELECT
b.game_nm AS GAME_NM,
(a.all_positive_percent)*0.05 AS POSITIVE_PERCENT,
Expand All @@ -46,7 +46,7 @@ def elt():
ON a.game_id = b.game_id ;
"""
cur.execute(sql)
print("Successfully inserted data into analytics.ANAL_YSD_GAME_RATING")
print("Successfully inserted data into analytics.ANAL_TDY_GAME_RATING")

# 트랜잭션 commit
conn.commit()
Expand All @@ -66,7 +66,7 @@ def elt():


with DAG(
dag_id="ELT_ANAL_YSD_GAME_RATING",
dag_id="ELT_ANAL_TDY_GAME_RATING",
start_date=datetime(2024, 1, 1),
catchup=False,
tags=["ELT", "analytics", "game_rating"],
Expand Down