快速入门:将示例数据引入 Azure 数据资源管理器Quickstart: Ingest sample data into Azure Data Explorer

本文介绍如何将示例数据引入(加载)到 Azure 数据资源管理器数据库。This article shows you how to ingest (load) sample data into an Azure Data Explorer database. 多种方法可以引入数据;本文重点介绍适用于测试目的的基本方法。There are several ways to ingest data; this article focuses on a basic approach that is suitable for testing purposes.

备注

如果你已完成使用 Azure 数据资源管理器 Python 库引入数据,则已拥有此数据。You already have this data if you completed Ingest data using the Azure Data Explorer Python library.

先决条件Prerequisites

测试群集和数据库A test cluster and database

引入数据Ingest data

StormEvents 示例数据集包含美国国家环境信息中心中与天气相关的数据。The StormEvents sample data set contains weather-related data from the National Centers for Environmental Information.

  1. 登录到 https://dataexplorer.azure.cnSign in to https://dataexplorer.azure.cn.

  2. 在应用程序的左上角,选择“添加群集” 。In the upper-left of the application, select Add cluster.

  3. 在“添加群集” 对话框中,以 https://<ClusterName>.<Region>.kusto.chinacloudapi.cn/ 格式输入群集 URL,然后选择“添加” 。In the Add cluster dialog box, enter your cluster URL in the form https://<ClusterName>.<Region>.kusto.chinacloudapi.cn/, then select Add.

  4. 粘贴以下命令,然后选择“运行” 以创建 StormEvents 表。Paste in the following command, and select Run to create a StormEvents table.

    .create table StormEvents (StartTime: datetime, EndTime: datetime, EpisodeId: int, EventId: int, State: string, EventType: string, InjuriesDirect: int, InjuriesIndirect: int, DeathsDirect: int, DeathsIndirect: int, DamageProperty: int, DamageCrops: int, Source: string, BeginLocation: string, EndLocation: string, BeginLat: real, BeginLon: real, EndLat: real, EndLon: real, EpisodeNarrative: string, EventNarrative: string, StormSummary: dynamic)
    
  5. 粘贴以下命令,然后选择“运行” 以将数据引入到 StormEvents 表中。Paste in the following command, and select Run to ingest data into StormEvents table.

    .ingest into table StormEvents h'https://kustosamplefiles.blob.core.chinacloudapi.cn/samplefiles/StormEvents.csv?st=2018-08-31T22%3A02%3A25Z&se=2020-09-01T22%3A02%3A00Z&sp=r&sv=2018-03-28&sr=b&sig=LQIbomcKI8Ooz425hWtjeq6d61uEaq21UVX7YrM61N4%3D' with (ignoreFirstRecord=true)
    
  6. 引入完成后,粘贴到以下查询中,在窗口中,选择该查询,并选择“运行” 。After ingestion completes, paste in the following query, select the query in the window, and select Run.

    StormEvents
    | sort by StartTime desc
    | take 10
    

    查询从引入的示例数据返回以下结果。The query returns the following results from the ingested sample data.

    查询结果

后续步骤Next steps