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/synapse-analytics/spark/apache-spark-data-visualization-tutorial.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,16 +35,16 @@ Create an Apache Spark Pool by following the [Create an Apache Spark pool tutori
35
35
3. Because the raw data is in a Parquet format, you can use the Spark context to pull the file into memory as a DataFrame directly. Create a Spark DataFrame by retrieving the data via the Open Datasets API. Here, we use the Spark DataFrame *schema on read* properties to infer the datatypes and schema.
Copy file name to clipboardExpand all lines: articles/synapse-analytics/spark/apache-spark-to-power-bi.md
+23-23Lines changed: 23 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ ms.date: 11/16/2020
12
12
13
13
# Tutorial: Create a Power BI report using Apache Spark and Azure Synapse Analytics
14
14
15
-
Organizations often need to process large volumes of data before serving to key business stakeholders. In this tutorial, you will learn how to leverage the integrated experiences in Azure Synapse Analytics to process data using Apache Spark and later serve the data to end-users through Power BI and Serverless SQL.
15
+
Organizations often need to process large volumes of data before serving to key business stakeholders. In this tutorial, you'll learn how to leverage the integrated experiences in Azure Synapse Analytics to process data using Apache Spark and later serve the data to end-users through Power BI and Serverless SQL.
16
16
17
17
## Before you begin
18
18
-[Azure Synapse Analytics workspace](../quickstart-create-workspace.md) with an ADLS Gen2 storage account configured as the default storage.
@@ -21,29 +21,29 @@ Organizations often need to process large volumes of data before serving to key
21
21
- Serverless Apache Spark pool in your Synapse Analytics workspace. For details, see [create a serverless Apache Spark pool](../quickstart-create-apache-spark-pool-studio.md)
22
22
23
23
## Download and prepare the data
24
-
In this example, you will use Apache Spark to perform some analysis on taxi trip tip data from New York. The data is available through [Azure Open Datasets](https://azure.microsoft.com/services/open-datasets/catalog/nyc-taxi-limousine-commission-yellow-taxi-trip-records/). This subset of the dataset contains information about yellow taxi trips, including information about each trip, the start and end time and locations, the cost, and other interesting attributes.
24
+
In this example, you'll use Apache Spark to perform some analysis on taxi trip tip data from New York. The data is available through [Azure Open Datasets](https://azure.microsoft.com/services/open-datasets/catalog/nyc-taxi-limousine-commission-yellow-taxi-trip-records/). This subset of the dataset contains information about yellow taxi trips, including information about each trip, the start, and end time and locations, the cost, and other interesting attributes.
25
25
26
26
1. Run the following lines to create a Spark dataframe by pasting the code into a new cell. This retrieves the data via the Open Datasets API. Pulling all of this data generates about 1.5 billion rows. The following code example uses start_date and end_date to apply a filter that returns a single month of data.
2. Using Apache Spark SQL, we will create a database called NycTlcTutorial. We will use this database to store the results of our data processing.
38
+
2. Using Apache Spark SQL, we'll create a database called NycTlcTutorial. We'll use this database to store the results of our data processing.
39
39
```python
40
40
%%pyspark
41
-
spark.sql("CREATE DATABASE IF NOT EXISTS NycTlcTutorial")
41
+
spark.sql("CREATE DATABASE IF NOT EXISTS NycTlcTutorial")
42
42
```
43
-
3. Next, we will use Spark dataframe operations to process the data. In the following code, we perform the following transformations:
44
-
1. The removal of columns which are not needed.
43
+
3. Next, we'll use Spark dataframe operations to process the data. In the following code, we perform the following transformations:
44
+
1. The removal of columns which aren't needed.
45
45
2. The removal of outliers/incorrect values through filtering.
46
-
3. The creation of new features like ```tripTimeSecs``` and ```tipped``` for additional analysis.
46
+
3. The creation of new features like ```tripTimeSecs``` and ```tipped``` for extra analysis.
47
47
```python
48
48
from pyspark.sql.functions import unix_timestamp, date_format, col, when
49
49
@@ -62,11 +62,11 @@ In this example, you will use Apache Spark to perform some analysis on taxi trip
62
62
& (filtered_df.rateCodeId <=5)
63
63
& (filtered_df.paymentType.isin({"1", "2"})))
64
64
```
65
-
4. Finally, we will save our dataframe using the Apache Spark ```saveAsTable``` method. This will allow you to later query and connect to the same table using serverless SQL pools.
4. Finally, we'll save our dataframe using the Apache Spark ```saveAsTable``` method. This will allow you to later query and connect to the same table using serverless SQL pools.
Azure Synapse Analytics allows the different workspace computational engines to share databases and tables between its serverless Apache Spark pools and serverless SQL pool. This is powered through the Synapse [shared metadata management](../metadata/overview.md) capability. As a result, the Spark created databases and their parquet-backed tables become visible in the workspace serverless SQL pool.
72
72
@@ -80,7 +80,7 @@ To query your Apache Spark table using your serverless SQL pool:
80
80
3. You can continue to refine your query or even visualize your results using the SQL charting options.
81
81
82
82
## Connect to Power BI
83
-
Next, we will connect our serverless SQL pool to our Power BI workspace. Once you have connected your workspace, you will be able to create Power BI reports both directly from Azure Synapse Analytics as well as from Power BI desktop.
83
+
Next, we'll connect our serverless SQL pool to our Power BI workspace. Once you have connected your workspace, you'll be able to create Power BI reports both directly from Azure Synapse Analytics andfrom Power BI desktop.
84
84
85
85
>[!Note]
86
86
> Before you begin, you will need to set up a linked service to your [Power BI workspace](../quickstart-power-bi.md) and download the [Power BI desktop](/power-bi/service-create-the-new-workspaces).
@@ -104,7 +104,7 @@ To connect our serverless SQL pool to our Power BI workspace:
104
104
105
105
2. On the Power BI desktop Home tab, select **Publish**and**Save** changes. Enter a file name and save this report to the *NycTaxiTutorial Workspace*.
106
106
107
-
3. In addition, you can also create Power BI visualizations from within your Azure Synapse Analytics workspace. To do this, navigate to the **Develop** tab in your Azure Synapse workspace and open the Power BI tab. From here, you can select your report and continue building additional visualizations.
107
+
3. In addition, you can also create Power BI visualizations from within your Azure Synapse Analytics workspace. To do this, navigate to the **Develop** tab in your Azure Synapse workspace andopen the Power BI tab. From here, you can select your report andcontinue building more visualizations.
0 commit comments