|
42 | 42 | - [iszero](#iszero)
|
43 | 43 | - [lcm](#lcm)
|
44 | 44 | - [ln](#ln)
|
45 |
| -- [log](#log) |
46 | 45 | - [log10](#log10)
|
47 | 46 | - [log2](#log2)
|
48 | 47 | - [nanvl](#nanvl)
|
@@ -339,23 +338,6 @@ ln(numeric_expression)
|
339 | 338 | - **numeric_expression**: Numeric expression to operate on.
|
340 | 339 | Can be a constant, column, or function, and any combination of arithmetic operators.
|
341 | 340 |
|
342 |
| -### `log` |
343 |
| - |
344 |
| -Returns the base-x logarithm of a number. |
345 |
| -Can either provide a specified base, or if omitted then takes the base-10 of a number. |
346 |
| - |
347 |
| -``` |
348 |
| -log(base, numeric_expression) |
349 |
| -log(numeric_expression) |
350 |
| -``` |
351 |
| - |
352 |
| -#### Arguments |
353 |
| - |
354 |
| -- **base**: Base numeric expression to operate on. |
355 |
| - Can be a constant, column, or function, and any combination of arithmetic operators. |
356 |
| -- **numeric_expression**: Numeric expression to operate on. |
357 |
| - Can be a constant, column, or function, and any combination of arithmetic operators. |
358 |
| - |
359 | 341 | ### `log10`
|
360 | 342 |
|
361 | 343 | Returns the base-10 logarithm of a number.
|
@@ -567,29 +549,11 @@ trunc(numeric_expression[, decimal_places])
|
567 | 549 |
|
568 | 550 | ## Conditional Functions
|
569 | 551 |
|
570 |
| -- [coalesce](#coalesce) |
571 | 552 | - [nullif](#nullif)
|
572 | 553 | - [nvl](#nvl)
|
573 | 554 | - [nvl2](#nvl2)
|
574 | 555 | - [ifnull](#ifnull)
|
575 | 556 |
|
576 |
| -### `coalesce` |
577 |
| - |
578 |
| -Returns the first of its arguments that is not _null_. |
579 |
| -Returns _null_ if all arguments are _null_. |
580 |
| -This function is often used to substitute a default value for _null_ values. |
581 |
| - |
582 |
| -``` |
583 |
| -coalesce(expression1[, ..., expression_n]) |
584 |
| -``` |
585 |
| - |
586 |
| -#### Arguments |
587 |
| - |
588 |
| -- **expression1, expression_n**: |
589 |
| - Expression to use if previous expressions are _null_. |
590 |
| - Can be a constant, column, or function, and any combination of arithmetic operators. |
591 |
| - Pass as many expression arguments as necessary. |
592 |
| - |
593 | 557 | ### `nullif`
|
594 | 558 |
|
595 | 559 | Returns _null_ if _expression1_ equals _expression2_; otherwise it returns _expression1_.
|
@@ -646,102 +610,18 @@ _Alias of [nvl](#nvl)._
|
646 | 610 |
|
647 | 611 | See the new documentation [`here`](https://datafusion.apache.org/user-guide/sql/scalar_functions_new.html)
|
648 | 612 |
|
649 |
| -## Binary String Functions |
650 |
| - |
651 |
| -- [decode](#decode) |
652 |
| -- [encode](#encode) |
653 |
| - |
654 |
| -### `encode` |
655 |
| - |
656 |
| -Encode binary data into a textual representation. |
657 |
| - |
658 |
| -``` |
659 |
| -encode(expression, format) |
660 |
| -``` |
661 |
| - |
662 |
| -#### Arguments |
663 |
| - |
664 |
| -- **expression**: Expression containing string or binary data |
665 |
| - |
666 |
| -- **format**: Supported formats are: `base64`, `hex` |
667 |
| - |
668 |
| -**Related functions**: |
669 |
| -[decode](#decode) |
670 |
| - |
671 |
| -### `decode` |
672 |
| - |
673 |
| -Decode binary data from textual representation in string. |
674 |
| - |
675 |
| -``` |
676 |
| -decode(expression, format) |
677 |
| -``` |
678 |
| - |
679 |
| -#### Arguments |
680 |
| - |
681 |
| -- **expression**: Expression containing encoded string data |
682 |
| - |
683 |
| -- **format**: Same arguments as [encode](#encode) |
684 |
| - |
685 |
| -**Related functions**: |
686 |
| -[encode](#encode) |
687 |
| - |
688 | 613 | ## Regular Expression Functions
|
689 | 614 |
|
690 | 615 | Apache DataFusion uses a [PCRE-like] regular expression [syntax]
|
691 | 616 | (minus support for several features including look-around and backreferences).
|
692 | 617 | The following regular expression functions are supported:
|
693 | 618 |
|
694 |
| -- [regexp_like](#regexp_like) |
695 | 619 | - [regexp_match](#regexp_match)
|
696 | 620 | - [regexp_replace](#regexp_replace)
|
697 | 621 |
|
698 | 622 | [pcre-like]: https://en.wikibooks.org/wiki/Regular_Expressions/Perl-Compatible_Regular_Expressions
|
699 | 623 | [syntax]: https://docs.rs/regex/latest/regex/#syntax
|
700 | 624 |
|
701 |
| -### `regexp_like` |
702 |
| - |
703 |
| -Returns true if a [regular expression] has at least one match in a string, |
704 |
| -false otherwise. |
705 |
| - |
706 |
| -[regular expression]: https://docs.rs/regex/latest/regex/#syntax |
707 |
| - |
708 |
| -``` |
709 |
| -regexp_like(str, regexp[, flags]) |
710 |
| -``` |
711 |
| - |
712 |
| -#### Arguments |
713 |
| - |
714 |
| -- **str**: String expression to operate on. |
715 |
| - Can be a constant, column, or function, and any combination of string operators. |
716 |
| -- **regexp**: Regular expression to test against the string expression. |
717 |
| - Can be a constant, column, or function. |
718 |
| -- **flags**: Optional regular expression flags that control the behavior of the |
719 |
| - regular expression. The following flags are supported: |
720 |
| - - **i**: case-insensitive: letters match both upper and lower case |
721 |
| - - **m**: multi-line mode: ^ and $ match begin/end of line |
722 |
| - - **s**: allow . to match \n |
723 |
| - - **R**: enables CRLF mode: when multi-line mode is enabled, \r\n is used |
724 |
| - - **U**: swap the meaning of x* and x*? |
725 |
| - |
726 |
| -#### Example |
727 |
| - |
728 |
| -```sql |
729 |
| -select regexp_like('Köln', '[a-zA-Z]ö[a-zA-Z]{2}'); |
730 |
| -+--------------------------------------------------------+ |
731 |
| -| regexp_like(Utf8("Köln"),Utf8("[a-zA-Z]ö[a-zA-Z]{2}")) | |
732 |
| -+--------------------------------------------------------+ |
733 |
| -| true | |
734 |
| -+--------------------------------------------------------+ |
735 |
| -SELECT regexp_like('aBc', '(b|d)', 'i'); |
736 |
| -+--------------------------------------------------+ |
737 |
| -| regexp_like(Utf8("aBc"),Utf8("(b|d)"),Utf8("i")) | |
738 |
| -+--------------------------------------------------+ |
739 |
| -| true | |
740 |
| -+--------------------------------------------------+ |
741 |
| -``` |
742 |
| - |
743 |
| -Additional examples can be found [here](https://github.com/apache/datafusion/blob/main/datafusion-examples/examples/regexp.rs) |
744 |
| - |
745 | 625 | ### `regexp_match`
|
746 | 626 |
|
747 | 627 | Returns a list of [regular expression](https://docs.rs/regex/latest/regex/#syntax) matches in a string.
|
@@ -855,7 +735,6 @@ position(substr in origstr)
|
855 | 735 | - [today](#today)
|
856 | 736 | - [make_date](#make_date)
|
857 | 737 | - [to_char](#to_char)
|
858 |
| -- [to_date](#to_date) |
859 | 738 | - [to_local_time](#to_local_time)
|
860 | 739 | - [to_timestamp](#to_timestamp)
|
861 | 740 | - [to_timestamp_millis](#to_timestamp_millis)
|
@@ -1103,49 +982,6 @@ Additional examples can be found [here]
|
1103 | 982 |
|
1104 | 983 | - date_format
|
1105 | 984 |
|
1106 |
| -### `to_date` |
1107 |
| - |
1108 |
| -Converts a value to a date (`YYYY-MM-DD`). |
1109 |
| -Supports strings, integer and double types as input. |
1110 |
| -Strings are parsed as YYYY-MM-DD (e.g. '2023-07-20') if no [Chrono format]s are provided. |
1111 |
| -Integers and doubles are interpreted as days since the unix epoch (`1970-01-01T00:00:00Z`). |
1112 |
| -Returns the corresponding date. |
1113 |
| - |
1114 |
| -Note: `to_date` returns Date32, which represents its values as the number of days since unix epoch(`1970-01-01`) stored as signed 32 bit value. The largest supported date value is `9999-12-31`. |
1115 |
| - |
1116 |
| -``` |
1117 |
| -to_date(expression[, ..., format_n]) |
1118 |
| -``` |
1119 |
| - |
1120 |
| -#### Arguments |
1121 |
| - |
1122 |
| -- **expression**: Expression to operate on. |
1123 |
| - Can be a constant, column, or function, and any combination of arithmetic operators. |
1124 |
| -- **format_n**: Optional [Chrono format] strings to use to parse the expression. Formats will be tried in the order |
1125 |
| - they appear with the first successful one being returned. If none of the formats successfully parse the expression |
1126 |
| - an error will be returned. |
1127 |
| - |
1128 |
| -[chrono format]: https://docs.rs/chrono/latest/chrono/format/strftime/index.html |
1129 |
| - |
1130 |
| -#### Example |
1131 |
| - |
1132 |
| -``` |
1133 |
| -> select to_date('2023-01-31'); |
1134 |
| -+-----------------------------+ |
1135 |
| -| to_date(Utf8("2023-01-31")) | |
1136 |
| -+-----------------------------+ |
1137 |
| -| 2023-01-31 | |
1138 |
| -+-----------------------------+ |
1139 |
| -> select to_date('2023/01/31', '%Y-%m-%d', '%Y/%m/%d'); |
1140 |
| -+---------------------------------------------------------------+ |
1141 |
| -| to_date(Utf8("2023/01/31"),Utf8("%Y-%m-%d"),Utf8("%Y/%m/%d")) | |
1142 |
| -+---------------------------------------------------------------+ |
1143 |
| -| 2023-01-31 | |
1144 |
| -+---------------------------------------------------------------+ |
1145 |
| -``` |
1146 |
| - |
1147 |
| -Additional examples can be found [here](https://github.com/apache/datafusion/blob/main/datafusion-examples/examples/to_date.rs) |
1148 |
| - |
1149 | 985 | ### `to_local_time`
|
1150 | 986 |
|
1151 | 987 | Converts a timestamp with a timezone to a timestamp without a timezone (with no offset or
|
@@ -3226,7 +3062,6 @@ select map_values(map([100, 5], [42,43]));
|
3226 | 3062 |
|
3227 | 3063 | - [digest](#digest)
|
3228 | 3064 | - [md5](#md5)
|
3229 |
| -- [sha224](#sha224) |
3230 | 3065 | - [sha256](#sha256)
|
3231 | 3066 | - [sha384](#sha384)
|
3232 | 3067 | - [sha512](#sha512)
|
@@ -3265,19 +3100,6 @@ md5(expression)
|
3265 | 3100 |
|
3266 | 3101 | #### Arguments
|
3267 | 3102 |
|
3268 |
| -- **expression**: String expression to operate on. |
3269 |
| - Can be a constant, column, or function, and any combination of string operators. |
3270 |
| - |
3271 |
| -### `sha224` |
3272 |
| - |
3273 |
| -Computes the SHA-224 hash of a binary string. |
3274 |
| - |
3275 |
| -``` |
3276 |
| -sha224(expression) |
3277 |
| -``` |
3278 |
| - |
3279 |
| -#### Arguments |
3280 |
| - |
3281 | 3103 | - **expression**: String expression to operate on.
|
3282 | 3104 | Can be a constant, column, or function, and any combination of string operators.
|
3283 | 3105 |
|
|
0 commit comments