教程:使用 Spark 作业将数据引入 SQL Server 数据池Tutorial: Ingest data into a SQL Server data pool with Spark jobs
12/13/2019
本文内容
适用于:Applies to: SQL Server 2019 (15.x)SQL Server 2019 (15.x)
SQL Server 2019 (15.x)SQL Server 2019 (15.x)适用于:Applies to:
SQL Server 2019 (15.x)SQL Server 2019 (15.x)
SQL Server 2019 (15.x)SQL Server 2019 (15.x)
本教程演示如何使用 Spark 作业将数据加载到 SQL Server 2019 大数据群集SQL Server 2019 Big Data Clusters 的数据池。This tutorial demonstrates how to use Spark jobs to load data into the data pool of a SQL Server 2019 大数据群集SQL Server 2019 Big Data Clusters.
在本教程中,你将了解如何执行以下操作:In this tutorial, you learn how to:
在数据池中创建外部表。Create an external table in the data pool.
创建 Spark 作业以从 HDFS 加载数据。Create a Spark job to load data from HDFS.
在外部表中查询结果。Query the results in the external table.
提示
如果需要,可以下载并运行本教程中的命令脚本。If you prefer, you can download and run a script for the commands in this tutorial. 有关说明,请参阅 GitHub 上的数据池示例。For instructions, see the Data pools samples on GitHub.
先决条件Prerequisites
大数据工具Big data tools
kubectlkubectl
Azure Data StudioAzure Data Studio
SQL Server 2019 扩展SQL Server 2019 extension
在数据池中创建外部表Create an external table in the data pool
以下步骤会在数据池中创建一个名为“web_clickstreams_spark_results”的外部表 。The following steps create an external table in the data pool named web_clickstreams_spark_results. 然后,可以将此表用作将数据引入到大数据群集的位置。This table can then be used as a location for ingesting data into the big data cluster.
在 Azure Data Studio 中,连接到大数据群集的 SQL Server 主实例。In Azure Data Studio, connect to the SQL Server master instance of your big data cluster.
双击“服务器”窗口中的连接,以显示 SQL Server 主实例的服务器仪表板 。Double-click on the connection in the Servers window t