Skip to content

Commit 5f304f7

Browse files
authored
Apply docs website feedback to ppl functions (#5207)
* apply doc website feedback to ppl functions Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com> * take out comments Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com> * fix json_append example Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com> * fix json_append example Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com> * fix links Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com> --------- Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com> Signed-off-by: ritvibhatt <53196324+ritvibhatt@users.noreply.github.com>
1 parent 2dd8600 commit 5f304f7

16 files changed

Lines changed: 3730 additions & 2437 deletions

docs/user/ppl/functions/aggregations.md

Lines changed: 307 additions & 148 deletions
Large diffs are not rendered by default.

docs/user/ppl/functions/collection.md

Lines changed: 324 additions & 149 deletions
Large diffs are not rendered by default.

docs/user/ppl/functions/condition.md

Lines changed: 308 additions & 239 deletions
Large diffs are not rendered by default.

docs/user/ppl/functions/conversion.md

Lines changed: 104 additions & 81 deletions
Large diffs are not rendered by default.

docs/user/ppl/functions/cryptographic.md

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
1-
# PPL Cryptographic Functions
1+
# Cryptographic functions
22

3-
## MD5
3+
The following cryptographic functions are supported in PPL.
44

5-
### Description
5+
## MD5
66

7-
Version: 3.1.0
8-
Usage: `md5(str)` calculates the MD5 digest and returns the value as a 32-character hex string.
7+
**Usage**: `MD5(str)`
98

10-
**Argument type:** `STRING`
11-
**Return type:** `STRING`
9+
Calculates the MD5 digest and returns the value as a 32-character hex string.
1210

13-
### Example
11+
**Parameters**:
12+
13+
- `str` (Required): The string for which to calculate the MD5 digest.
14+
15+
**Return type**: `STRING`
16+
17+
#### Example
1418

1519
```ppl
1620
source=people
1721
| eval `MD5('hello')` = MD5('hello')
1822
| fields `MD5('hello')`
1923
```
2024

21-
Expected output:
25+
The query returns the following results:
2226

2327
```text
2428
fetched rows / total rows = 1/1
@@ -29,25 +33,27 @@ fetched rows / total rows = 1/1
2933
+----------------------------------+
3034
```
3135

32-
## SHA1
36+
## SHA1
37+
38+
**Usage**: `SHA1(str)`
3339

34-
### Description
40+
Returns the SHA-1 hash as a hex string.
3541

36-
Version: 3.1.0
37-
Usage: `sha1(str)` returns the hex string result of SHA-1.
42+
**Parameters**:
3843

39-
**Argument type:** `STRING`
40-
**Return type:** `STRING`
44+
- `str` (Required): The string for which to calculate the SHA-1 hash.
4145

42-
### Example
46+
**Return type**: `STRING`
47+
48+
#### Example
4349

4450
```ppl
4551
source=people
4652
| eval `SHA1('hello')` = SHA1('hello')
4753
| fields `SHA1('hello')`
4854
```
4955

50-
Expected output:
56+
The query returns the following results:
5157

5258
```text
5359
fetched rows / total rows = 1/1
@@ -58,26 +64,28 @@ fetched rows / total rows = 1/1
5864
+------------------------------------------+
5965
```
6066

61-
## SHA2
67+
## SHA2
68+
69+
**Usage**: `SHA2(str, numBits)`
6270

63-
### Description
71+
Returns the result of SHA-2 family hash functions (SHA-224, SHA-256, SHA-384, and SHA-512) as a hex string.
6472

65-
Version: 3.1.0
66-
Usage: `sha2(str, numBits)` returns the hex string result of SHA-2 family of hash functions (SHA-224, SHA-256, SHA-384, and SHA-512).
67-
The numBits indicates the desired bit length of the result, which must have a value of 224, 256, 384, or 512.
73+
**Parameters**:
6874

69-
**Argument type:** `STRING`, `INTEGER`
70-
**Return type:** `STRING`
75+
- `str` (Required): The string for which to calculate the SHA-2 hash.
76+
- `numBits` (Required): The desired bit length of the result, which must be `224`, `256`, `384`, or `512`.
7177

72-
### Example
78+
**Return type**: `STRING`
79+
80+
#### Example: SHA-256 hash
7381

7482
```ppl
7583
source=people
7684
| eval `SHA2('hello',256)` = SHA2('hello',256)
7785
| fields `SHA2('hello',256)`
7886
```
7987

80-
Expected output:
88+
The query returns the following results:
8189

8290
```text
8391
fetched rows / total rows = 1/1
@@ -87,14 +95,16 @@ fetched rows / total rows = 1/1
8795
| 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 |
8896
+------------------------------------------------------------------+
8997
```
98+
99+
#### Example: SHA-512 hash
90100

91101
```ppl
92102
source=people
93103
| eval `SHA2('hello',512)` = SHA2('hello',512)
94104
| fields `SHA2('hello',512)`
95105
```
96106

97-
Expected output:
107+
The query returns the following results:
98108

99109
```text
100110
fetched rows / total rows = 1/1

0 commit comments

Comments
 (0)