はじめに
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