Seleccione sus preferencias de cookies

Usamos cookies esenciales y herramientas similares que son necesarias para proporcionar nuestro sitio y nuestros servicios. Usamos cookies de rendimiento para recopilar estadísticas anónimas para que podamos entender cómo los clientes usan nuestro sitio y hacer mejoras. Las cookies esenciales no se pueden desactivar, pero puede hacer clic en “Personalizar” o “Rechazar” para rechazar las cookies de rendimiento.

Si está de acuerdo, AWS y los terceros aprobados también utilizarán cookies para proporcionar características útiles del sitio, recordar sus preferencias y mostrar contenido relevante, incluida publicidad relevante. Para aceptar o rechazar todas las cookies no esenciales, haga clic en “Aceptar” o “Rechazar”. Para elegir opciones más detalladas, haga clic en “Personalizar”.

AWS::Athena::NamedQuery

Modo de enfoque
AWS::Athena::NamedQuery - AWS CloudFormation
Esta página no se ha traducido a su idioma. Solicitar traducción
Filtrar vista

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

En esta página

PrivacidadTérminos del sitioPreferencias de cookies
© 2025, Amazon Web Services, Inc o sus afiliados. Todos los derechos reservados.