Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions datafusion/functions/src/regex/regexplike.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,6 +35,7 @@ use std::sync::{Arc, OnceLock};
#[derive(Debug)]
pub struct RegexpLikeFunc {
signature: Signature,
aliases: Vec<String>,
}

impl Default for RegexpLikeFunc {
Expand DownExpand Up@@ -84,6 +85,7 @@ impl RegexpLikeFunc {
vec![TypeSignature::String(2), TypeSignature::String(3)],
Volatility::Immutable,
),
aliases: vec![String::from("rlike")],
}
}
}
Expand DownExpand Up@@ -112,6 +114,10 @@ impl ScalarUDFImpl for RegexpLikeFunc {
})
}

fn aliases(&self) -> &[String] {
&self.aliases
}

fn invoke_batch(
&self,
args: &[ColumnarValue],
Expand Down
9 changes: 9 additions & 0 deletions docs/source/user-guide/sql/scalar_functions.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -1769,6 +1769,7 @@ The following regular expression functions are supported:
- [regexp_like](#regexp_like)
- [regexp_match](#regexp_match)
- [regexp_replace](#regexp_replace)
- [rlike](#rlike)

### `regexp_count`

Expand DownExpand Up@@ -1839,6 +1840,10 @@ SELECT regexp_like('aBc', '(b|d)', 'i');

Additional examples can be found [here](https://github.com/apache/datafusion/blob/main/datafusion-examples/examples/regexp.rs)

#### Aliases

- rlike

### `regexp_match`

Returns the first [regular expression](https://docs.rs/regex/latest/regex/#syntax) matches in a string.
Expand DownExpand Up@@ -1919,6 +1924,10 @@ SELECT regexp_replace('aBc', '(b|d)', 'Ab\\1a', 'i');

Additional examples can be found [here](https://github.com/apache/datafusion/blob/main/datafusion-examples/examples/regexp.rs)

### `rlike`

_Alias of [regexp_like](#regexp_like)._

## Time and Date Functions

- [current_date](#current_date)
Expand Down