You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/data-lake-analytics/data-lake-analytics-u-sql-develop-with-python-r-csharp-in-vscode.md
+22-16Lines changed: 22 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,26 +8,29 @@ ms.date: 11/22/2017
8
8
ms.custom: devx-track-python
9
9
---
10
10
# Develop U-SQL with Python, R, and C# for Azure Data Lake Analytics in Visual Studio Code
11
+
11
12
Learn how to use Visual Studio Code (VSCode) to write Python, R and C# code behind with U-SQL and submit jobs to Azure Data Lake service. For more information about Azure Data Lake Tools for VSCode, see [Use the Azure Data Lake Tools for Visual Studio Code](data-lake-analytics-data-lake-tools-for-vscode.md).
12
13
13
14
Before writing code-behind custom code, you need to open a folder or a workspace in VSCode.
14
15
15
16
## Prerequisites for Python and R
17
+
16
18
Register Python and, R extensions assemblies for your ADL account.
17
19
1. Open your account in portal.
18
20
- Select **Overview**.
19
-
-Click**Sample Script**.
20
-
2.Click**More**.
21
+
-Select**Sample Script**.
22
+
2.Select**More**.
21
23
3. Select **Install U-SQL Extensions**.
22
24
4. Confirmation message is displayed after the U-SQL extensions are installed.
23
25
24
-

26
+
:::image type="content" source="./media/data-lake-analytics-data-lake-tools-for-vscode/setup-the-enrionment-for-python-and-r.png" alt-text="Screenshots showing selecting Sample Scripts in Overview, selecting More and Install U-SQL Extensions." lightbox="./media/data-lake-analytics-data-lake-tools-for-vscode/setup-the-enrionment-for-python-and-r.png":::
25
27
26
28
> [!Note]
27
29
> For best experiences on Python and R language service, please install VSCode Python and R extension.
28
30
29
31
## Develop Python file
30
-
1. Click the **New File** in your workspace.
32
+
33
+
1. Select the **New File** in your workspace.
31
34
2. Write your code in U-SQL. The following is a code sample.
32
35
```U-SQL
33
36
REFERENCE ASSEMBLY [ExtPython];
@@ -48,7 +51,7 @@ Register Python and, R extensions assemblies for your ADL account.
48
51
TO "/tweetmentions.csv"
49
52
USING Outputters.Csv();
50
53
```
51
-
54
+
52
55
3. Right-click a script file, and then select **ADL: Generate Python Code Behind File**.
53
56
4. The **xxx.usql.py** file is generated in your working folder. Write your code in Python file. The following is a code sample.
54
57
@@ -63,10 +66,11 @@ Register Python and, R extensions assemblies for your ADL account.
63
66
del df['tweet']
64
67
return df
65
68
```
66
-
5. Right-click in **USQL** file, you can click **Compile Script** or **Submit Job** to running job.
69
+
5. Right-click in **USQL** file, you can select **Compile Script** or **Submit Job** to running job.
67
70
68
71
## Develop R file
69
-
1. Click the **New File** in your workspace.
72
+
73
+
1. Select the **New File** in your workspace.
70
74
2. Write your code in U-SQL file. The following is a code sample.
5. Right-click in **USQL** file, you can click **Compile Script** or **Submit Job** to running job.
120
+
5. Right-click in **USQL** file, you can select **Compile Script** or **Submit Job** to running job.
117
121
118
122
## Develop C# file
123
+
119
124
A code-behind file is a C# file associated with a single U-SQL script. You can define a script dedicated to UDO, UDA, UDT, and UDF in the code-behind file. The UDO, UDA, UDT, and UDF can be used directly in the script without registering the assembly first. The code-behind file is put in the same folder as its peering U-SQL script file. If the script is named xxx.usql, the code-behind is named as xxx.usql.cs. If you manually delete the code-behind file, the code-behind feature is disabled for its associated U-SQL script. For more information about writing customer code for U-SQL script, see [Writing and Using Custom Code in U-SQL: User-Defined Functions]( https://blogs.msdn.microsoft.com/visualstudio/2015/10/28/writing-and-using-custom-code-in-u-sql-user-defined-functions/).
120
125
121
-
1. Click the **New File** in your workspace.
126
+
1. Select the **New File** in your workspace.
122
127
2. Write your code in U-SQL file. The following is a code sample.
123
128
```U-SQL
124
129
@a =
@@ -167,12 +172,13 @@ A code-behind file is a C# file associated with a single U-SQL script. You can d
167
172
}
168
173
}
169
174
```
170
-
5. Right-click in **USQL** file, you can click **Compile Script** or **Submit Job** to running job.
175
+
5. Right-click in **USQL** file, you can select **Compile Script** or **Submit Job** to running job.
171
176
172
177
## Next steps
173
-
* [Use the Azure Data Lake Tools for Visual Studio Code](data-lake-analytics-data-lake-tools-for-vscode.md)
174
-
* [U-SQL local run and local debug with Visual Studio Code](data-lake-tools-for-vscode-local-run-and-debug.md)
175
-
* [Get started with Data Lake Analytics using PowerShell](data-lake-analytics-get-started-powershell.md)
176
-
* [Get started with Data Lake Analytics using the Azure portal](data-lake-analytics-get-started-portal.md)
177
-
* [Use Data Lake Tools for Visual Studio for developing U-SQL applications](data-lake-analytics-data-lake-tools-get-started.md)
178
-
* [Use Data Lake Analytics(U-SQL) catalog](./data-lake-analytics-u-sql-get-started.md)
178
+
179
+
- [Use the Azure Data Lake Tools for Visual Studio Code](data-lake-analytics-data-lake-tools-for-vscode.md)
180
+
- [U-SQL local run and local debug with Visual Studio Code](data-lake-tools-for-vscode-local-run-and-debug.md)
181
+
- [Get started with Data Lake Analytics using PowerShell](data-lake-analytics-get-started-powershell.md)
182
+
- [Get started with Data Lake Analytics using the Azure portal](data-lake-analytics-get-started-portal.md)
183
+
- [Use Data Lake Tools for Visual Studio for developing U-SQL applications](data-lake-analytics-data-lake-tools-get-started.md)
184
+
- [Use Data Lake Analytics(U-SQL) catalog](./data-lake-analytics-u-sql-get-started.md)
0 commit comments