Looker는 표준 SQL을 사용하여 Amazon S3에서 데이터를 쉽게 분석할 수 있는 대화형 쿼리 서비스인 Amazon Athena에 대한 연결을 지원합니다. Amazon Athena는 서버리스이므로 관리할 인프라가 없습니다. 실행된 쿼리에 대해서만 비용이 청구됩니다.
네트워크 트래픽 암호화
Looker 애플리케이션과 데이터베이스 사이에 네트워크 트래픽을 암호화하는 것이 가장 좋습니다. 안전한 데이터베이스 액세스 사용 설정 문서 페이지에 설명된 옵션 중 하나를 고려해 보세요.
Amazon Athena 연결 구성
이 페이지에서는 Looker를 Amazon Athena 인스턴스에 연결하는 방법을 설명합니다.
다음 항목이 준비되었는지 확인하세요.
Amazon AWS 액세스 키 쌍
Amazon Athena를 사용하여 Looker에서 쿼리하려는 데이터가 포함된 S3 버킷. Amazon AWS 액세스 키는 이 버킷에 대한 읽기/쓰기 액세스 권한이 있어야 합니다.
Amazon Athena에는 역할 또는 권한 세트와 방화벽 규칙을 통해 이 S3 버킷에 액세스할 수 있어야 합니다. Looker IP의 S3 버킷에 보안 규칙을 추가하지 마세요. 그렇지 않으면 S3 버킷에 대한 Amazon Athena의 액세스가 의도치 않게 차단될 수 있습니다. Amazon Athena 이외의 다른 언어의 경우 보안 데이터베이스 액세스 사용 설정 문서 페이지에 설명된 대로 IP 허용 목록을 사용하여 네트워크 계층의 데이터에 대한 액세스를 제한해야 할 수 있습니다.
Amazon Athena 인스턴스 데이터가 위치한 곳에 대한 지식. 리전 이름은 Amazon 콘솔의 온른쪽 상단에 있습니다.
Looker의 관리 섹션에서 연결을 선택한 후 연결 추가를 클릭합니다.
연결 세부정보를 작성합니다.
이름: 연결 이름을 지정합니다. LookML 프로젝트에서 연결을 참조하는 방법은 다음과 같습니다.
언어: Amazon Athena를 선택합니다.
호스트 및 포트: JDBC URL 형식에 관한 Athena 문서에 설명된 대로 호스트 이름과 포트를 지정합니다. 호스트는 유효한 Amazon 엔드포인트(예: athena.eu-west-1.amazonaws.com)여야 하며 포트는 443에 있어야 합니다. Athena를 지원하는 최신 엔드포인트 목록은 이 AWS 일반 참조 페이지에서 찾을 수 있습니다.
데이터베이스: 모델링할 기본 데이터베이스를 지정합니다. 다른 데이터베이스에 액세스할 수 있지만 Looker는 이 데이터베이스를 기본 데이터베이스로 취급합니다.
사용자 이름: AWS 액세스 키 ID를 지정합니다.
비밀번호: AWS 보안 비밀 액세스 키를 지정합니다.
PDT 사용 설정: 이 전환을 사용하여 영구 파생 테이블(PDT)을 사용 설정합니다. PDT를 사용 설정하면 추가 PDT 필드와 연결에 대한 PDT 재정의 섹션이 표시됩니다.
임시 데이터베이스: Looker가 PDT를 작성할 S3 버킷의 출력 디렉터리 이름을 지정합니다. 출력 디렉터리에 대한 전체 경로를 추가 JDBC 매개변수 필드에 지정해야 합니다. 이 페이지에서 쿼리 결과 출력 및 PDT의 S3 버킷 지정을 참조하세요.
최대 PDT 빌더 연결 수: 이 연결에 가능한 동시 PDT 빌드 수를 지정합니다. 이 값을 너무 높게 설정하면 쿼리 시간에 부정적인 영향을 줄 수 있습니다. 자세한 내용은 데이터베이스에 Looker 연결 문서 페이지를 참조하세요.
추가 JDBC 매개변수: 이 연결의 추가 매개변수를 지정합니다.
s3_staging_dir 매개변수는 Looker가 쿼리 결과 출력 및 PDT에 사용할 S3 버킷입니다. 이 페이지에서 쿼리 결과 출력 및 PDT의 S3 버킷 지정을 참조하세요.
스트리밍 결과에 대한 플래그입니다. Athena 사용자에게 연결된 athena:GetQueryResultsStream 정책이 있으면 추가 JDBC 매개변수 끝에 ;UseResultsetStreaming=1을 추가하여 대규모 결과 집합의 추출 성능을 크게 향상시킬 수 있습니다. 이 매개변수는 기본적으로 0으로 설정됩니다.
JDBC 연결 문자열에 추가할 선택적인 추가 매개변수입니다.
SSL: 무시합니다. 기본적으로 AWS API에 대한 모든 연결이 암호화됩니다.
노드당 최대 연결: 기본적으로 5로 설정됩니다. Looker가 Athena에서 실행되는 기본 쿼리 엔진이면 이를 최대 20까지 늘릴 수 있습니다. 서비스 한도에 대한 자세한 내용은 Athena 서비스 한도 문서를 참조하세요. 자세한 내용은 데이터베이스에 Looker 연결 문서 페이지를 참조하세요.
연결 풀 제한 시간: 연결 풀 제한 시간을 지정합니다. 기본적으로 제한 시간은 120초로 설정됩니다. 자세한 내용은 데이터베이스에 Looker 연결 문서 페이지를 참조하세요.
SQL Runner 사전 캐시: 테이블이 선택된 경우에만 SQL Runner가 테이블 정보를 로드하도록 하려면 이 옵션을 선택 해제합니다. 자세한 내용은 데이터베이스에 Looker 연결 문서 페이지를 참조하세요.
데이터베이스 시간대: 데이터베이스에 사용되는 시간대를 지정합니다. 시간대 변환을 원하지 않으면 이 필드를 비워 둡니다. 자세한 내용은 시간대 설정 사용 문서 페이지를 참조하세요.
제대로 연결되었는지 확인하려면 테스트를 클릭합니다. 문제 해결 정보는 데이터베이스 연결 테스트 문서 페이지를 참조하세요.
이러한 설정을 저장하려면 연결을 클릭합니다.
쿼리 결과 출력 및 PDT에 S3 버킷 지정
연결 페이지의 추가 JDBC 매개변수 필드를 사용하여 Looker에서 쿼리 결과 출력을 저장하는 데 사용할 S3 버킷의 경로를 구성하고, Looker에서 PDT를 작성할 S3 버킷의 출력 디렉터리 이름을 지정합니다. s3_staging_dir 매개변수를 사용하여 이 정보를 지정합니다.
s3_staging_dir JDBC 매개변수는 Athena JDBC 연결에 필요한 Amazon Athena S3OutputLocation 속성을 구성하기 위한 대체 방법입니다. 자세한 내용과 사용 가능한 모든 JDBC 드라이버 옵션 목록을 보려면 JDBC 드라이버 옵션에 대한 Athena 문서를 참조하세요.
추가 JDBC 매개변수 필드에서 다음 형식을 사용하여 s3_staging_dir 매개변수를 지정합니다.
`s3_staging_dir=s3://<s3-bucket>/<output-path>`
각 항목의 의미는 다음과 같습니다.
<s3-bucket>은 S3 버킷의 이름입니다.
<output-path>는 Looker가 쿼리 결과 출력을 작성하는 경로입니다.
AWS 액세스 키 쌍에는 <s3-bucket> 디렉터리에 대한 쓰기 권한이 있어야 합니다.
Looker가 PDT를 기록할 디렉터리를 구성하려면 임시 데이터베이스 필드에서 S3 버킷의 디렉터리 경로를 입력합니다.
예를 들어 Looker가 PDT를 s3://<s3-bucket>/looker_scratch에 기록하도록 하려면 임시 데이터베이스 필드에 이를 입력합니다.
`looker_scratch`
디렉터리 경로만 입력합니다. Looker는 추가 JDBC 매개변수 필드에 입력하는 s3_staging_dir 매개변수에서 S3 버킷 이름을 가져옵니다.
S3 버킷 고려사항
지정된 S3 버킷에서 불필요한 파일을 주기적으로 정리하도록 Amazon S3 객체 수명 주기를 구성하는 것이 좋습니다. 그 이유는 다음과 같습니다.
Athena는 모든 쿼리의 쿼리 결과를 S3 버킷에 저장합니다. Athena 쿼리를 참조하세요.
PDT가 사용 설정되었으면 PDT를 빌드할 때 생성된 테이블에 대한 메타데이터가 S3 버킷에 저장됩니다.
Amazon은 디버깅 연결을 위해 LogLevel 및 LogPath JDBC 드라이버 옵션을 제공합니다. 이를 사용하려면 ;LogLevel=DEBUG;LogPath=/tmp/athena_debug.log를 추가 JDBC 매개변수 필드 끝에 추가하고 연결을 다시 테스트합니다.
Looker가 인스턴스를 호스팅하는 경우 디버깅을 계속하기 위해서는 Looker 지원팀 또는 해당 분석가가 이 파일을 검색해야 합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-18(UTC)"],[],[],null,["# Amazon Athena\n\nLooker supports connections to [Amazon Athena](https://aws.amazon.com/athena/), an interactive query service that makes it easy to analyze data in Amazon S3 using standard SQL. Amazon Athena is serverless, so there is no infrastructure to manage. You are charged only for the queries that are run.\n\nEncrypting network traffic\n--------------------------\n\nIt is a best practice to encrypt network traffic between the Looker application and your database. Consider one of the options described on the [Enabling secure database access](/looker/docs/enabling-secure-db-access) documentation page.\n\nConfiguring an Amazon Athena connection\n---------------------------------------\n\nThis page describes how to connect Looker to an Amazon Athena instance.\n\n1. Ensure that you have the following:\n\n - A pair of Amazon AWS access keys.\n - The S3 bucket containing the data you want to query in Looker with Amazon Athena. The Amazon AWS access keys must have read-write access to this bucket.\n\n \u003e Amazon Athena must have access to this S3 bucket by either a role or a permission set, as well as by firewall rules. Do not add security rules to the S3 bucket for Looker's IP, since this can inadvertently block Amazon Athena's access to the S3 bucket. (For other dialects besides Amazon Athena, users may want to limit access to the data from the network layer with an IP allowlist, as described on the [Enabling secure database access](/looker/docs/enabling-secure-db-access) documentation page.)\n - Knowledge of where your Amazon Athena instance data is located. The region name can be found in the upper right-hand portion of the Amazon Console.\n\n2. In the **Admin** section of Looker, select **Connections** , and then click **Add Connection**.\n\n3. Fill out the connection details:\n\n | **Note:** The [Simba Athena JDBC Driver with SQL Connector Installation and Configuration Guide](https://s3.amazonaws.com/athena-downloads/drivers/JDBC/SimbaAthenaJDBC_2.0.2/docs/Simba+Athena+JDBC+Driver+Install+and+Configuration+Guide.pdf) provides more details about custom JDBC configurations and other configuration information.\n - **Name**: Specify the name of the connection. This is how you will refer to the connection in LookML projects.\n - **Dialect** : Select **Amazon Athena**.\n - **Host** and **Port** : Specify the name of the host and port as described in the [Athena documentation on the JDBC URL format](http://docs.aws.amazon.com/athena/latest/ug/connect-with-jdbc.html#jdbc-url-format). The host should be a valid Amazon endpoint (like `athena.eu-west-1.amazonaws.com`), and the port should stay at `443`. An up-to-date list of endpoints that support Athena can be found on this [AWS General Reference](http://docs.aws.amazon.com/general/latest/gr/rande.html#athena) page.\n - **Database**: Specify the default database that you would like modeled. Other databases can be accessed, but Looker treats this database as the default database.\n - **Username**: Specify the AWS access key ID.\n - **Password**: Specify the AWS secret access key.\n - **Enable PDTs** : Use this toggle to enable [persistent derived tables (PDTs)](/looker/docs/derived-tables#persistent-derived-tables). Enabling PDTs reveals additional PDT fields and the [**PDT Overrides**](/looker/docs/connecting-to-your-db#pdt-overrides) section for the connection.\n - **Temp Database** : Specify the name of the output directory in your S3 bucket where you want Looker to write your PDTs. The full path to your output directory must be specified in the **Additional JDBC parameters** field; see the [Specifying your S3 bucket for query results output and PDTs](#staging_bucket) section on this page.\n - **Max number of PDT builder connections** : Specify the number of possible concurrent PDT builds on this connection. Setting this value too high could negatively impact query times. For more information, see the [Connecting Looker to your database](/looker/docs/connecting-to-your-db#max_pdt_builder_connections) documentation page.\n - **Additional JDBC parameters** : Specify additional parameters for the connection:\n - The `s3_staging_dir` parameter is the S3 bucket that Looker should use for query results output and PDTs; see the [Specifying Your S3 bucket for query results output and PDTs](#staging_bucket) section on this page.\n - Flag for streaming results. If you have the [`athena:GetQueryResultsStream` policy](https://docs.aws.amazon.com/athena/latest/ug/connect-with-jdbc.html#migration-from-previous-jdbc-driver) attached to your Athena user, you can add `;UseResultsetStreaming=1` to the end of your additional JDBC parameterss to significantly improve the performance of large result set extraction. This parameter is set to `0` by default.\n - Optional additional parameters to add to the JDBC connection string.\n - **SSL**: Ignore; by default, all connections to the AWS API will be encrypted.\n - **Max connections per node** : By default, this is set to 5. You can increase this up to 20 if Looker is the main query engine running against Athena. See [the Athena service limits documentation](http://docs.aws.amazon.com/athena/latest/ug/service-limits.html) for more details about the service limits. See the [Connecting Looker to your database](/looker/docs/connecting-to-your-db#max_connections) documentation page for more information.\n - **Connection Pool Timeout** : Specify the connection pool timeout. By default, the timeout is set to 120 seconds. See the [Connecting Looker to your database](/looker/docs/connecting-to-your-db#connection_pool_timeout) documentation page for more information.\n - **SQL Runner Precache** : Unselect this option if you prefer SQL Runner to load table information only when a table is selected. See the [Connecting Looker to your database](/looker/docs/connecting-to-your-db#sql_runner_precache) documentation page for more information.\n - **Database Time Zone** : Specify the time zone used in the database. Leave this field blank if you do not want time zone conversion. See the [Using time zone settings](/looker/docs/using-time-zone-settings) documentation page for more information.\n\nTo verify that the connection is successful, click **Test** . See the [Testing database connectivity](/looker/docs/testing-db-connectivity) documentation page for troubleshooting information.\n\nTo save these settings, click **Connect**.\n\nSpecifying your S3 bucket for query results output and PDTs\n-----------------------------------------------------------\n\nUse the [**Additional JDBC parameters**](#additional_params) field of the **Connections** page to configure the path to the S3 bucket that Looker will use for storing query results output, and to specify the name of the output directory in the S3 bucket where you want Looker to write PDTs. Specify this information using the `s3_staging_dir` parameter.\n\nThe `s3_staging_dir` JDBC parameter is an alternative way to configure the Amazon Athena `S3OutputLocation` property, which is required for Athena JDBC connections. See [the Athena documentation on JDBC Driver Options](http://docs.aws.amazon.com/athena/latest/ug/connect-with-jdbc.html#jdbc-options) for more information and a list of all available JDBC driver options.\n\nIn the **Additional JDBC parameters** field, specify the `s3_staging_dir` parameter using the following format: \n\n `s3_staging_dir=s3://\u003cs3-bucket\u003e/\u003coutput-path\u003e`\n\nWhere:\n\n- `\u003cs3-bucket\u003e` is the name of the S3 bucket.\n- `\u003coutput-path\u003e` is the path where Looker will write query results output.\n\n\u003e The AWS access key pair must have write permissions to the `\u003cs3-bucket\u003e` directory.\n\nTo configure the directory where Looker will write PDTs, enter the *path of the directory in the S3 bucket* in the **Temp Database** field.\nFor example, if you want Looker to write PDTs into `s3://\u003cs3-bucket\u003e/looker_scratch`, then enter this in the **Temp Database** field: \n\n `looker_scratch`\n\nOnly enter the *path of the directory* . Looker gets the S3 bucket name from the `s3_staging_dir` parameter that you enter in the **Additional JDBC Parameters** field.\n\n### S3 bucket considerations\n\nIt is recommended that you configure [Amazon S3 object lifecycles](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html#lifecycle-config-overview-what) to periodically clean out unneeded files in your specified S3 bucket. There are reasons for this:\n\n- Athena stores query results for every query in an S3 bucket. See [Athena Querying](https://docs.aws.amazon.com/athena/latest/ug/querying.html#querying-identifying-output-files).\n- If you have PDTs enabled, when a PDT is built, metadata about the created table is stored in the S3 bucket.\n\nResources\n---------\n\n- [Amazon Athena documentation](http://docs.aws.amazon.com/athena/latest/ug/what-is.html)\n- [Amazon Web Services Console for Athena](https://console.aws.amazon.com/athena/home) (requires an AWS login)\n- [Amazon Athena SQL and HiveQL reference](https://docs.aws.amazon.com/athena/latest/ug/ddl-sql-reference.html)\n\nDebugging\n---------\n\nAmazon provides `LogLevel` and `LogPath` JDBC driver options for debugging connections. To use them, add `;LogLevel=DEBUG;LogPath=/tmp/athena_debug.log` to the end of the **Additional JDBC Parameters** field and test the connection again.\n\nIf Looker is hosting the instance, then Looker Support or your analyst will need to retrieve this file to continue debugging.\n\nFeature support\n---------------\n\nFor Looker to support some features, your database dialect must also support them.\n\nAmazon Athena supports the following features as of Looker 25.14:\n\nNext steps\n----------\n\nAfter you have completed the database connection, [configure authentication options](/looker/docs/getting-started-with-users)."]]