Skip to content

Commit 6ad3f6c

Browse files
committed
edit pass: azure-synapse-analytics-code-artifacts
1 parent a3b8c12 commit 6ad3f6c

File tree

2 files changed

+70
-62
lines changed

2 files changed

+70
-62
lines changed

articles/synapse-analytics/spark/apache-spark-development-using-notebooks.md

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -285,13 +285,13 @@ A step-by-step status of a cell run appears beneath the cell to help you see its
285285

286286
A Synapse notebook is purely Spark based. Code cells run on the serverless Apache Spark pool remotely. A Spark job progress indicator with a real-time progress bar appears to help you understand the job run status.
287287

288-
The number of tasks for each job or stage help you identify the parallel level of your Spark job. You can also drill deeper to the Spark UI of a specific job (or stage) by selecting the link on the job (or stage) name.
288+
The number of tasks for each job or stage helps you identify the parallel level of your Spark job. You can also drill deeper to the Spark UI of a specific job (or stage) by selecting the link on the job (or stage) name.
289289

290290
![Screenshot of the Spark progress indicator in a Synapse notebook.](./media/apache-spark-development-using-notebooks/synapse-spark-progress-indicator.png)
291291

292292
### Configure a Spark session
293293

294-
You can specify the timeout duration, the number, and the size of executors to give to the current Spark session on the **Configure session** pane. Restart the Spark session for configuration changes to take effect. All cached notebook variables are cleared.
294+
On the **Configure session** pane, you can specify the timeout duration, the number, and the size of executors to give to the current Spark session. Restart the Spark session for configuration changes to take effect. All cached notebook variables are cleared.
295295

296296
You can also create a configuration from the Apache Spark configuration or select an existing configuration. For details, refer to [Manage Apache Spark configuration](../../synapse-analytics/spark/apache-spark-azure-create-spark-configuration.md).
297297

@@ -369,7 +369,7 @@ During the pipeline run mode, you can use the **Settings** tab to configure sett
369369

370370
![Screenshot of parameterized session configuration in a Synapse notebook.](./media/apache-spark-development-using-notebooks/parameterized-session-config.png)
371371

372-
If you want to change the session configuration, the name of the pipeline notebook activity parameter should be same as `activityParameterName` in the notebook. In this example, during a pipeline run, `driverCores` in `%%configure` will be replaced by `8` and `livy.rsc.sql.num-rows` will be replaced by `4000`.
372+
If you want to change the session configuration, the name of the pipeline notebook activity parameter should be the same as `activityParameterName` in the notebook. In this example, during a pipeline run, `8` replaces `driverCores` in `%%configure`, and `4000` replaces `livy.rsc.sql.num-rows`.
373373

374374
If a pipeline run fails after you use the `%%configure` magic command, you can get more error information by running the `%%configure` magic cell in the interactive mode of the notebook.
375375

@@ -393,7 +393,7 @@ df1 = spark.read.option('header', 'true') \
393393

394394
```
395395

396-
#### Read a CSV file from Azure Blob Storage as a Spark DataFrame
396+
### Read a CSV file from Azure Blob Storage as a Spark DataFrame
397397

398398
```python
399399

@@ -432,7 +432,7 @@ Widgets are eventful Python objects that have a representation in the browser, o
432432

433433
### Steps to use IPython widgets
434434

435-
1. Import `ipywidgets` module to use the Jupyter Widgets framework:
435+
1. Import the `ipywidgets` module to use the Jupyter Widgets framework:
436436

