Amazon Athena에서 LakeFormation에 등록된 한글명 위치를 external_location로 지정할 때 발생되는 문제를 회피하기 위한 방법을 설명합니다.
전제 조건
- AWS LakeFormation : Administration -> Data lake locations에 한글이 포함된 위치를 지정

문제 재현
1. Athena External table 생성 : 성공
--LakeFormation Data lake locations : s3://lf-data-lake-012345678912/ctas_dl_tpc_customer_한글_1
CREATE TABLE "ctas_dl_tpc_customer_한글_1"
WITH (
format = 'PARQUET',
external_location = 's3://lf-data-lake-012345678912/ctas_dl_tpc_customer_한글_1/'
)
AS SELECT * FROM tpc.dl_tpc_customer limit 100;
2. Athena External table 조회 : 오류
HIVE_UNKNOWN_ERROR: com.amazonaws.services.lakeformation.model.InvalidInputException: Invalid S3 resource
문제 회피 방법
AWS LakeFormation Data lake locations에 등록되지 않은 S3 위치에 Athena External table을 생성합니다.
1. Athena External table 생성 : 성공
--s3://aws-glue-datalake는 LakeFormation data lake locations로 등록되지 않은 위치
CREATE TABLE "ctas_dl_tpc_customer_한글_2"
WITH (
format = 'PARQUET',
external_location = 's3://aws-glue-datalake/ctas_dl_tpc_customer_한글_2/'
)
AS SELECT * FROM tpc.dl_tpc_customer limit 100;
2. Athena External table 조회 : 성공
select * from "tpc"."ctas_dl_tpc_customer_한글_2";