Selecione suas preferências de cookies

Usamos cookies essenciais e ferramentas semelhantes que são necessárias para fornecer nosso site e serviços. Usamos cookies de desempenho para coletar estatísticas anônimas, para que possamos entender como os clientes usam nosso site e fazer as devidas melhorias. Cookies essenciais não podem ser desativados, mas você pode clicar em “Personalizar” ou “Recusar” para recusar cookies de desempenho.

Se você concordar, a AWS e terceiros aprovados também usarão cookies para fornecer recursos úteis do site, lembrar suas preferências e exibir conteúdo relevante, incluindo publicidade relevante. Para aceitar ou recusar todos os cookies não essenciais, clique em “Aceitar” ou “Recusar”. Para fazer escolhas mais detalhadas, clique em “Personalizar”.

AWS::Athena::NamedQuery

Modo de foco
AWS::Athena::NamedQuery - AWS CloudFormation
Esta página não foi traduzida para seu idioma. Solicitar tradução
Filtrar visualização

The AWS::Athena::NamedQuery resource specifies an Amazon Athena saved query, where QueryString contains the SQL query statements that make up the query.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::Athena::NamedQuery", "Properties" : { "Database" : String, "Description" : String, "Name" : String, "QueryString" : String, "WorkGroup" : String } }

YAML

Type: AWS::Athena::NamedQuery Properties: Database: String Description: String Name: String QueryString: String WorkGroup: String

Properties

Database

The database to which the query belongs.

Required: Yes

Type: String

Minimum: 1

Maximum: 255

Update requires: Replacement

Description

The query description.

Required: No

Type: String

Minimum: 1

Maximum: 1024

Update requires: Replacement

Name

The query name.

Required: No

Type: String

Minimum: 1

Maximum: 128

Update requires: Replacement

QueryString

The SQL statements that make up the query.

Required: Yes

Type: String

Minimum: 1

Maximum: 262144

Update requires: Replacement

WorkGroup

The name of the workgroup that contains the named query.

Required: No

Type: String

Minimum: 1

Maximum: 128

Update requires: Replacement

Return values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the resource name.

For more information about using the Ref function, see Ref.

Fn::GetAtt

The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.

NamedQueryId

The unique ID of the query.

Examples

Create a named query

The following example creates a named query.

JSON

{ "Resources": { "AthenaNamedQuery": { "Type": "AWS::Athena::NamedQuery", "Properties": { "Database": "swfmetadata", "Description": "A query that selects all aggregated data", "Name": "MostExpensiveWorkflow", "QueryString": "SELECT workflowname, AVG(activitytaskstarted) AS AverageWorkflow FROM swfmetadata WHERE year='17' AND GROUP BY workflowname ORDER BY AverageWorkflow DESC LIMIT 10" } } } }

YAML

Resources: AthenaNamedQuery: Type: AWS::Athena::NamedQuery Properties: Database: "swfmetadata" Description: "A query that selects all aggregated data" Name: "MostExpensiveWorkflow" QueryString: > SELECT workflowname, AVG(activitytaskstarted) AS AverageWorkflow FROM swfmetadata WHERE year='17' AND GROUP BY workflowname ORDER BY AverageWorkflow DESC LIMIT 10

Nesta página

PrivacidadeTermos do sitePreferências de cookies
© 2025, Amazon Web Services, Inc. ou suas afiliadas. Todos os direitos reservados.