Skip to content

Commit a7dcb2b

Browse files
authored
Merge pull request #92096 from djpmsft/docUpdates
Data Flow script exists
2 parents 9994cee + f81a61d commit a7dcb2b

File tree

6 files changed

+55
-14
lines changed

6 files changed

+55
-14
lines changed

articles/data-factory/data-flow-aggregate.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Aggregate transformation in mapping data flow - Azure Data Factory | Microsoft Docs
2+
title: Aggregate transformation in Azure Data Factory mapping data flow | Microsoft Docs
33
description: Learn how to aggregate data at scale in Azure Data Factory with the mapping data flow Aggregate transformation.
44
author: kromerm
55
ms.author: makromer
@@ -63,7 +63,9 @@ Aggregate transformations are similar to SQL aggregate select queries. Columns t
6363

6464
### Example
6565

66-
The below example takes an incoming stream `MoviesYear` and groups rows by column `year`. The transformation creates an aggregate column `avgrating` that evaluates to the average of column `Rating`. This aggregate transformation is named `AvgComedyRatingsByYear`. In the Data Factory UX, this transformation looks like the below image:
66+
The below example takes an incoming stream `MoviesYear` and groups rows by column `year`. The transformation creates an aggregate column `avgrating` that evaluates to the average of column `Rating`. This aggregate transformation is named `AvgComedyRatingsByYear`.
67+
68+
In the Data Factory UX, this transformation looks like the below image:
6769

6870
![Group by example](media/data-flow/agg-script1.png "Group by example")
6971

articles/data-factory/data-flow-derived-column.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Derived Column transformation in mapping data flow - Azure Data Factory | Microsoft Docs
2+
title: Derived column transformation in Azure Data Factory mapping data flow | Microsoft Docs
33
description: Learn how to transform data at scale in Azure Data Factory with the mapping data flow Derived Column transformation.
44
author: kromerm
55
ms.author: makromer
@@ -41,7 +41,9 @@ To add additional derived columns, hover over an existing derived column and cli
4141

4242
### Example
4343

44-
The below example is a derived column named `CleanData` that takes an incoming stream `MoviesYear` and creates two derived columns. The first derived column replaces column `Rating` with Rating's value as an integer type. The second derived column is a pattern that matches each column whose name starts with 'movies'. For each matched column, it creates a column `movie` that is equal to the value of the matched column prefixed with 'movie_'. In the Data Factory UX, this transformation looks like the below image:
44+
The below example is a derived column named `CleanData` that takes an incoming stream `MoviesYear` and creates two derived columns. The first derived column replaces column `Rating` with Rating's value as an integer type. The second derived column is a pattern that matches each column whose name starts with 'movies'. For each matched column, it creates a column `movie` that is equal to the value of the matched column prefixed with 'movie_'.
45+
46+
In the Data Factory UX, this transformation looks like the below image:
4547

4648
![Derive example](media/data-flow/derive-script1.png "Derive example")
4749

articles/data-factory/data-flow-exists.md

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,71 @@
11
---
2-
title: Azure Data Factory mapping data flow Exists transformation
3-
description: How to check for existing rows using data factory mapping data flows with Exists transformation
2+
title: Exists transformation in Azure Data Factory mapping data flow | Microsoft Docs
3+
description: Check for existing rows using the exists transformation in Azure Data Factory mapping data flow
44
author: kromerm
55
ms.author: makromer
6+
ms.reviewer: daperlov
67
ms.service: data-factory
78
ms.topic: conceptual
8-
ms.date: 01/30/2019
9+
ms.date: 10/16/2019
910
---
1011

1112
# Mapping data flow exists transformation
1213

14+
The exists transformation is a row filtering transformation that checks whether your data exists in another source or stream. The output stream includes all rows in the left stream that either exist or don't exist in the right stream. The exists transformation is similar to ```SQL WHERE EXISTS``` and ```SQL WHERE NOT EXISTS```.
1315

16+
## Configuration
1417

15-
The Exists transformation is a row filtering transformation that stops or allows rows in your data to flow through. The Exists Transform is similar to ```SQL WHERE EXISTS``` and ```SQL WHERE NOT EXISTS```. After the Exists Transformation, the resulting rows from your data stream will either include all rows where column values from source 1 exist in source 2 or do not exist in source 2.
18+
Choose which data stream you're checking for existence in the **Right stream** dropdown.
19+
20+
Specify whether you're looking for the data to exist or not exist in the **Exist type** setting.
21+
22+
Choose which key columns you want to compare as your exists conditions. By default, data flow looks for equality between one column in each stream. To compare via a compute value, hover over the column dropdown and select **Computed column**.
1623

1724
![Exists settings](media/data-flow/exists.png "exists 1")
1825

19-
Choose the second source for your Exists so that Data Flow can compare values from Stream 1 against Stream 2.
26+
### Multiple exists conditions
2027

21-
Select the column from Source 1 and from Source 2 whose values you wish to check against for Exists or Not Exists.
28+
To compare multiple columns from each stream, add a new exists condition by clicking the plus icon next to an existing row. Each additional condition is joined by an "and" statement. Comparing two columns is the same as the following expression:
2229

23-
## Multiple exists conditions
30+
`source1@column1 == source2@column1 && source1@column2 == source2@column2`
2431

25-
Next to each row in your column conditions for Exists, you'll find a + sign available when you hover over reach row. This will allow you to add multiple rows for Exists conditions. Each additional condition is an "And".
32+
### Custom expression
2633

27-
## Custom expression
34+
To create a free-form expression that contains operators other than "and" and "equals to", select the **Custom expression** field. Enter a custom expression via the data flow expression builder by clicking on the blue box.
2835

2936
![Exists custom settings](media/data-flow/exists1.png "exists custom")
3037

31-
You can click "Custom Expression" to instead create a free-form expression as your exists or not-exists condition. Checking this box will allow you to type in your own expression as a condition.
38+
## Data flow script
39+
40+
### Syntax
41+
42+
```
43+
<lefttream>, <rightStream>
44+
exists(
45+
<conditionalExpression>,
46+
negate: true | <false>,
47+
broadcast: 'none' | 'left' | 'right' | 'both'
48+
) ~> <existsTransformationName>
49+
```
50+
51+
### Example
52+
53+
The below example is an exists transformation named `checkForChanges` that takes left stream `NameNorm2` and right stream `TypeConversions`. The exists condition is the expression `NameNorm2@EmpID == TypeConversions@EmpID && NameNorm2@Region == DimEmployees@Region` that returns true if both the `EMPID` and `Region` columns in each stream matches. As we're checking for existence, `negate` is false. We aren't enabling any broadcasting in the optimize tab so `broadcast` has value `'none'`.
54+
55+
In the Data Factory UX, this transformation looks like the below image:
56+
57+
![Exists example](media/data-flow/exists-script.png "Exists example")
58+
59+
The data flow script for this transformation is in the snippet below:
60+
61+
```
62+
NameNorm2, TypeConversions
63+
exists(
64+
NameNorm2@EmpID == TypeConversions@EmpID && NameNorm2@Region == DimEmployees@Region,
65+
negate:false,
66+
broadcast: 'none'
67+
) ~> checkForChanges
68+
```
3269

3370
## Next steps
3471

24 KB
Loading
33.1 KB
Loading
13.7 KB
Loading

0 commit comments

Comments
 (0)