-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: details on new added modules (#3971)
- Loading branch information
1 parent
94e4dae
commit b6e5ba9
Showing
10 changed files
with
130 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 47 additions & 1 deletion
48
...nce/syntax/date-time/format-specifiers.md → web/book/src/reference/stdlib/date.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Mathematical functions | ||
|
||
These are all the functions defined in the `math` module: | ||
|
||
| function | parameters | description | | ||
| -------- | ---------- | ---------------------------------- | | ||
| abs | `col` | Absolute value of `col` | | ||
| acos | `col` | Arccosine of `col` | | ||
| asin | `col` | Arcsine of `col` | | ||
| atan | `col` | Arctangent of `col` | | ||
| ceil | `col` | Rounds the number up of `col` | | ||
| cos | `col` | Cosine of `col` | | ||
| degrees | `col` | Converts radians to degrees | | ||
| exp | `col` | Exponential of `col` | | ||
| floor | `col` | Rounds the number down | | ||
| ln | `col` | Natural logarithm of `col` | | ||
| log | `b` `col` | `b`-log of `col` | | ||
| log10 | `col` | 10-log of `col` | | ||
| pi | | The constant π | | ||
| pow | `b` `col` | Computes `col` to the power `b` | | ||
| radians | `col` | Converts degrees to radians | | ||
| round | `n` `col` | Rounds `col` to `n` decimal places | | ||
| sin | `col` | Sin of `col` | | ||
| sqrt | `col` | Square root of `col` | | ||
| tan | `col` | Tangent of `col` | | ||
|
||
### Example | ||
|
||
```prql | ||
from employees | ||
select { | ||
age_squared = age | math.pow 2 | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Text functions | ||
|
||
These are all the functions defined in the `string` module: | ||
|
||
| function | parameters | description | | ||
| ----------- | ---------------------- | ----------------------------------------------------------------------------- | | ||
| contains | `text` `col` | Returns true if `col` contains `text` | | ||
| ends_with | `text` `col` | Returns true if `col` ends with `text` | | ||
| length | `col` | Returns the number of characters in `col` | | ||
| lower | `col` | Converts `col` to lower case | | ||
| ltrim | `col` | Removes all the whitespaces from the left side of `col` | | ||
| replace | `before` `after` `col` | Replaces any occurrences of `before` with `after` in `col` | | ||
| rtrim | `col` | Removes all the whitespaces from the right side of `col` | | ||
| starts_with | `text` `col` | Returns true if `col` starts with `text` | | ||
| substring | `idx` `len` `col` | Extracts a substring at the index `idx` (starting at 1) with the length `len` | | ||
| trim | `col` | Removes all the whitespaces from both sides of `col` | | ||
| upper | `col` | Converts `col` to upper case | | ||
|
||
### Example | ||
|
||
```prql | ||
from employees | ||
select { | ||
last_name | string.lower | string.starts_with("a"), | ||
title | string.replace "manager" "chief" | ||
} | ||
``` |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions
9
...sts/documentation/snapshots/documentation__book__reference__stdlib__math__example__0.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
source: web/book/tests/documentation/book.rs | ||
expression: "from employees\nselect {\n age_squared = age | math.pow 2\n}\n" | ||
--- | ||
SELECT | ||
POW(age, 2) AS age_squared | ||
FROM | ||
employees | ||
|
10 changes: 10 additions & 0 deletions
10
...s/documentation/snapshots/documentation__book__reference__stdlib__string__example__0.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
source: web/book/tests/documentation/book.rs | ||
expression: "from employees\nselect {\n last_name | string.lower | string.starts_with(\"a\"),\n title | string.replace \"manager\" \"chief\"\n}\n" | ||
--- | ||
SELECT | ||
LOWER(last_name) LIKE CONCAT('a', '%'), | ||
REPLACE(title, 'manager', 'chief') | ||
FROM | ||
employees | ||
|