Querying configured tables using the SQL code editor
As a member who can query, you can build a query manually by writing SQL code in the SQL code editor. The SQL code editor is located in the Analysis section of the Queries tab in the AWS Clean Rooms console.
The SQL code editor is displayed by default. If you want to use the analysis builder to build queries, see Querying with the analysis builder.
Important
If you start writing a SQL query in the code editor and then turn on the Analysis builder UI, your query isn't saved.
AWS Clean Rooms supports many SQL commands, functions, and conditions. For more information, see the AWS Clean Rooms SQL Reference.
Tip
If a scheduled maintenance occurs while a query is running, the query is terminated and rolled back. You must restart the query.
To query configured tables using the SQL code editor
-
Sign in to the AWS Management Console and open the AWS Clean Rooms console
with your AWS account (if you haven't yet done so). -
In the left navigation pane, choose Collaborations.
-
Choose the collaboration that has Your member abilities status of Query.
-
On the Queries tab, go to the Analysis section.
Note
The Analysis section only displays if the member who can receive results and the member who is responsible to pay for query compute costs have joined the collaboration as an active member.
-
On the Queries tab, under Tables, view the list of tables and their associated analysis rule type (Aggregation analysis rule, List analysis rule, or Custom analysis rule).
Note
If you don’t see the tables that you expect in the list, it might be for the following reasons:
-
The tables haven't been associated.
-
The tables don't have an analysis rule configured.
-
-
(Optional) To view the table's schema and analysis rule controls, expand the table by selecting the plus sign icon (+).
-
Build the query by typing the query into the SQL code editor.
For more information about supported SQL commands and functions, see the AWS Clean Rooms SQL Reference.
You can also use the following options to build your query.
-
(Spark analytics engine only) Specify the supported Worker type and the Number of workers.
Use the following table to determine the type and number or workers you need for your use case.
Note
Different worker types and number of workers have associated costs. To learn more about the pricing, see AWS Clean Rooms pricing
. Worker type vCPU Memory (GB) Storage (GB) Number of workers Total Clean Rooms Processing Units (CRPU) CR.1X (default) 4 30 100 2 4 16 (default) 32 CR.4X 16 120 400 8 64 32 256 -
For Send results to, specify who can receive results.
-
(Query runner only) If you want to specify different results settings for this query, under Send results to, choose Override results settings from the dropdown list. Then choose the Result format, Result files, and Results destination in Amazon S3.
-
Choose Run.
Note
You can't run the query if the member who can receive results hasn’t configured the query results settings.
-
View the Results.
For more information, see Receiving and using query results.
-
Continue to adjust parameters and run your query again, or choose the + button to start a new query in a new tab.
Note
AWS Clean Rooms aims to provide clear error messaging. If an error message doesn't have enough details to help you troubleshoot, contact the account team. Provide them with a description of how the error occurred and the error message (including any identifiers). For more information, see Troubleshooting AWS Clean Rooms.