Skip to content

Commit df9616a

Browse files
committed
Restructure
1 parent 9166fb7 commit df9616a

File tree

6 files changed

+110
-122
lines changed

6 files changed

+110
-122
lines changed

articles/iot-operations/connect-to-cloud/concept-dataflow-conversions.md

Lines changed: 96 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Dataflow conversions
2+
title: Convert data using dataflow conversions
33
description: Learn about dataflow conversions for transforming data in Azure IoT Operations.
44
author: PatAltimore
55
ms.author: patricka
@@ -10,7 +10,7 @@ ms.date: 08/01/2024
1010
#CustomerIntent: As an operator, I want to understand how to use dataflow conversions to transform data.
1111
---
1212

13-
# Dataflow conversions
13+
# Convert data using dataflow conversions
1414

1515
You can use dataflow conversions to transform data in Azure IoT Operations. The *conversion* element in a dataflow is used to compute values for output fields. You can use input fields, available operations, data types, and type conversions in dataflow conversions.
1616

@@ -214,3 +214,97 @@ Functions can be used in the conversion formula to perform various operations.
214214
* string manipulation (for example, `uppercase()`)
215215
* explicit conversion (for example, `ISO8601_datetime`)
216216
* aggregation (for example, `avg()`)
217+
218+
## Available operations
219+
220+
Dataflow offers a wide range of out-of-the-box (OOTB) conversion functions that allow users to easily perform unit conversions without the need for complex calculations. These predefined functions cover common conversions such as temperature, pressure, length, weight, and volume. The following is a list of the available conversion functions, along with their corresponding formulas and function names:
221+
222+
| Conversion | Formula | Function Name |
223+
| --- | --- | --- |
224+
| Celsius to Fahrenheit | F = (C * 9/5) + 32 | cToF |
225+
| PSI to Bar | Bar = PSI * 0.0689476 | psiToBar |
226+
| Inch to CM | CM = Inch * 2.54 | inToCm |
227+
| Foot to Meter | Meter = Foot * 0.3048 | ftToM |
228+
| Lbs to KG | KG = Lbs * 0.453592 | lbToKg |
229+
| Gallons to Liters | Liters = Gallons * 3.78541 | galToL |
230+
231+
In addition to these unidirectional conversions, we also support the reverse calculations:
232+
233+
| Conversion | Formula | Function Name |
234+
| --- | --- | --- |
235+
| Fahrenheit to Celsius | C = (F - 32) * 5/9 | fToC |
236+
| Bar to PSI | PSI = Bar / 0.0689476 | barToPsi |
237+
| CM to Inch | Inch = CM / 2.54 | cmToIn |
238+
| Meter to Foot | Foot = Meter / 0.3048 | mToFt |
239+
| KG to Lbs | Lbs = KG / 0.453592 | kgToLb |
240+
| Liters to Gallons | Gallons = Liters / 3.78541 | lToGal |
241+
242+
These functions are designed to simplify the conversion process, allowing users to input values in one unit and receive the corresponding value in another unit effortlessly.
243+
244+
Additionally, we provide a scaling function to scale the range of value to the user-defined range. Example-`scale($1,0,10,0,100)`the input value is scaled from the range 0 to 10 to the range 0 to 100.
245+
246+
Moreover, users have the flexibility to define their own conversion functions using simple mathematical formulas. Our system supports basic operators such as addition (`+`), subtraction (`-`), multiplication (`*`), and division (`/`). These operators follow standard rules of precedence (for example, multiplication and division are performed before addition and subtraction), which can be adjusted using parentheses to ensure the correct order of operations. This capability empowers users to customize their unit conversions to meet specific needs or preferences, enhancing the overall utility and versatility of the system.
247+
248+
249+
For more complex calculations, functions like `sqrt` (which finds the square root of a number) are also available.
250+
251+
### Available arithmetic, comparison, and boolean operators grouped by precedence
252+
253+
| Operator | Description |
254+
|----------|-------------|
255+
| ^ | Exponentiation: $1 ^ 3 |
256+
257+
Since `Exponentiation` has the highest precedence, it's executed first unless parentheses override this order:
258+
259+
* `$1 * 2 ^ 3` is interpreted as `$1 * 8` because the `2 ^ 3` part is executed first, before multiplication.
260+
* `($1 * 2) ^ 3` processes the multiplication before exponentiation.
261+
262+
| Operator | Description |
263+
|----------|-------------|
264+
| - | Negation |
265+
| ! | Logical not |
266+
267+
`Negation` and `Logical not` have high precedence, so they always stick to their immediate neighbor, except when exponentiation is involved:
268+
269+
* `-$1 * 2` negates $1 first, then multiplies.
270+
* `-($1 * 2)` multiplies, then negates the result
271+
272+
| Operator | Description |
273+
|----------|-------------|
274+
| * | Multiplication: $1 * 10 |
275+
| / | Division: $1 / 25 (Result is an integer if both arguments are integers, otherwise float) |
276+
| % | Modulo: $1 % 25 |
277+
278+
`Multiplication`, `Division`, and `Modulo`, having the same precedence, are executed from left to right, unless the order is altered by parentheses.
279+
280+
| Operator | Description |
281+
|----------|-------------|
282+
| + | Addition for numeric values, concatenation for strings |
283+
| - | Subtraction |
284+
285+
`Addition` and `Subtraction` are considered weaker operations compared to those in the previous group:
286+
287+
* `$1 + 2 * 3` results in `$1 + 6`, as `2 * 3` is executed first due to the higher precedence of `Multiplication`.
288+
* `($1 + 2) * 3` prioritizes the `addition` before `multiplication`.
289+
290+
| Operator | Description |
291+
|----------|-------------|
292+
| < | Less than |
293+
| > | Greater than |
294+
| <= | Less than or equal to |
295+
| >= | Greater than or equal to |
296+
| == | Equal to |
297+
| != | Not equal to |
298+
299+
`Comparisons` operate on numeric, boolean, and string values. Since they have lower precedence than arithmetic operators, no parentheses are needed to compare results effectively:
300+
301+
* `$1 * 2 <= $2` is equivalent to `($1 * 2) <= $2`.
302+
303+
| Operator | Description |
304+
|----------|-------------|
305+
| \|\| | Logical OR |
306+
| && | Logical AND |
307+
308+
Logical operators are used to chain conditions:
309+
310+
* `$1 > 100 && $2 > 200`
File renamed without changes.

