Skip to content

Commit cfe15b2

Browse files
authored
Merge pull request #223749 from v-lanjunli/updatetitle
modify
2 parents f491239 + 3297023 commit cfe15b2

File tree

4 files changed

+27
-11
lines changed

4 files changed

+27
-11
lines changed

articles/synapse-analytics/monitoring/apache-spark-advisor.md

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Spark Advisor
2+
title: Apache Spark Advisor in Azure Synapse Analytics
33
description: Spark Advisor is a system to automatically analyze commands/queries, and show the appropriate advice when a customer executes code or query.
44
services: synapse-analytics
55
author: jejiang
@@ -11,24 +11,23 @@ ms.subservice: spark
1111
ms.date: 06/23/2022
1212
---
1313

14-
# Spark Advisor
14+
# Apache Spark Advisor in Azure Synapse Analytics
1515

16-
Spark Advisor is a system to automatically analyze commands/queries, and show the appropriate advice when customer executes code or query. After applying the advice, you would have chance to improve your execution performance, decrease cost and fix the execution failures.
16+
The Apache Spark advisor analyzes commands and code run by Spark and displays real-time advice for Notebook runs. The Spark advisor has built-in patterns to help users avoid common mistakes, offer recommendations for code optimization, perform error analysis, and locate the root cause of failures.
1717

18+
## Built-in advices
1819

19-
20-
## May return inconsistent results when using 'randomSplit'
20+
### May return inconsistent results when using 'randomSplit'
2121
Inconsistent or inaccurate results may be returned when working with the results of the 'randomSplit' method. Use Apache Spark (RDD) caching before using the 'randomSplit' method.
2222

2323
Method randomSplit() is equivalent to performing sample() on your data frame multiple times, with each sample refetching, partitioning, and sorting your data frame within partitions. The data distribution across partitions and sorting order is important for both randomSplit() and sample(). If either changes upon data refetch, there may be duplicates, or missing values across splits and the same sample using the same seed may produce different results.
2424

2525
These inconsistencies may not happen on every run, but to eliminate them completely, cache your data frame, repartition on a column(s), or apply aggregate functions such as groupBy.
2626

27-
## Table/view name is already in use
27+
### Table/view name is already in use
2828
A view already exists with the same name as the created table, or a table already exists with the same name as the created view.
2929
When this name is used in queries or applications, only the view will be returned no matter which one created first. To avoid conflicts, rename either the table or the view.
3030

31-
## Hints related advise
3231
### Unable to recognize a hint
3332
The selected query contains a hint that isn't recognized. Verify that the hint is spelled correctly.
3433

@@ -50,23 +49,40 @@ The selected query contains a hint that prevents another hint from being applied
5049
spark.sql("SELECT /*+ BROADCAST(t1), MERGE(t1, t2) */ * FROM t1 INNER JOIN t2 ON t1.str = t2.str")
5150
```
5251

53-
## Enable 'spark.advise.divisionExprConvertRule.enable' to reduce rounding error propagation
52+
### Enable 'spark.advise.divisionExprConvertRule.enable' to reduce rounding error propagation
5453
This query contains the expression with Double type. We recommend that you enable the configuration 'spark.advise.divisionExprConvertRule.enable', which can help reduce the division expressions and to reduce the rounding error propagation.
5554

5655
```text
5756
"t.a/t.b/t.c" convert into "t.a/(t.b * t.c)"
5857
```
5958

60-
## Enable 'spark.advise.nonEqJoinConvertRule.enable' to improve query performance
59+
### Enable 'spark.advise.nonEqJoinConvertRule.enable' to improve query performance
6160
This query contains time consuming join due to "Or" condition within query. We recommend that you enable the configuration 'spark.advise.nonEqJoinConvertRule.enable', which can help to convert the join triggered by "Or" condition to SMJ or BHJ to accelerate this query.
6261

63-
## Optimize delta table with small files compaction
62+
### Optimize delta table with small files compaction
6463

6564
This query is on a delta table with many small files. To improve the performance of queries, run the OPTIMIZE command on the delta table. More details could be found within this [article](https://aka.ms/small-file-advise-delta).
6665

67-
## Optimize Delta table with ZOrder
66+
### Optimize Delta table with ZOrder
6867

6968
This query is on a Delta table and contains a highly selective filter. To improve the performance of queries, run the OPTIMIZE ZORDER BY command on the delta table. More details could be found within this [article](https://aka.ms/small-file-advise-delta).
69+
70+
## User Experience
71+
72+
The Apache Spark advisor displays the advices, including info, warning and errors, at Notebook cell output real-time.
73+
74+
* Info
75+
76+
![Screenshot showing for advice information.](./media/apache-spark-advisor/info.png)
77+
78+
* Warning
79+
80+
![Screenshot showing for advice warning.](./media/apache-spark-advisor/warning.png)
81+
82+
* Errors
83+
84+
![Screenshot showing for advice error.](./media/apache-spark-advisor/error.png)
85+
7086
## Next steps
7187

7288
For more information on monitoring pipeline runs, see the [Monitor pipeline runs using Synapse Studio](how-to-monitor-pipeline-runs.md) article.
273 KB
Loading
56 KB
Loading
41.7 KB
Loading

0 commit comments

Comments
 (0)