title |
---|
Amazon Athena |
To add a database connection, click on the gear icon in the top right, and navigate to Admin settings > Databases > Add a database.
After connecting to a database, you'll see the "Connection and sync" section that displays the current connection status and options to manage your database connection.
Here you can sync the database schema and rescan field values, and edit connection details.
You can edit these settings at any time (and remember to save your changes).
The display name for the database in the Metabase interface.
The AWS region where your database is hosted, for Amazon Athena. For example, you might enter us-east-1
.
AWS workgroup. For example: primary
. See documentation on workgroups.
This S3 staging directory must be in the same region you specify above.
Part of IAM credentials for AWS. Metabase will encrypt these credentials.
If you're running Metabase on AWS and want to use AWS Default Credentials Chain, leave the Access and Secret keys blank.
See also our notes on connecting to Athena.
Part of IAM credentials for AWS. Metabase will encrypt these credentials.
You can specify additional options via a string, e.g., UseResultsetStreaming=0;LogLevel=6
.
This can be useful for auditing and debugging, but prevents databases from caching results and may increase your costs. Enable this feature if you need to track which users are running specific queries.
Turn this option OFF if people want to click Run (the play button) before applying any Summarize or filter selections.
By default, Metabase will execute a query as soon as you choose an grouping option from the Summarize menu or a filter condition from the drill-through menu. If your database is slow, you may want to disable re-running to avoid loading data on each click.
See syncs and scans.
Periodic refingerprinting will increase the load on your database.
Turn this option ON to scan a sample of values every time Metabase runs a sync.
A fingerprinting query examines the first 10,000 rows from each column and uses that data to guesstimate how many unique values each column has, what the minimum and maximum values are for numeric and timestamp columns, and so on. If you leave this option OFF, Metabase will only fingerprint your columns once during setup.
If you use other AWS services, we recommend that you create a special AWS Service Account that only has the permissions required to run Athena, and input the IAM credentials from that account to connect Metabase to Athena.
See Identity and access management in Athena.
If you're running Metabase on AWS and want to use AWS Default Credentials Chain, leave the Access and Secret keys blank.
In both cases, the Athena driver will automatically fetch session credentials based on which IAM role you've configured.
Most issues that we see when people attempt to connect to AWS Athena involve permissions. Querying AWS Athena requires permissions to:
This policy provides read-only permissions for data in S3. You'll need to specify any S3 buckets that you want Metabase to be able to query from as well as the S3 bucket provided as part of the configuration where results are written to.
There may be additional permissions required for other Athena functionality, like federated queries. For details, check out the Athena docs.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Athena",
"Effect": "Allow",
"Action": [
"athena:BatchGetNamedQuery",
"athena:BatchGetQueryExecution",
"athena:GetNamedQuery",
"athena:GetQueryExecution",
"athena:GetQueryResults",
"athena:GetQueryResultsStream",
"athena:GetWorkGroup",
"athena:ListDatabases",
"athena:ListDataCatalogs",
"athena:ListNamedQueries",
"athena:ListQueryExecutions",
"athena:ListTagsForResource",
"athena:ListWorkGroups",
"athena:ListTableMetadata",
"athena:StartQueryExecution",
"athena:StopQueryExecution",
"athena:CreatePreparedStatement",
"athena:DeletePreparedStatement",
"athena:GetPreparedStatement",
"athena:GetTableMetadata"
],
"Resource": "*"
},
{
"Sid": "Glue",
"Effect": "Allow",
"Action": [
"glue:BatchGetPartition",
"glue:GetDatabase",
"glue:GetDatabases",
"glue:GetPartition",
"glue:GetPartitions",
"glue:GetTable",
"glue:GetTables",
"glue:GetTableVersion",
"glue:GetTableVersions"
],
"Resource": "*"
},
{
"Sid": "S3ReadAccess",
"Effect": "Allow",
"Action": ["s3:GetObject", "s3:ListBucket", "s3:GetBucketLocation"],
"Resource": [
"arn:aws:s3:::bucket1",
"arn:aws:s3:::bucket1/*",
"arn:aws:s3:::bucket2",
"arn:aws:s3:::bucket2/*"
]
},
{
"Sid": "AthenaResultsBucket",
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:AbortMultipartUpload",
"s3:ListBucket",
"s3:GetBucketLocation"
],
"Resource": ["arn:aws:s3:::bucket2", "arn:aws:s3:::bucket2/*"]
}
]
}
If Metabase also needs to create tables, you'll need additional AWS Glue permissions. The "Resource": "*"
key-value pair gives the account Delete and Update permissions to any table:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"glue:BatchCreatePartition",
"glue:UpdateDatabase",
"glue:DeleteDatabase",
"glue:CreateTable",
"glue:CreateDatabase",
"glue:UpdateTable",
"glue:BatchDeletePartition",
"glue:BatchDeleteTable",
"glue:DeleteTable",
"glue:CreatePartition",
"glue:DeletePartition",
"glue:UpdatePartition",
"glue:GetCatalogImportStatus"
],
"Resource": "*"
}
]
}
There aren't (yet) any model features available for Athena.
See Danger Zone.
Вы можете оставить комментарий после Вход в систему
Неприемлемый контент может быть отображен здесь и не будет показан на странице. Вы можете проверить и изменить его с помощью соответствующей функции редактирования.
Если вы подтверждаете, что содержание не содержит непристойной лексики/перенаправления на рекламу/насилия/вульгарной порнографии/нарушений/пиратства/ложного/незначительного или незаконного контента, связанного с национальными законами и предписаниями, вы можете нажать «Отправить» для подачи апелляции, и мы обработаем ее как можно скорее.
Опубликовать ( 0 )