articles/iot-operations/connect-to-cloud/concept-dataflow-language.md renamed to articles/iot-operations/connect-to-cloud/concept-dataflow-mapping.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
---
2-
title: Dataflow mapping language
2+
title: Map data using dataflows
33
description: Learn about the dataflow mapping language for transforming data in Azure IoT Operations.
44
author: PatAltimore
55
ms.author: patricka
66
ms.subservice: azure-data-flows
77
ms.topic: concept-article
8-
ms.date: 07/31/2024
8+
ms.date: 08/02/2024
99

1010
#CustomerIntent: As an operator, I want to understand how to use the dataflow mapping language to transform data.
1111
---
1212

13-
# Dataflow mapping language
13+
# Map data using dataflows
1414

1515
[!INCLUDE [public-preview-note](../includes/public-preview-note.md)]
1616

@@ -89,7 +89,7 @@ Field references show how to specify paths in the input and output, using dot no
8989

9090
## Contextualization dataset selectors
9191

92-
These selectors allow mappings to integrate additional data from external databases, referred to as *contextualization datasets*.
92+
These selectors allow mappings to integrate extra data from external databases, referred to as *contextualization datasets*.
9393

9494
## Record filtering
9595

articles/iot-operations/connect-to-cloud/concept-dataflow-operations.md

Lines changed: 0 additions & 105 deletions
This file was deleted.

articles/iot-operations/connect-to-cloud/howto-create-dataflow.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ spec:
116116

117117
## Configure transformation
118118

119-
The transformation operation is where you can transform the data from the source before sending it to the destination. Transformations are optional. If you don't need to make changes to the data, don't include the transformation operation in the dataflow configuration. Multiple transformations are chained together in stages regardless of the order they are specified in the configuration.
119+
The transformation operation is where you can transform the data from the source before sending it to the destination. Transformations are optional. If you don't need to make changes to the data, don't include the transformation operation in the dataflow configuration. Multiple transformations are chained together in stages regardless of the order they're specified in the configuration.
120120

121121
```yaml
122122
spec:
@@ -178,13 +178,15 @@ If the dataset has a record with the `asset` field, similar to:
178178

179179
The data from the source with the `deviceId` field matching `thermostat1` has the `location` and `manufacturer` fields available `filter` and `map` stages.
180180

181+
For more information, see [Enrich data using dataflows](concept-dataflow-enrich.md) and [Convert data using dataflows](concept-dataflow-conversions.md).
182+
181183
### Filter: Filter data based on a condition
182184

183185
To filter the data on a condition, you can use the `filter` stage. The condition is specified as a field in the source data that matches a value.
184186

185187
| Name | Description |
186188
|------------------------------------------------|-------------------------------------------|
187-
| builtInTransformationSettings.filter.inputs[] | Inputs to evluate a filter condition |
189+
| builtInTransformationSettings.filter.inputs[] | Inputs to evaluate a filter condition |
188190
| builtInTransformationSettings.filter.expression | Condition for the filter evaluation |
189191

190192
For example, you could use the `temperature` field in the source data to filter the data:
@@ -231,7 +233,7 @@ spec:
231233
output: location
232234
```
233235

234-
To learn more, see the [Dataflow language syntax](concept-dataflow-language.md).
236+
To learn more, see the [Map data using dataflows](concept-dataflow-mapping.md) and [Convert data using dataflows](concept-dataflow-conversions.md).
235237

236238
### Serialize data according to a schema
237239

@@ -253,7 +255,6 @@ spec:
253255
schemaRef: aio-sr://exampleNamespace/exmapleParquetSchema:1.0.0
254256
```
255257

256-
257258
## Configure destination
258259

259260
To configure a destination for the dataflow, you need to specify the endpoint and a path (topic or table) for the destination.

articles/iot-operations/toc.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,16 @@ items:
7575
href: connect-to-cloud/overview-dataflow.md
7676
- name: Concepts
7777
items:
78-
- name: Dataflow mapping language
79-
href: connect-to-cloud/concept-dataflow-language.md
80-
- name: Dataflow operations
81-
href: connect-to-cloud/concept-dataflow-operations.md
82-
- name: Dataflow conversions
78+
- name: Map data
79+
href: connect-to-cloud/concept-dataflow-mapping.md
80+
- name: Convert data
8381
href: connect-to-cloud/concept-dataflow-conversions.md
82+
- name: Enrich data
83+
href: connect-to-cloud/concept-dataflow-enrich.md
8484
- name: Configure endpoints
8585
href: connect-to-cloud/howto-configure-dataflow-endpoint.md
8686
- name: Create a dataflow
8787
href: connect-to-cloud/howto-create-dataflow.md
88-
- name: Enrich data
89-
href: connect-to-cloud/howto-dataflow-enrich.md
9088
- name: Configure dataflow profile
9189
href: connect-to-cloud/howto-configure-dataflow-profile.md
9290
- name: Manage layered network

0 commit comments

Comments
 (0)