Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //read from source DBs
- val tmo = sqlContext.read
- .format("jdbc")
- .option("url", "jdbc:mysql://<HOST>:3306/<database>")
- .option("user", "")
- .option("password", "")
- .option("dbtable", "select * from athena.tmo")
- .load().toDF()
- val ios = sqlContext.read
- .format("jdbc")
- .option("url", "jdbc:mysql://<HOST>:3306/<database>")
- .option("user", "")
- .option("password", "")
- .option("dbtable", "select * from athena.ios")
- .load().toDF()
- //update new DBs
- AthenaDB.update("PSAurora.TMO_scoring_history_staging", tmo)
- AthenaDB.update("PSAurora.IOS_scoring_history_staging", ios)
- //rename staging tables
- AthenaDB.renameTable("PSAurora.TMO_scoring_history_staging", "PSAurora.TMO_scoring_history_final")
- AthenaDB.renameTable("PSAurora.IOS_scoring_history_staging", "PSAurora.IOS_scoring_history_final")
- AthenaQueue.notifySQS(???)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement