Skip to content

Commit da73ce6

Browse files
committed
Merge branch 'master' into release-2019-cu13
2 parents c63c33c + 72340d9 commit da73ce6

9 files changed

Lines changed: 119 additions & 73 deletions

‎docs/big-data-cluster/spark-hive-tools-vscode.md‎

Lines changed: 34 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ titleSuffix: SQL Server Big Data Clusters
44
description: Submit spark job with the Spark & Hive Tools for Visual Studio Code on SQL Server big data cluster.
55
author: jejiang
66
ms.author: jejiang
7-
ms.reviewer: wiassaf
7+
ms.reviewer: wiassaf, dacoelho
88
ms.metadata: seo-lt-2019
9-
ms.date: 07/16/2021
9+
ms.date: 09/28/2021
1010
ms.topic: conceptual
1111
ms.prod: sql
1212
ms.technology: big-data-cluster
@@ -25,6 +25,7 @@ The following items are required for completing the steps in this article:
2525

2626
- A SQL Server big data cluster. See [[!INCLUDE[big-data-clusters-2019](../includes/ssbigdataclusters-ss-nover.md)]](big-data-cluster-overview.md).
2727
- [Visual Studio Code](https://code.visualstudio.com/).
28+
- [Python and the Python extension on Visual Studio Code](https://code.visualstudio.com/docs/languages/python).
2829
- [Mono](https://www.mono-project.com/docs/getting-started/install/). Mono is only required for Linux and macOS.
2930
- [Set up PySpark interactive environment for Visual Studio Code](/azure/hdinsight/set-up-pyspark-interactive-environment).
3031
- A local directory named **SQLBDCexample**. This article uses **C:\SQLBDC\SQLBDCexample**.
@@ -39,7 +40,7 @@ After you have completed the prerequisites, you can install Spark & Hive Tools
3940

4041
3. In the search box, enter **Spark & Hive**.
4142

42-
4. Select **Spark & Hive Tools** from the search results, and then select **Install**.
43+
4. Select **Spark & Hive Tools**, published by Microsoft, from the search results, and then select **Install**.
4344

4445
![Install Extension](./media/spark-hive-tools-vscode/extension.png)
4546

@@ -57,29 +58,30 @@ Complete the following steps to open a work folder, and create a file in Visual
5758

5859
3. Name the new file with the `.py` (Spark script) file extension. This example uses **HelloWorld.py**.
5960
4. Copy and paste the following code into the script file:
61+
6062
```python
61-
import sys
62-
from operator import add
63-
from pyspark.sql import SparkSession, Row
63+
import sys
64+
from operator import add
65+
from pyspark.sql import SparkSession, Row
6466

65-
spark = SparkSession\
66-
.builder\
67-
.appName("PythonWordCount")\
68-
.getOrCreate()
67+
spark = SparkSession\
68+
.builder\
69+
.appName("PythonWordCount")\
70+
.getOrCreate()
6971

70-
data = [Row(col1='pyspark and spark', col2=1), Row(col1='pyspark', col2=2), Row(col1='spark vs hadoop', col2=2), Row(col1='spark', col2=2), Row(col1='hadoop', col2=2)]
71-
df = spark.createDataFrame(data)
72-
lines = df.rdd.map(lambda r: r[0])
72+
data = [Row(col1='pyspark and spark', col2=1), Row(col1='pyspark', col2=2), Row(col1='spark vs hadoop', col2=2), Row(col1='spark', col2=2), Row(col1='hadoop', col2=2)]
73+
df = spark.createDataFrame(data)
74+
lines = df.rdd.map(lambda r: r[0])
7375

74-
counters = lines.flatMap(lambda x: x.split(' ')) \
75-
.map(lambda x: (x, 1)) \
76-
.reduceByKey(add)
76+
counters = lines.flatMap(lambda x: x.split(' ')) \
77+
.map(lambda x: (x, 1)) \
78+
.reduceByKey(add)
7779

78-
output = counters.collect()
79-
sortedCollection = sorted(output, key = lambda r: r[1], reverse = True)
80+
output = counters.collect()
81+
sortedCollection = sorted(output, key = lambda r: r[1], reverse = True)
8082

81-
for (word, count) in sortedCollection:
82-
print("%s: %i" % (word, count))
83+
for (word, count) in sortedCollection:
84+
print("%s: %i" % (word, count))
8385
```
8486

8587
## Link a SQL Server big data cluster
@@ -94,11 +96,11 @@ Before you can submit scripts to your clusters from Visual Studio Code, you need
9496

9597
3. Enter SQL Server Big Data endpoint.
9698

97-
4. Enter SQL Server Big Data Cluster user name.
99+
4. Enter SQL Server big data cluster user name.
98100

99101
5. Enter password for user admin.
100102

101-
6. Set the display name of the cluster (Optional).
103+
6. Set the display name of the big data cluster (optional).
102104

103105
7. List clusters, review **OUTPUT** view for verification.
104106

@@ -176,19 +178,19 @@ You can submit interactive PySpark queries by following the steps below:
176178
#### Method 1
177179

178180
1. From the menu bar, navigate to **File** > **Preferences** > **Settings**.
179-
2. In the **Search settings** text box enter **HDInsight Job Sumission: Livy Conf**.
181+
2. In the **Search settings** text box enter **HDInsight Job Submission: Livy Conf**.
180182
3. Select **Edit in settings.json** for the relevant search result.
181183

182184
#### Method 2
183185

184-
Submit a file, notice the `.vscode` folder is added automatically to the work folder. You can find the Livy configuration by clicking `.vscode\settings.json`.
186+
Submit a file, notice the `.vscode` folder is added automatically to the work folder. You can find the Livy configuration by selecting `settings.json` under `.vscode`.
185187

186-
+ The project settings:
188+
The project settings:
187189

188-
![Livy configuration](./media/spark-hive-tools-vscode/hdi-livyconfig.png)
190+
![Livy configuration](./media/spark-hive-tools-vscode/hdi-livyconfig.png)
189191

190192
>[!NOTE]
191-
>For settings **driverMomory** and **executorMomry**, set the value with unit, for example 1g or 1024m.
193+
>For settings **driverMemory** and **executorMemory**, set the value with unit, for example 1gb or 1024mb.
192194
193195
### Supported Livy configurations
194196

@@ -214,6 +216,7 @@ Submit a file, notice the `.vscode` folder is added automatically to the work fo
214216
| queue | The name of the YARN queue to which submitted | string |
215217
| name | The name of this session | string |
216218
| conf | Spark configuration properties | Map of key=val |
219+
| :- | :- | :- |
217220

218221
#### Response Body
219222

@@ -226,6 +229,7 @@ The created batch object.
226229
| appInfo | The detailed application info | Map of key=val |
227230
| log | The log lines | list of strings |
228231
| state | The batch state | string |
232+
| :- | :- | :- |
229233

230234
>[!NOTE]
231235
>The assigned Livy config will display in output pane when submit script.
@@ -234,11 +238,12 @@ The created batch object.
234238

235239
Spark & Hive for Visual Studio Code supports the following features:
236240

237-
- **IntelliSense autocomplete**. Suggestions pop up for keyword, methods, variables, and so on. Different icons represent different types of objects.
241+
- **IntelliSense autocomplete**. Suggestions pop up for keyword, methods, variables, and more. Different icons represent different types of objects.
238242

239243
![Spark & Hive Tools for Visual Studio Code IntelliSense object types](./media/spark-hive-tools-vscode/hdinsight-for-vscode-auto-complete-objects.png)
244+
240245
- **IntelliSense error marker**. The language service underlines the editing errors for the Hive script.
241-
- **Syntax highlights**. The language service uses different colors to differentiate variables, keywords, data type, functions, and so on.
246+
- **Syntax highlights**. The language service uses different colors to differentiate variables, keywords, data type, functions, and more.
242247

243248
![Spark & Hive Tools for Visual Studio Code syntax highlights](./media/spark-hive-tools-vscode/hdinsight-for-vscode-syntax-highlights.png)
244249

‎docs/big-data-cluster/sparklyr-from-RStudio.md‎

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
title: Use sparklyr from RStudio
33
titleSuffix: SQL Server Big Data Clusters
44
description: Learn how to use sparklyr in a SQL Server Big Data Cluster to connect to Spark through the R interface.
5-
author: jejiang
6-
ms.author: jejiang
7-
ms.reviewer: mikeray
8-
ms.date: 06/22/2020
5+
author: DaniBunny
6+
ms.author: dacoelho
7+
ms.reviewer: wiassaf
8+
ms.date: 09/28/2021
99
ms.topic: conceptual
1010
ms.prod: sql
1111
ms.technology: machine-learning-bdc
@@ -21,21 +21,23 @@ Sparklyr provides an R interface for Apache Spark. Sparklyr is a popular way for
2121

2222
- [Deploy a SQL Server 2019 big data cluster](quickstart-big-data-cluster-deploy.md).
2323

24-
### Install RStudio Desktop
24+
### Install R and RStudio Desktop
2525

2626
Install and configure **RStudio Desktop** with the following steps:
2727

28-
1. If you are running on a Windows client, [download and install R 3.4.4](https://cran.rstudio.com/bin/windows/base/old/3.4.4).
28+
1. If you are running on a Windows client, [download and install R 3.6.3](https://cran.rstudio.com/bin/windows/base/old/3.6.3).
2929

30-
1. [Download and install RStudio Desktop](https://www.rstudio.com/products/rstudio/download/).
30+
> [!WARNING]
31+
> R version 4.x and sparklyr versions other that the one specified below are verified not to work as of SQL Server Big Data Clusters CU12.
32+
33+
1. [Download and install RStudio Desktop](https://www.rstudio.com/products/rstudio/download/). Optionally, all samples work on the R shell.
3134

3235
1. After installation completes, run the following commands inside of RStudio Desktop to install the required packages:
3336

34-
```RStudioDesktop
35-
install.packages("DBI", repos = "https://cran.microsoft.com/snapshot/2019-01-01")
36-
install.packages("dplyr", repos = "https://cran.microsoft.com/snapshot/2019-01-01")
37-
install.packages("sparklyr", repos = "https://cran.microsoft.com/snapshot/2019-01-01")
38-
```
37+
```r
38+
install.packages("devtools")
39+
devtools::install_github('rstudio/sparklyr', ref = 'v1.7.0', upgrade = 'always', repos = 'https://cran.microsoft.com/snapshot/2021-06-11/')
40+
```
3941

4042
## Connect to Spark in a big data cluster
4143

@@ -67,7 +69,7 @@ sc <- spark_connect(master = "https://<IP>:<PORT>/gateway/default/livy/v1",
6769

6870
## Run sparklyr queries
6971

70-
After connecting to Spark, you can run sparklyr. The following example performs a query on iris dataset using sparklyr:
72+
After connecting to Spark, you can run sparklyr. The following example performs a query on the `iris` dataset using sparklyr:
7173

7274
```r
7375
iris_tbl <- copy_to(sc, iris)

‎docs/big-data-cluster/view-cluster-status.md‎

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ titleSuffix: SQL Server
44
description: This article explains how to view the status of a big data cluster by using Azure Data Studio, notebooks, and Azure Data CLI (azdata) commands.
55
author: cloudmelon
66
ms.author: melqin
7-
ms.reviewer: wiassaf
8-
ms.date: 07/16/2021
7+
ms.reviewer: wiassaf, dacoelho
8+
ms.date: 09/28/2021
99
ms.topic: conceptual
1010
ms.prod: sql
1111
ms.technology: big-data-cluster
@@ -19,7 +19,7 @@ This article explains how to view the status of a big data cluster by using Azur
1919

2020
## Know your architecture
2121

22-
Starting with SQL Server 2019 (15.x), [!INCLUDE[big-data-clusters-2019](../includes/ssbigdataclusters-ss-nover.md)] allow you to deploy scalable clusters of SQL Server, Spark, and HDFS containers that run on Kubernetes. For an overview, see [What are SQL Server Big Data Clusters?](big-data-cluster-overview.md).
22+
Starting with SQL Server 2019 (15.x), [!INCLUDE[big-data-clusters-2019](../includes/ssbigdataclusters-ss-nover.md)] allow you to deploy scalable clusters of SQL Server, Spark, and HDFS containers that run on Kubernetes. For an overview, see [What are SQL Server Big Data Clusters?](big-data-cluster-overview.md)
2323

2424
[!INCLUDE[big-data-clusters-2019](../includes/ssbigdataclusters-ss-nover.md)] provide coherent and consistent authorization and authentication. For an overview of Big Data Cluster security, see [Security concepts for [!INCLUDE[big-data-clusters-2019](../includes/ssbigdataclusters-ss-nover.md)]](concept-security.md).
2525

@@ -69,21 +69,11 @@ The following articles describe how to troubleshoot big data clusters deployed i
6969

7070
## Where to find [!INCLUDE[big-data-clusters-2019](../includes/ssbigdataclusters-ss-nover.md)] administration notebooks
7171

72-
[!INCLUDE[big-data-clusters-2019](../includes/ssbigdataclusters-ss-nover.md)] provide a comprehensive administration experience via Jupyter Notebooks. The provided notebooks cover cluster operations, management, monitoring, logging, and troubleshooting.
72+
[!INCLUDE[big-data-clusters-2019](../includes/ssbigdataclusters-ss-nover.md)] provide a comprehensive administration experience via Jupyter Notebooks. The provided notebooks cover cluster operations, management, monitoring, logging, and troubleshooting.
7373

74+
To add the operational notebook repository from GitHub to Azure Data Studio, you can use keyboard shortcut `Ctrl+Shift+P` (or select **View**, and then **Command Palette**). Select **Add Remote Book**.
7475

75-
### Access to local notebooks
76-
77-
After you connect to a big data cluster with Azure Data Studio (ADS), on the **[!INCLUDE[big-data-clusters-2019](../includes/ssbigdataclusters-ss-nover.md)]** tab, you can find a link to all the local notebooks:
78-
79-
![Screenshot that shows where to find links to local notebooks.](media/view-cluster-status/bdc-local-guides.png)
80-
81-
You can also access the notebooks directly from Azure Data Studio. Use keyboard shortcut Ctrl+Shift+P (or select **View** and then **Command Palette**) to find the option **Jupyter Books: Get localized SQL Server 2019 guide**.
82-
83-
84-
### Add remote notebooks
85-
86-
Because notebooks are sourced remotely, you can select a notebook for the correct version. To add a remote notebook from Azure Data Studio, you can use keyboard shortcut Ctrl+Shift+P. (Or select **View** and then **Command Palette**.)
76+
In the **Add Remote Book** dialogue, select the desired latest version for operational notebooks. Select **Add**, as shown below:
8777

8878
![Screenshot that shows the Azure Data Studio palette.](media/view-cluster-status/bdc-ads-palette.png)
8979

@@ -107,4 +97,4 @@ To learn how to use the notebooks, see these articles:
10797

10898
## Next steps
10999

110-
For more information, see [What are [!INCLUDE[big-data-clusters-2019](../includes/ssbigdataclusters-ss-nover.md)]?](big-data-cluster-overview.md).
100+
For more information, see [What are [!INCLUDE[big-data-clusters-2019](../includes/ssbigdataclusters-ss-nover.md)]?](big-data-cluster-overview.md)
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: What is C# Language Extension?
3+
titleSuffix: SQL Server Language Extensions
4+
description: C# Language Extension is a feature of SQL Server used for executing external C# code. Relational data can be used in the external C# code using the extensibility framework.
5+
author: garyericson
6+
ms.author: garye
7+
ms.date: 09/28/2021
8+
ms.topic: overview
9+
ms.prod: sql
10+
ms.technology: language-extensions
11+
monikerRange: ">=sql-server-ver15||>=sql-server-linux-ver15"
12+
ms.custom:
13+
- intro-overview
14+
---
15+
16+
# What is C# Language Extension?
17+
[!INCLUDE [SQL Server 2019 and later](../includes/applies-to-version/sqlserver2019.md)]
18+
19+
The open-source [.NET C# language extension](https://github.com/microsoft/sql-server-language-extensions/tree/main/language-extensions/dotnet-core-CSharp) is a feature of [SQL Server Language Extensions](language-extensions-overview.md) that can be used for executing C# code within SQL Server. You can pass an existing SQL Server table to a C# application as a DataFrame, perform operations in C# using rich libraries, and obtain back a result set. This C# language extension allows you to reuse existing C# code, calculations, logic, or extensive libraries that provide functionality which you cannot get in T-SQL.
20+
21+
The external C# language is defined with [CREATE EXTERNAL LANGUAGE](../t-sql/statements/create-external-language-transact-sql.md). The system stored procedure [sp_execute_external_script](../relational-databases/system-stored-procedures/sp-execute-external-script-transact-sql.md) is used as the interface for executing the C# code.
22+
23+
> [!NOTE]
24+
> The C# language extension is compatible with SQL Server 2019 CU3 or later. Currently, it integrates .NET core on SQL Server Windows only.
25+
26+
## What you can do
27+
28+
The C# language extension uses the extensibility framework for executing external C# code. Code execution is isolated from the core engine processes, but fully integrated with SQL Server query execution. You can execute C# code at the data's source, eliminating the need to pull data across the network.
29+
30+
You can do data cleaning, fast data querying, or any other processing in C# that can occur through a DataFrame. By embedding C# code in stored procedures, you can push business logic down into the database for better performance. This helps avoid unnecessary data movement and latency because data does not need to be retrieved from SQL Server and moved into the app tier to do the business logic processing.
31+
32+
## Get started
33+
34+
The C# language extension is not installed with SQL Server. To install and configure the C# extension, see [.NET Core CSharp Language Extension](https://github.com/microsoft/sql-server-language-extensions/tree/main/language-extensions/dotnet-core-CSharp). The [Regex Sample](https://github.com/microsoft/sql-server-language-extensions/blob/main/language-extensions/dotnet-core-CSharp/sample/regex/README.md) tutorial shows you how to create a C# program that uses a regular expression to check text in a SQL table.
35+
36+
## Next steps
37+
38+
+ Install the [SQL Server Language Extensions on Windows](install/windows-java.md)
39+
+ Install the [.NET Core CSharp Language Extension](https://github.com/microsoft/sql-server-language-extensions/tree/main/language-extensions/dotnet-core-CSharp)

‎docs/language-extensions/language-extensions-overview.md‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
title: What is SQL Server Language Extensions?
33
titleSuffix:
4-
description: Language Extensions is a feature of SQL Server used for executing external code. In SQL Server, Java, Python, and R are supported. Relational data can be used in the external code using the extensibility framework.
5-
author: dphansen
6-
ms.author: davidph
7-
ms.date: 11/06/2020
4+
description: Language Extensions is a feature of SQL Server used for executing external code. In SQL Server, Java, C#, Python, and R are supported. Relational data can be used in the external code using the extensibility framework.
5+
author: garyericson
6+
ms.author: garye
7+
ms.date: 09/28/2021
88
ms.topic: overview
99
ms.prod: sql
1010
ms.technology: language-extensions
@@ -15,7 +15,7 @@ ms.custom:
1515
# What is SQL Server Language Extensions?
1616
[!INCLUDE [SQL Server 2019 and later](../includes/applies-to-version/sqlserver2019.md)]
1717

18-
Language Extensions is a feature of SQL Server used for executing external code. The relational data can be used in the external code using the [extensibility framework](concepts/extensibility-framework.md). In SQL Server 2019, Java, Python, and R runtimes are supported.
18+
Language Extensions is a feature of SQL Server used for executing external code. The relational data can be used in the external code using the [extensibility framework](concepts/extensibility-framework.md). In SQL Server 2019, Java, C#, Python, and R runtimes are supported.
1919

2020
> [!NOTE]
2121
> For executing Python or R in SQL Server, see the [Machine Learning Services](../machine-learning/sql-server-machine-learning-services.md) documentation. With SQL Server 2019 and later, you can use a custom Python and R runtime with Language Extensions. For more information, see how to install the [Python custom runtime](../machine-learning/install/custom-runtime-python.md) and the [R custom runtime](../machine-learning/install/custom-runtime-r.md).
@@ -34,7 +34,8 @@ Language Extensions provides multiple advantages:
3434

3535
## Next steps
3636

37-
+ Install the [SQL Server Language Extensions on Windows](install/windows-java.md) or [on Linux](../linux/sql-server-linux-setup-language-extensions-java.md)
38-
+ Install the [Python custom runtime for SQL Server](../machine-learning/install/custom-runtime-python.md)
39-
+ Install the [R custom runtime for SQL Server](../machine-learning/install/custom-runtime-r.md)
37+
+ Install the [Java language extension on Windows](install/windows-java.md) or [on Linux](../linux/sql-server-linux-setup-language-extensions-java.md)
38+
+ Install the [C# language extension on Windows](csharp-overview.md)
39+
+ Install your [Python custom runtime for SQL Server](../machine-learning/install/custom-runtime-python.md)
40+
+ Install your [R custom runtime for SQL Server](../machine-learning/install/custom-runtime-r.md)
4041
+ Install the [Microsoft Extensibility SDK for Java](how-to/extensibility-sdk-java-sql-server.md)

0 commit comments

Comments
 (0)