-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
latamen.aitmeddour
committed
Jul 29, 2021
1 parent
fbcd38e
commit 0b9f52e
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
process_zone/apache_airflow/dags/services/extract_transform_load_dump_sql.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import MySQLdb | ||
import config | ||
|
||
# Handling function about SQL dumps | ||
def extract_transform_load_sql_dump(swift_result, swift_container, swift_id, process_type): | ||
|
||
# Connect | ||
db = MySQLdb.connect( | ||
host=config.mariadb_host, | ||
user=config.mariadb_user, | ||
passwd=config.mariadb_passwd, | ||
db=config.mariadb_database | ||
) | ||
|
||
cursor = db.cursor() | ||
|
||
# Execute SQL select statement | ||
cursor.execute(swift_result) | ||
|
||
# Close the connection | ||
db.close() | ||
|
||
sys.modules[__name__] = extract_transform_load_sql_dump |