

# 복원된 Amazon Glacier 객체 쿼리
<a name="querying-glacier"></a>

Athena를 사용하여 Amazon Glacier Flexible Retrieval(이전의 Glacier) 및 Amazon Glacier Deep Archive [Amazon S3 스토리지 클래스](https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-class-intro.html#sc-glacier)로부터 복원된 객체를 쿼리할 수 있습니다. 이 기능은 테이블별로 활성화해야 합니다. 쿼리를 실행하기 전에 테이블에서 이 기능을 활성화하지 않으면 Athena는 쿼리 실행 중에 테이블의 Amazon Glacier Flexible Retrieval 및 Amazon Glacier Deep Archive 객체를 모두 건너뜁니다.

## 고려 사항 및 제한
<a name="querying-glacier-considerations-and-limitations"></a>
+  복원된 Amazon Glacier 객체 쿼리는 Athena 엔진 버전 3에서만 지원됩니다.
+  이 기능은 Apache Hive 테이블에서만 지원됩니다.
+  데이터를 쿼리하기 전에 객체를 복원해야 합니다. Athena는 자동으로 객체를 복원하지 않습니다.

## 복원된 객체를 사용하도록 테이블 구성
<a name="querying-glacier-configuring-a-table-to-use-restored-objects"></a>

 복원된 객체를 쿼리에 포함하도록 Athena 테이블을 구성하려면 `read_restored_glacier_objects` 테이블 속성을 `true`로 설정해야 합니다. 이 작업을 수행하기 위해 Athena 쿼리 편집기 또는 AWS Glue 콘솔을 사용할 수 있습니다. [AWS Glue CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/glue/update-table.html), [AWS Glue API](https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-catalog-tables.html#aws-glue-api-catalog-tables-UpdateTable) 또는 [AWS Glue SDK](https://docs.aws.amazon.com/glue/latest/dg/sdk-general-information-section.html)도 사용할 수 있습니다.

### Athena 쿼리 편집기 사용
<a name="querying-glacier-using-the-athena-query-editor"></a>

 Athena에서는 다음 예제와 같이 [ALTER TABLE SET TBLPROPERTIES](alter-table-set-tblproperties.md) 명령을 사용하여 테이블 속성을 설정할 수 있습니다.

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

### AWS Glue 콘솔을 사용합니다.
<a name="querying-glacier-using-the-aws-glue-console"></a>

 AWS Glue 콘솔에서 다음 단계를 수행하여 `read_restored_glacier_objects` 테이블 속성을 추가합니다.

**AWS Glue 콘솔에서 테이블 속성을 구성하려면**

1. AWS Management Console에 로그인하여 [https://console.aws.amazon.com/glue/](https://console.aws.amazon.com/glue/)에서 AWS Glue 콘솔을 엽니다.

1. 다음 중 하나를 수행하세요.
   + **데이터 카탈로그로 이동**을 선택합니다.
   + 탐색 창의 **데이터 카탈로그 테이블**을 선택합니다.

1. **테이블** 페이지의 테이블 목록에서 편집하려는 테이블에 대한 링크를 선택합니다.

1. **Actions**(작업), **Edit table**(테이블 편집)을 선택합니다.

1. **테이블 편집** 페이지의 **테이블 속성** 섹션에서 다음 키 값 페어를 추가합니다.
   + **키**에 `read_restored_glacier_objects`을 추가합니다.
   + **값**에 `true`을(를) 입력합니다.

1. **저장**을 선택합니다.

### AWS CLI 사용
<a name="querying-glacier-using-the-aws-cli"></a>

 AWS CLI에서 AWS Glue [update-table](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/glue/update-table.html) 명령과 해당 `--table-input` 인수를 사용하여 테이블을 재정의하고 이에 따라 `read_restored_glacier_objects` 속성을 추가할 수 있습니다. `--table-input` 인수에서 `Parameters` 구조를 사용하여 `read_restored_glacier_objects` 속성과 `true`의 값을 지정합니다. `--table-input`의 인수에는 공백이 없어야 하며 큰따옴표를 이스케이프 처리하려는 경우 백슬래시를 사용해야 합니다. 다음 예제에서는 *my\$1database* 및 *my\$1table*을 사용자의 데이터베이스 및 테이블 이름으로 바꿉니다.

```
aws glue update-table \
   --database-name my_database \
   --table-input={\"Name\":\"my_table\",\"Parameters\":{\"read_restored_glacier_objects\":\"true\"}}
```

**중요**  
AWS Glue `update-table` 명령은 덮어쓰기 모드에서 작동합니다. 따라서 기존 테이블 정의를 `table-input` 파라미터로 지정된 새 정의로 바꿉니다. 이런 이유로 `read_restored_glacier_objects` 속성을 추가할 때 `table-input` 파라미터에서 테이블에 포함하려는 모든 필드를 지정해야 합니다.