Managing queries
Queries contain a set of YQL statements for handling data and connection parameters.
Creating a query
- In the management console
, select the folder where you want to create a query. - In the list of services, select Yandex Query.
- In the left-hand panel, select Queries.
- In the top panel, click New analytics query or New streaming query.
- Enter the query text in the input field.
Checking a query
To check the text of your query without executing it, click Validate.
Running a query
Analytical queries only support a scenario that allows running queries. To run a query, enter its text and click
Streaming queries support a scenario that allows a new query to be run while the current one is in progress.
- To run a new query, click
Run from current. - To resume a streaming query from the last checkpoint, click
Continue. If you need to resume a query after changing the data source, click and select Continue (force).
Note
Streaming queries are made on data streams that are not limited. Unlike an analytical query, a streaming query can run endlessly.
Stopping a query
To stop a query:
Click
- Click
Stop to create a checkpoint and stop the query. - Click
Force stop to stop the query without creating a checkpoint.
Viewing query execution information
You can view the query progress in the following tabs:
- Result: Query results as a table or schema. You can only view the results of the last query execution within 24 hours.
- Issues: Information about query execution errors.
- Plan: Information about query execution stages.
- Statistics: Query metrics with the following data:
- Input data streams.
- Capacity used for running the query.
- Amount of RAM used.
- Amount of output data.
- Meta: Query metadata:
- Query ID.
- Query execution status.
- Date when the query was created, modified, and last executed.
Viewing the history of query runs
Yandex Query logs each query's run history.
- In the management console
, select the folder where you want to view the query execution history. - In the list of services, select Yandex Query.
- In the left-hand panel, select Queries.
- In the top panel, select a query and click
Show launches.
Renaming a query
- In the management console
, select the folder where you want to rename a query. - In the list of services, select Yandex Query.
- In the left-hand panel, select Queries.
- Select the query and click
next to the query name on the panel. - Enter a new name for the query and click
.
Editing a query
To edit a query, enter a new query text and click Run. If the query is running, stop it to edit the query text.
Cloning a query
For convenience, you can clone a query with the original query text:
- In the management console
, select the folder where you want to clone a query. - In the list of services, select Yandex Query.
- In the left-hand panel, select Queries.
- Select the query and click Clone. To clone it to a query of a different type, click
Clone as….
Deleting a query
- In the management console
, select the folder to delete the query from. - In the list of services, select Yandex Query.
- In the left-hand panel, select Queries.
- Click
next to the name of the query to delete. - Confirm query deletion.