LoginSignup
0
0

More than 1 year has passed since last update.

Athena で S3 Glacier で復元されたデータのクエリを実行する

Posted at

内容

  • Athena を使用して Glacier Flexible Retrieval ストレージクラスと Deep Archive ストレージクラスで復元されたデータを直接クエリできるようになった。

  • 今までは、標準ストレージクラスにデータをコピーする必要があった。

  • S3 スタンダード に保存されている最新のログと S3 Glacier Flexible Retrieval に復元された古いログを組み合わせると、1 つのクエリでストレージクラス全体のログ分析を実行することも可能。

やってみる

サンプルデータの準備 

S3 にサンプルデータをアップロードしておき、Glueクローラでテーブルを準備しておきます。
スクリーンショット 2023-07-25 19.38.16.png

ストレージクラス:スタンダードでの動作確認

とりあえず、ストレージクラス:スタンダードで通常通り Athena からクエリし動作を確認しておきます。

SELECT * FROM "<database name>"."<table name>" limit 10;

スクリーンショット 2023-07-25 19.49.17.png

ストレージクラス:Glacier Flexible Retrieva への変更

S3 でストレージクラス:Gacier Flexible Retrieva に変更します。
スクリーンショット 2023-07-25 19.50.59.png

テーブルプロパティの変更

ALTER TABLE SET TBLPROPERTIES コマンドを使用してテーブルプロパティを設定しておく必要があります。

ALTER TABLE table_name SET TBLPROPERTIES ('read_restored_glacier_objects' = 'true')

S3 で復元を開始

S3 で復元を開始してあげます。
スクリーンショット 2023-07-25 20.07.31.png

ストレージクラス:Glacier Flexible Retrieva での動作確認

同じようにストレージクラス:Gacier Flexible Retrieva で通常通り Athena からクエリし動作を確認します。

SELECT * FROM "<database name>"."<table name>" limit 10;

スクリーンショット 2023-07-27 18.20.30.png

0
0
0

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
0
0