Regex transformers
Regex transformers module.
RegexTransformers
¶
Bases: object
Class containing all regex functions.
Source code in mkdocs/lakehouse_engine/packages/transformers/regex_transformers.py
with_regex_value(input_col, output_col, regex, drop_input_col=False, idx=1)
staticmethod
¶
Get the result of applying a regex to an input column (via regexp_extract).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input_col |
str
|
name of the input column. |
required |
output_col |
str
|
name of the output column. |
required |
regex |
str
|
regular expression. |
required |
drop_input_col |
bool
|
whether to drop input_col or not. |
False
|
idx |
int
|
index to return. |
1
|
Returns:
Type | Description |
---|---|
Callable
|
A function to be executed in the .transform() spark function. |