2
0

More than 3 years have passed since last update.

AWS Glueジョブが毎回データ元を全部読み込むから重複データが出来まくりなのをやめたい

Posted at

はじめに

AWS Glue便利ですね!
Athenaのパーティション使いながら元データ加工してInsertが簡単に出来ちゃうので、ビックデータ扱うのには便利です。
でも、何も考えずに設定すると全ファイルを毎回読み込むため、ジョブを実行するたびにデータが重複していきます。

なので、前回までの処理を記憶して、新規ファイルだけジョブ実行してもらうための設定を記載します。

削除は出来なさそう。更新も出来ない

基本的にAthenaはInsertしか出来ません。
UpdateだったりDeleteだったりは出来ません。
Deleteはファイルだったり行消しちゃえばできるといえばできるので、正確ではない表現です。

ジョブブックマークを設定するのです

ジョブ作成する際に詳細プロパティ内にあるジョブブックマークを有効化するだけです。
こうすることで処理済みデータを記憶してくれるので、実行済みのデータは無視するようになります。

参考URL

https://docs.aws.amazon.com/ja_jp/glue/latest/dg/monitor-continuations.html
https://stackoverflow.com/questions/46228253/aws-glue-to-redshift-is-it-possible-to-replace-update-or-delete-data

2
0
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0