Събитие
31.03, 23 ч. - 2.04, 23 ч.
Най-голямото събитие за обучение на Fabric, Power BI и SQL. 31 март – 2 април. Използвайте код FABINSIDER, за да спестите $400.
Регистрирайте се днесТози браузър вече не се поддържа.
Надстройте до Microsoft Edge, за да се възползвате от най-новите функции, актуализации на защитата и техническа поддръжка.
In this article, you learn how to use a KQL queryset. The KQL Queryset is the item used to run queries, view, and customize query results on data from different data sources, such as Eventhouse, KQL database, and more.
The KQL Queryset uses the Kusto Query Language for creating queries, and also supports many SQL functions. For more information about the query language, see Kusto Query Language overview.
Queries run in the context of a data source. You can change the associated data source at any point, and retain the queries saved in the query editor. You can associate your KQL queryset with multiple data sources of different types, including a KQL database or a data source from an Azure Data Explorer cluster.
Select the tab that corresponds with your desired data source type.
In the pane on the left-hand side of the query page, under Explorer and the search bar, use the database switcher to expand the data source connections menu.
Select Add data source, then select OneLake data hub.
In the OneLake data hub window that appears, select a KQL database to connect to your KQL queryset, and then select Connect. Alternatively, close the OneLake data hub window and use the + Add data source menu to connect to a different data source.
A list of tables associated with this data source appears below the data source name.
Now that you're connected to your data source, you can run queries on this data. The KQL Queryset uses the Kusto Query Language (KQL) to query data from any of the data sources you have access to. To learn more about KQL, see Kusto Query Language overview.
The following examples use data that is publicly available at https://kustosamples.blob.core.windows.net/samplefiles/StormEvents.csv.
Write or copy a query in the top pane of the KQL Queryset.
Select the Run button, or press Shift+Enter to run the query.
The resulting query output is displayed in the results grid, which appears below the query pane. Notice the green check indicating that the query completed successfully, and the time used to compute the query results.
The data source explorer allows you to switch between the data sources connected to the queryset tab that you are in.
At the top of the data source explorer pane, under Explorer you can use the search bar to search for a specific data source. You can also use the database switcher below the search bar to expand the data source connections menu. Select the data source you want to use. If the tab name hasn't been edited previously, it's automatically named after the data source.
The data source explorer pane has two sections. The upper section lists all the items in the data source, and the lower section shows all available data sources in the queryset.
The upper section of the data source explorer shows all the items that are included in the data source you're using.
Select the arrow > to the left of the item you want to expand. You can drill down to show more details by selecting the arrow > to the left of items in subsequent list levels. For example, under Tables, select the arrow > to the left of a table to show the list of the columns in that table.
To open the action menu, hover over an item in the expanded list and select the More actions menu [...]. The menu shows the following options:
Different actions are available for different item types.
The lower section of the data source explorer shows all the available data sources that have been added to the queryset.
To open the action menu, hover over the data source name and select the More actions menu [...]. The menu shows the following options:
You might want to copy and share the queries you create.
At the top of the query window, select the Home tab.
In the query pane, select Copy query.
The following table outlines the many options for how to copy a query.
Action | Description |
---|---|
Copy query | Copy the query text. |
Link to clipboard | Copy a deep link that can be used to run the query. |
Link and query to clipboard | Copy a link that can be used to run the query and the text of the query. |
Link, query and results to clipboard | Copy a link that can be used to run the query, the text of the query, and the results of the query. |
Copy results | Copy the results of the query. |
Select the desired action from the list.
Paste this information to edit or share it, for example in Microsoft Word, Microsoft Teams, or Outlook.
Важно
The user who is receiving the query link must have viewing permissions to the underlying data to execute the query and view results.
Within a KQL queryset, you can create multiple tabs. Each tab can be associated with a different KQL database, and lets you save queries for later use or share with others to collaborate on data exploration. You can also change the KQL database associated with any tab, allowing you to run the same query on data in different databases.
You can manage your tabs in the following ways:
Instead of simply copy-pasting the query output, you can also export the query results.
This is a one-time method to export a CSV file containing the query results.
At the top of the query window, select the Home tab.
In the query pane, select Export to CSV.
Save the CSV file locally.
To delete your KQL queryset:
Събитие
31.03, 23 ч. - 2.04, 23 ч.
Най-голямото събитие за обучение на Fabric, Power BI и SQL. 31 март – 2 април. Използвайте код FABINSIDER, за да спестите $400.
Регистрирайте се днесОбучение
Модул
Explore the fundamentals of data analysis using Kusto Query Language (KQL) - Training
Learn about the basics of Kusto Query Language (KQL), and the various Microsoft products that use it.
Сертифициране
Microsoft Certified: Azure Cosmos DB Developer Specialty - Certifications
Write efficient queries, create indexing policies, manage, and provision resources in the SQL API and SDK with Microsoft Azure Cosmos DB.