Skip to content

Commit 337e225

Browse files
authored
Merge pull request #41728 from jingyanjingyan/usql-extract-script
usql-create-extract-script
2 parents 045c888 + 17ff089 commit 337e225

11 files changed

+84
-52
lines changed

articles/data-lake-analytics/data-lake-analytics-data-lake-tools-for-vscode.md

Lines changed: 84 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -28,30 +28,32 @@ For MacOS and Linux:
2828
- [.NET Core SDK 2.0](https://www.microsoft.com/net/download/core).
2929
- [Mono 5.2.x](http://www.mono-project.com/download/).
3030

31-
## Install Data Lake Tools
31+
## Install Azure Data Lake Tools
3232

33-
After you install the prerequisites, you can install Data Lake Tools for VS Code.
33+
After you install the prerequisites, you can install Azure Data Lake Tools for VS Code.
3434

35-
**To install Data Lake Tools**
35+
**To install Azure Data Lake Tools**
3636

3737
1. Open Visual Studio Code.
38-
2. Click **Extensions** in the left pane. Enter **Azure Data Lake** in the search box.
39-
3. Click **Install** next to **Azure Data Lake tools**. After a few seconds, the **Install** button will be changed to **Reload**.
40-
4. Click **Reload** to activate the **Azure Data Lake tools** extension.
41-
5. Click **Reload Window** to confirm. You can see **Azure Data Lake tools** in the Extensions pane.
38+
2. Click **Extensions** in the left pane. Enter **Azure Data Lake Tools** in the search box.
39+
3. Click **Install** next to **Azure Data Lake Tools**. After a few seconds, the **Install** button will be changed to **Reload**.
40+
4. Click **Reload** to activate the **Azure Data Lake Tools** extension.
41+
5. Click **Reload Window** to confirm. You can see **Azure Data Lake Tools** in the Extensions pane.
4242

4343
![Data Lake Tools for Visual Studio Code Extensions pane](./media/data-lake-analytics-data-lake-tools-for-vscode/data-lake-tools-for-vscode-extensions.png)
4444

4545

4646
## Activate Azure Data Lake Tools
4747
Create a new .usql file or open an existing .usql file to activate the extension.
4848

49-
## Open the sample script
50-
Open the command palette (Ctrl+Shift+P) and enter **ADL: Open Sample Script**. It opens another instance of this sample. You can also edit, configure, and submit script on this instance.
5149

5250
## Work with U-SQL
5351

54-
You need open either a U-SQL file or a folder to work with U-SQL.
52+
To work with U-SQL, you need open either a U-SQL file or a folder.
53+
54+
**To open the sample script**
55+
56+
Open the command palette (Ctrl+Shift+P) and enter **ADL: Open Sample Script**. It opens another instance of this sample. You can also edit, configure, and submit script on this instance.
5557

5658
**To open a folder for your U-SQL project**
5759

@@ -120,7 +122,7 @@ You need open either a U-SQL file or a folder to work with U-SQL.
120122
![Data Lake Tools for Visual Studio Code configuration file](./media/data-lake-analytics-data-lake-tools-for-vscode/default-context-setting.png)
121123

122124
> [!NOTE]
123-
> After the configuration is saved, The account, database, and schema information appear on the status bar at the bottom-left corner of the corresponding .usql file file if you don’t have default context set up.
125+
> After the configuration is saved, the account, database, and schema information appear on the status bar at the bottom-left corner of the corresponding .usql file file if you don’t have default context set up.
124126
125127
**Set Git Ignore**
126128

@@ -132,10 +134,15 @@ You need open either a U-SQL file or a folder to work with U-SQL.
132134

133135
![Data Lake Tools for Visual Studio Code configuration file](./media/data-lake-analytics-data-lake-tools-for-vscode/data-lake-tools-for-gitignore.png)
134136

135-
## Use Python, R, and CSharp code-behind file
137+
138+
## Work with code-behind file: CSharp, Python, and R
139+
136140
Azure Data Lake Tool supports multiple custom codes, the instructions see [Develop U-SQL with Python, R, and CSharp for Azure Data Lake Analytics in VSCode](data-lake-analytics-u-sql-develop-with-python-r-csharp-in-vscode.md).
137141

138-
## Use assemblies
142+
## Work with assemblies
143+
144+
For information on developing assemblies, see [Develop U-SQL assemblies for Azure Data Lake Analytics jobs](data-lake-analytics-u-sql-develop-assemblies.md).
145+
139146
You can use Data Lake Tools to register custom code assemblies in the Data Lake Analytics catalog.
140147

141148
**To register an assembly**
@@ -200,42 +207,80 @@ The following U-SQL code demonstrates how to call an assembly. In the sample, th
200207
USING Outputters.Tsv();
201208

202209

210+
## U-SQL local run and local debug for windows users
211+
U-SQL local run tests your local data and validates your script locally before your code is published to Data Lake Analytics. The local debug feature enables you to complete the following tasks before your code is submitted to Data Lake Analytics:
212+
- Debug your C# code-behind.
213+
- Step through the code.
214+
- Validate your script locally.
215+
216+
For instructions on local run and local debug, see [U-SQL local run and local debug with Visual Studio Code](data-lake-tools-for-vscode-local-run-and-debug.md).
217+
218+
203219
## Connect to Azure
204220

205221
Before you can compile and run U-SQL scripts in Data Lake Analytics, you must connect to your Azure account.
206222

207-
**To connect to Azure**
223+
<b id="sign-in-by-command">To connect to Azure using command</b>
208224

209225
1. Select Ctrl+Shift+P to open the command palette.
210-
2. Enter **ADL: Login**. The login information appears on the top area.
226+
2. Enter **ADL: Login**. The login information appears at the right-bottom.
211227

212228
![Data Lake Tools for Visual Studio Code command palette](./media/data-lake-analytics-data-lake-tools-for-vscode/data-lake-tools-for-vscode-extension-login.png)
229+
213230
![Data Lake Tools for Visual Studio Code device login information](./media/data-lake-analytics-data-lake-tools-for-vscode/data-lake-tools-for-vscode-login-info.png)
214-
3. Click **Copy & Open** to open the login webpage with URL: https://aka.ms/devicelogin. Paste the code **G567LX42V** into the text box, and then select **Continue**.
215231

216-
![Data Lake Tools for Visual Studio Code login paste code](./media/data-lake-analytics-data-lake-tools-for-vscode/data-lake-tools-for-vscode-extension-login-paste-code.png )
232+
3. Click **Copy & Open** to open the login webpage with URL: https://aka.ms/devicelogin. Paste the code into the text box, and then select **Continue**.
233+
234+
![Data Lake Tools for Visual Studio Code login paste code](./media/data-lake-analytics-data-lake-tools-for-vscode/data-lake-tools-for-vscode-extension-login-paste-code.png )
235+
217236
4. Follow the instructions to sign in from the webpage. When you're connected, your Azure account name appears on the status bar in the lower-left corner of the **VS Code** window. 
218237

219238
> [!NOTE]
220-
>- Data Lake Tool automatically signs in next time If you have signed in before, but you have not logged out yet.
239+
>- Data Lake Tool automatically signs in next time if you have signed in before, but you have not logged out yet.
221240
>- If your account has two factors enabled, we recommend that you use phone authentication rather than using a PIN.
222241
223242

224243
To sign out, enter the command **ADL: Logout**.
225244

226-
## List your Data Lake Analytics accounts
245+
**To connect to Azure from explorer**
227246

228-
To test the connection, get a list of your Data Lake Analytics accounts.
247+
To sign in from explorer, expand **AZURE DATALAKE**, click **Sign in to Azure...**, then follow the step3 and step4 of [**To connect to Azure using command**](#sign-in-by-command).
229248

230-
**To list the Data Lake Analytics accounts under your Azure subscription**
249+
![Connect to Azure from explorer](./media/data-lake-analytics-data-lake-tools-for-vscode/data-lake-tools-for-vscode-sign-in-from-explorer.png )
250+
251+
You cannot sign out from explorer. To sign out, see [**To connect to Azure using command**](#sign-in-by-command).
231252

232-
1. Select Ctrl+Shift+P to open the command palette.
233-
2. Enter **ADL: List Accounts**. The accounts appear in the **Output** pane.
234253

254+
## Create extract script
255+
You can create EXTRACT script for .csv, .tsv, .txt files using the command **ADL: Create EXTRACT Script** or from **AZURE DATALAKE** explorer.
235256

236-
## Access the Data Lake Analytics catalog
257+
**To create EXTRACT script using command**
237258

238-
After you have connected to Azure, you can use the following steps to access the U-SQL catalog.
259+
1. Select Ctrl+Shift+P to open the command palette, enter **ADL: Create EXTRACT Script**.
260+
2. Specify the full path for an Azure storage file, press **Enter**.
261+
3. Select one account.
262+
4. For .txt file, select a delimiter to extract the file.
263+
264+
![Create extract script process](./media/data-lake-analytics-data-lake-tools-for-vscode/create-extract-script-process.png)
265+
266+
The extract script is generated based on your entries. For the script that cannot detect the columns, choose one from the two options. If not, only one script will be generated.
267+
268+
![Create extract script result](./media/data-lake-analytics-data-lake-tools-for-vscode/create-extract-script-result.png)
269+
270+
**To create EXTRACT script from explorer**
271+
272+
Another way to create EXTRACT script is through the right-click menu on the .csv, .tsv, .txt file in data lake storage or blob storage.
273+
274+
![Create extract script from context menu](./media/data-lake-analytics-data-lake-tools-for-vscode/create-extract-script-from-context-menu.png)
275+
276+
## Integrate with Azure Data Lake Analytics through command
277+
278+
You can access Azure Data Lake Analytics resources including list accounts, access metadata, and view analytics jobs.
279+
280+
**To list the Azure Data Lake Analytics accounts under your Azure subscription**
281+
282+
1. Select Ctrl+Shift+P to open the command palette.
283+
2. Enter **ADL: List Accounts**. The accounts appear in the **Output** pane.
239284

240285
**To access Azure Data Lake Analytics metadata**
241286

@@ -244,17 +289,15 @@ After you have connected to Azure, you can use the following steps to access the
244289
3. Select one of the Data Lake Analytics databases.
245290
4. Select one of the schemas. You can see the list of tables.
246291

247-
## View Data Lake Analytics jobs
248-
249-
**To view Data Lake Analytics jobs**
292+
**To view Azure Data Lake Analytics jobs**
250293
1. Open the command palette (Ctrl+Shift+P) and select **ADL: Show Jobs**.
251294
2. Select a Data Lake Analytics or local account.
252295
3. Wait for the jobs list for the account to appear.
253296
4. Select a job from job list, Data Lake Tools opens the job view in the right pane and displays some information in VS Code **OUTPUT**.
254297

255298
![Data Lake Tools for Visual Studio Code IntelliSense object types](./media/data-lake-analytics-data-lake-tools-for-vscode/data-lake-tools-for-vscode-show-job.png)
256299

257-
## Azure Data Lake Storage integration
300+
## Integrate with Azure Data Lake Storage through command
258301

259302
You can use Azure Data Lake Storage-related commands to:
260303
- Browse through the Azure Data Lake Storage resources. [List the storage path](#list-the-storage-path).
@@ -306,7 +349,7 @@ As the same time, you can monitor the [uploading status](#check-storage-tasks-st
306349

307350

308351
### Download file
309-
You can download files by entering the commands **ADL: Download File** or **ADL: Download File (Advanced)**.
352+
You can download files using the commands **ADL: Download File** or **ADL: Download File (Advanced)**.
310353

311354
**To download files though the ADL: Download File (Advanced)**
312355
1. Right-click the script editor, and then select **Download File (Advanced)**.
@@ -339,13 +382,10 @@ The status displays on the bottom of the status bar when completed downloading a
339382

340383
![Data Lake Tools for Visual Studio Code Check Storage status](./media/data-lake-analytics-data-lake-tools-for-vscode/storage-status.png)
341384

342-
## VSCode Explorer integration with Azure Data Lake
343-
344-
**Azure Integration**
345385

346-
- Before login to Azure, you can always expand **AZURE DATALAKE**, then click **Sign in to Azure** to login to Azure. After login, you will see all the subscriptions under your Azure account are listed in the left panel of the **AZURE DATALAKE**.
386+
## Integrate with Azure Data Lake Analytics from explorer
347387

348-
![DataLake explorer](./media/data-lake-analytics-data-lake-tools-for-vscode/sign-in-datalake-explorer.png)
388+
- After login, you will see all the subscriptions under your Azure account are listed in the left panel of the **AZURE DATALAKE**.
349389

350390
![DataLake explorer](./media/data-lake-analytics-data-lake-tools-for-vscode/datalake-explorer.png)
351391

@@ -367,33 +407,33 @@ The status displays on the bottom of the status bar when completed downloading a
367407

368408
![DataLake explorer](./media/data-lake-analytics-data-lake-tools-for-vscode/datalake-explorer-register-assembly.png)
369409

370-
**ADLS Integration**
410+
## Integrate with Azure Data Lake Storage from explorer
371411

372412
Navigate to **Data Lake Store**
373413

374-
- On the folder node, you can **Refresh**, **Delete**, **Upload**, **Upload Folder**, **Copy Relative Path**, **Copy Full Path** in the right-click context menu.
414+
- On the folder node, you can **Refresh**, **Delete**, **Upload**, **Upload Folder**, **Copy Relative Path**, and **Copy Full Path** in the right-click context menu.
375415

376416
![DataLake explorer](./media/data-lake-analytics-data-lake-tools-for-vscode/storage-account-folder-menu.png)
377417

378-
- On the file node, you can **Download**, **Preview**, **Delete**, **Copy Relative Path**, **Copy Full Path** in the right-click context menu.
418+
- On the file node, you can **Preview**, **Download**, **Delete**, **Create EXTRACT Script** (only available for CSV, TSV and TXT files), as well as **Copy Relative Path**, and **Copy Full Path** in the right-click context menu.
379419

380-
![DataLake explorer](./media/data-lake-analytics-data-lake-tools-for-vscode/storage-account-download-preview-file.png)
420+
![DataLake explorer - extract](./media/data-lake-analytics-data-lake-tools-for-vscode/storage-account-extract.png)
381421

382-
**WASB Integration**
422+
## Integrate with Azure Blob Storage from explorer
383423

384424
Navigate to **Blob Storage**
385425

386-
- On the blob container node, you can **Refresh**, **Delete Blob Container**, **Upload Blob** in the right-click context menu.
426+
- On the blob container node, you can **Refresh**, **Delete Blob Container**, and **Upload Blob** in the right-click context menu.
387427

388428
![Blob Storage blob container node](./media/data-lake-analytics-data-lake-tools-for-vscode/blob-storage-blob-container-node.png)
389429

390-
- On the folder node, you can **Refresh**, **Upload Blob** in the right-click context menu.
430+
- On the folder node, you can **Refresh**, and **Upload Blob** in the right-click context menu.
391431

392432
![Blob Storage folder node](./media/data-lake-analytics-data-lake-tools-for-vscode/blob-storage-folder-node.png)
393433

394-
- On the file node, you can **Preview/Edit**, **Download**, **Delete**, **Copy Relative Path**, **Copy Full Path** in the right-click context menu.
434+
- On the file node, you can **Preview/Edit**, **Download**, **Delete**, **Create EXTRACT Script** (only available for CSV, TSV and TXT files), as well as **Copy Relative Path**, and **Copy Full Path** in the right-click context menu.
395435

396-
![Blob Storage file node](./media/data-lake-analytics-data-lake-tools-for-vscode/blob-storage-file-node.png)
436+
![Create extract script from context menu](./media/data-lake-analytics-data-lake-tools-for-vscode/create-extract-script-from-context-menu-2.png)
397437

398438
## Open ADL storage explorer in portal
399439
1. Select Ctrl+Shift+P to open the command palette.
@@ -402,14 +442,6 @@ Navigate to **Blob Storage**
402442

403443
Data Lake Tools opens the Azure storage path in the Azure portal. You can find the path and preview the file from the web.
404444

405-
## Local run and local debug for Windows users
406-
U-SQL local run tests your local data and validates your script locally before your code is published to Data Lake Analytics. The local debug feature enables you to complete the following tasks before your code is submitted to Data Lake Analytics:
407-
- Debug your C# code-behind.
408-
- Step through the code.
409-
- Validate your script locally.
410-
411-
For instructions on local run and local debug, see [U-SQL local run and local debug with Visual Studio Code](data-lake-tools-for-vscode-local-run-and-debug.md).
412-
413445
## Additional features
414446

415447
Data Lake Tools for VS Code supports the following features:
Loading
Loading
Loading
38.7 KB
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)