> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Amazon Athena query results

> Read the results of one completed Athena query into an installation.

Run a query beginning with SELECT in Athena before installing the source. Alias every result column
with a distinct SQL identifier and include one stable, unique, non-null key
column. Use one [REST mount](https://docs.bijection.com/integrations/native-rest.md#mount-and-bind) for this
execution.

```ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
const provider = providerEndpoint(
  "athena.query-results.rows",
  "https://athena.us-east-1.amazonaws.com", "/",
  { kind: "awsSigV4", service: "athena", region: "us-east-1", secret: session }, data,
);
```

Seal the AWS session for this receiver. Grant `athena:GetQueryExecution`,
`athena:GetQueryResults` and the result-location permissions Athena requires,
including scoped S3 `GetObject` for customer-managed results. Keep the result
object immutable for the lifetime of the traversal. Pass `provider` as `receivers.provider`, and the same label to the binder and as the app's `data`.
Initialize with the completed query's execution ID.

```ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
{ profile: { mode: "provider", provider: "athena.query-results.rows",
  selection: "4393e8ea-b4de-46ba-bbc4-de926d5bfc0a", fields: ["id"], limit: 16 } }
```

The feed first checks the execution ID, successful status and SELECT type.
It accepts up to 24 columns, 32 data rows and 36 KiB per data page. Athena
cells land as text or null. The first reply carries the column header. Each
successful page commits the execution-scoped next token with the rows. The feed
completes when the token is absent and keeps prior keys. If the result expires
before completion, use a fresh mount for a replacement execution. This mode
reads results of work submitted in Athena.

[Athena GetQueryExecution API](https://docs.aws.amazon.com/athena/latest/APIReference/API_GetQueryExecution.html) ·
[Athena GetQueryResults API](https://docs.aws.amazon.com/athena/latest/APIReference/API_GetQueryResults.html)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.