437437
```python
438438
import ipywidgets as widgets
@@ -477,12 +477,12 @@ display(slider2)
477477

478478
|Widget type|Widgets|
479479
|--|--|
480-
|Numeric|IntSlider, FloatSlider, FloatLogSlider, IntRangeSlider, FloatRangeSlider, IntProgress, FloatProgress, BoundedIntText, BoundedFloatText, IntText, FloatText|
481-
|Boolean|ToggleButton, Checkbox, Valid|
482-
|Selection|Dropdown, RadioButtons, Select, SelectionSlider, SelectionRangeSlider, ToggleButtons, SelectMultiple|
483-
|String|Text, Text area, Combobox, Password, Label, HTML, HTML Math, Image, Button|
484-
|Play (animation)|Date picker, Color picker, Controller|
485-
|Container/Layout|Box, HBox, VBox, GridBox, Accordion, Tabs, Stacked|
480+
|Numeric|`IntSlider`, `FloatSlider`, `FloatLogSlider`, `IntRangeSlider`, `FloatRangeSlider`, `IntProgress`, `FloatProgress`, `BoundedIntText`, `BoundedFloatText`, `IntText`, `FloatText`|
481+
|Boolean|`ToggleButton`, `Checkbox`, `Valid`|
482+
|Selection|`Dropdown`, `RadioButtons`, `Select`, `SelectionSlider`, `SelectionRangeSlider`, `ToggleButtons`, `SelectMultiple`|
483+
|String|`Text`, `Text area`, `Combobox`, `Password`, `Label`, `HTML`, `HTML Math`, `Image`, `Button`|
484+
|Play (animation)|`Date picker`, `Color picker`, `Controller`|
485+
|Container/Layout|`Box`, `HBox`, `VBox`, `GridBox`, `Accordion`, `Tabs`, `Stacked`|
486486

487487
### Known limitations
488488

@@ -531,7 +531,7 @@ Available magic commands for cells:
531531

532532
## <a name = "reference-unpublished-notebook"></a>Reference an unpublished notebook
533533

534-
Referencing an unpublished notebook is helpful when you want to debug locally. When you enable this feature, a notebook run fetches the current content in web cache. If you run a cell that includes a reference notebook statement, you reference the presenting notebooks in the current notebook browser instead of a saved versions in cluster. Other notebooks can reference the changes in your notebook editor without your having to publish (Live mode) or commit (Git mode) the changes. By using this approach, you can prevent the pollution of common libraries during the developing or debugging process.
534+
Referencing an unpublished notebook is helpful when you want to debug locally. When you enable this feature, a notebook run fetches the current content in web cache. If you run a cell that includes a reference notebook statement, you reference the presenting notebooks in the current notebook browser instead of a saved version in a cluster. Other notebooks can reference the changes in your notebook editor without your having to publish (Live mode) or commit (Git mode) the changes. By using this approach, you can prevent the pollution of common libraries during the developing or debugging process.
535535

536536
You can enable referencing an unpublished notebook by selecting the appropriate checkbox on the **Properties** pane.
537537

@@ -607,7 +607,7 @@ customizedLogger.critical("customized critical message")
607607

608608
## View the history of input commands
609609

610-
Synapse notebooks support the magic command `%history` to print the input command history that ran in the current session. The `%history` magic command is similar to the standard Jupyter IPython command and works for multiple language contexts in notebook.
610+
Synapse notebooks support the magic command `%history` to print the input command history for the current session. The `%history` magic command is similar to the standard Jupyter IPython command and works for multiple language contexts in a notebook.
611611

612612
`%history [-n] [range [range ...]]`
613613

@@ -616,9 +616,7 @@ In the preceding code, `-n` is the print execution number. The `range` value can
616616
* `N`: Print code of the `Nth` executed cell.
617617
* `M-N`: Print code from the `Mth` to `Nth` executed cell.
618618

619-
Example:
620-
621-
* Print input history from the first to the second executed cell: `%history -n 1-2`
619+
For example, to print input history from the first to the second executed cell, use `%history -n 1-2`.
622620

623621
## Integrate a notebook
624622

@@ -634,15 +632,15 @@ To parameterize your notebook, select the ellipsis (**...**) to access more comm
634632

635633
![Screenshot of the menu option for designating a cell as a parameter cell.](./media/apache-spark-development-using-notebooks/azure-notebook-toggle-parameter-cell.png)
636634

637-
Azure Data Factory looks for the parameter cell and treats this cell as defaults for the parameters passed in at execution time. The execution engine adds a new cell beneath the parameter cell with input parameters to overwrite the default values.
635+
Azure Data Factory looks for the parameter cell and treats this cell as the default for the parameters passed in at execution time. The execution engine adds a new cell beneath the parameter cell with input parameters to overwrite the default values.
638636

639637
### Assign parameters values from a pipeline
640638

641-
After you create a notebook with parameters, you can run it from a pipeline by using a Synapse notebook activity. After you add the activity to your pipeline canvas, you can set the parameter values in the **Base parameters** section on the **Settings** tab.
639+
After you create a notebook with parameters, you can run it from a pipeline by using a Synapse notebook activity. After you add the activity to your pipeline canvas, you can set the parameter values in the **Base parameters** section of the **Settings** tab.
642640

643641
![Screenshot of the area for assigning parameters in Azure Synapse Analytics.](./media/apache-spark-development-using-notebooks/assign-parameter.png)
644642

645-
When assigning parameter values, you can use the [pipeline expression language](../../data-factory/control-flow-expression-language-functions.md) or [system variables](../../data-factory/control-flow-system-variables.md).
643+
When you're assigning parameter values, you can use the [pipeline expression language](../../data-factory/control-flow-expression-language-functions.md) or [system variables](../../data-factory/control-flow-system-variables.md).
646644

647645
## Use shortcut keys
648646

@@ -658,7 +656,7 @@ Similar to Jupyter Notebooks, Synapse notebooks have a modal user interface. The
658656

659657
### Shortcut keys in command mode
660658

661-
| Action |Synapse notebook shortcuts |
659+
| Action |Synapse notebook shortcut |
662660
|--|--|
663661
|Run the current cell and select below | Shift+Enter |
664662
|Run the current cell and insert below | Alt+Enter |
@@ -674,7 +672,7 @@ Similar to Jupyter Notebooks, Synapse notebooks have a modal user interface. The
674672

675673
### Shortcut keys in edit mode
676674

677-
| Action |Synapse notebook shortcuts |
675+
| Action |Synapse notebook shortcut |
678676
|--|--|
679677
|Move cursor up | Up |
680678
|Move cursor down|Down|
Lines changed: 51 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: SQL scripts in Synapse Studio
3-
description: Introduction to Synapse Studio SQL scripts in Azure synapse Analytics.
3+
description: Get an introduction to Synapse Studio SQL scripts in Azure Synapse Analytics.
44
author: pimorano
55
ms.service: synapse-analytics
66
ms.subservice: sql
@@ -9,81 +9,91 @@ ms.date: 04/15/2020
99
ms.author: pimorano
1010
ms.reviewer: omafnan
1111
---
12+
1213
# Synapse Studio SQL scripts in Azure Synapse Analytics
1314

14-
Synapse Studio provides a SQL script web interface for you to author SQL queries.
15+
Synapse Studio provides a web interface for SQL scripts where you can author SQL queries.
16+
17+
## Begin authoring in a SQL script
1518

16-
## Begin authoring in SQL script
19+
To start the authoring experience in a SQL script, you can create a new SQL script through one of the following methods on the **Develop** pane:
1720

18-
There are several ways to start the authoring experience in SQL script. You can create a new SQL script through one of the following methods.
21+
- Select the plus sign (**+**), and then select **SQL script**.
1922

20-
1. From the Develop menu, select the **"+"** icon and choose **SQL script**.
23+
- Right-click the number next to **SQL scripts**, and then select **New SQL script**.
2124

22-
2. From the **Actions** menu, choose **New SQL script**.
25+
- Right-click the number next to **SQL scripts**, and then select **Import**. Select an existing SQL script from your local storage.
2326

24-
3. Choose **Import** from the **Actions** menu under Develop SQL scripts. Select an existing SQL script from your local storage.
25-
![new sql script 3 actions](media/author-sql-script/new-sql-script-3-actions.png)
27+
![Screenshot that shows the Develop pane and the command to import a SQL script.](media/author-sql-script/new-sql-script-3-actions.png)
2628

2729
## Create your SQL script
2830

29-
1. Choose a name for your SQL script by selecting the **Property** button and replacing the default name assigned to the SQL script.
30-
![new sql script rename](media/author-sql-script/new-sql-script-rename.png)
31+
1. Choose a name for your SQL script by selecting the **Properties** button and replacing the default name assigned to the SQL script.
32+
33+
![Screenshot that shows the pane for SQL script properties.](media/author-sql-script/new-sql-script-rename.png)
3134

32-
2. Choose the specific dedicated SQL pool or serverless SQL pool from the **Connect to** drop-down menu. Or if necessary, choose the database from **Use database**.
33-
![new sql choose pool](media/author-sql-script/new-sql-choose-pool.png)
35+
2. On the **Connect to** dropdown menu, select the specific dedicated SQL pool or serverless SQL pool. Or if necessary, choose the database from **Use database**.
3436

35-
3. Start authoring your SQL script using the intellisense feature.
37+
![Screenshot that shows the dropdown menu for selecting a SQL pool.](media/author-sql-script/new-sql-choose-pool.png)
38+
39+
3. Start authoring your SQL script by using the IntelliSense feature.
3640

3741
## Run your SQL script
3842

39-
Select the **Run** button to execute your SQL script. The results are displayed by default in a table.
43+
To run your SQL script, select the **Run** button. The results appear in a table by default.
4044

41-
![new sql script results table](media/author-sql-script/new-sql-script-results-table.png)
45+
![Screenshot that shows the button for running a SQL script and the table that lists results.](media/author-sql-script/new-sql-script-results-table.png)
4246

43-
Synapse Studio creates a new session for each SQL script execution. Once a SQL script execution completes, the session is automatically closed.
47+
Synapse Studio creates a new session for each SQL script execution. After a SQL script execution finishes, the session is automatically closed.
4448

45-
Temporary tables are only visible to the session in which they were created and are automatically dropped when the session closes.
49+
Temporary tables are visible only in the session where you created them. They're automatically dropped when the session closes.
4650

4751
## Export your results
4852

49-
You can export the results to your local storage in different formats (including CSV, Excel, JSON, XML) by selecting "Export results" and choosing the extension.
53+
You can export the results to your local storage in various formats (including CSV, Excel, JSON, and XML) by selecting **Export results** and choosing the extension.
5054

51-
You can also visualize the SQL script results in a chart by selecting the **Chart** button. Select the "Chart type" and **Category column**. You can export the chart into a picture by selecting **Save as image**.
55+
You can also visualize the SQL script results in a chart by selecting the **Chart** button. Then select the **Chart type** and **Category column** values. You can export the chart into a picture by selecting **Save as image**.
5256

53-
![new sql script results chart](media/author-sql-script/new-sql-script-results-chart.png)
57+
![Screenshot that shows a results chart for a SQL script.](media/author-sql-script/new-sql-script-results-chart.png)
5458

5559
## Explore data from a Parquet file
5660

57-
You can explore Parquet files in a storage account using SQL script to preview the file contents.
61+
You can explore Parquet files in a storage account by using a SQL script to preview the file contents.
62+
63+
![Screenshot that shows selections for using a SQL script to preview contents of a Parquet file.](media/author-sql-script/new-script-sqlod-parquet.png)
5864

59-
![new script sqlod parquet](media/author-sql-script/new-script-sqlod-parquet.png)
65+
## Use SQL tables, external tables, and views
6066

61-
## SQL Tables, external tables, views
67+
By using a shortcut menu on the **Data** pane, you can select actions for resources like SQL tables, external tables, and views. Explore the available commands by right-clicking the nodes of SQL databases. The commands for **New SQL script** include:
6268

63-
By selecting the **Actions** menu under data, you can select several actions such as:
69+
- **Select TOP 100 rows**
70+
- **CREATE**
71+
- **DROP**
72+
- **DROP and CREATE**
6473

65-
- New SQL script
66-
- Select TOP 1000 rows
67-
- CREATE
68-
- DROP and CREATE
69-
70-
Explore the available gesture by right-clicking the nodes of SQL databases.
71-
72-
![new script database](media/author-sql-script/new-script-database.png)
74+
![Screenshot that shows shortcut menus for a table node.](media/author-sql-script/new-script-database.png)
7375

7476
## Create folders and move SQL scripts into a folder
7577

76-
From the Actions menu under Develop SQL scripts Choose "New folder" from the "Actions" menu under Develop SQL scripts. And type in the name of the new folder in the pop-up window.
78+
To create a folder:
79+
80+
1. On the **Develop** pane, right-click in the **SQL scripts** area and then select **New folder**.
81+
82+
> [!div class="mx-imgBorder"]
83+
> ![Screenshot that shows an example of an SQL script and a shortcut menu with the command to create a new folder.](./media/author-sql-script/new-sql-script-create-folder.png)
84+
85+
1. On the **New folder** pane, enter the name of the new folder.
86+
87+
To move a SQL script into a folder:
7788

78-
> [!div class="mx-imgBorder"]
79-
> ![Screenshot that shows an example of an SQL script with 'New folder' selected.](./media/author-sql-script/new-sql-script-create-folder.png)
89+
1. Right-click the SQL script, and then select **Move to**.
8090

81-
To move a SQL script into a folder, you can select the sql script and choose "Move To" from the Actions menu. Then find the destination folder in the new window and move the sql script into selected folder.You can also quickly drag the sql script and drop it into a folder.
91+
1. On the **Move to** pane, choose a destination folder, and then select **Move here**. You can also quickly drag the SQL script and drop it into a folder.
8292

83-
> [!div class="mx-imgBorder"]
84-
> ![newsqlscript](./media/author-sql-script/new-sql-script-move-folder.png)
93+
> [!div class="mx-imgBorder"]
94+
> ![Screenshot that shows selections for moving a SQL script into a folder.](./media/author-sql-script/new-sql-script-move-folder.png)
8595
86-
## Next steps
96+
## Related content
8797

88-
For more information about authoring a SQL script, see
89-
[Azure Synapse Analytics](../index.yml).
98+
- For more information about authoring a SQL script, see the
99+
[Azure Synapse Analytics documentation](../index.yml).

0 commit comments

Comments
 (0)