Column creators
Column creators transformers module.
ColumnCreators
¶
Bases: object
Class containing all functions that can create columns to add value.
Source code in mkdocs/lakehouse_engine/packages/transformers/column_creators.py
with_auto_increment_id(output_col='lhe_row_id', rdd=True)
classmethod
¶
Create a sequential and consecutive id.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
output_col |
str
|
optional name of the output column. |
'lhe_row_id'
|
rdd |
bool
|
optional parameter to use spark rdd. |
True
|
Returns:
Type | Description |
---|---|
Callable
|
A function to be executed in the .transform() spark function. |
View Example of with_auto_increment_id (See full example here)
Source code in mkdocs/lakehouse_engine/packages/transformers/column_creators.py
with_literals(literals)
classmethod
¶
Create columns given a map of column names and literal values (constants).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
Dict[str, |
Any] literals
|
map of column names and literal values (constants). |
required |
Returns:
Name | Type | Description |
---|---|---|
Callable |
Callable
|
A function to be executed in the .transform() spark function. |
View Example of with_literals (See full example here)
Source code in mkdocs/lakehouse_engine/packages/transformers/column_creators.py
with_row_id(output_col='lhe_row_id')
classmethod
¶
Create a sequential but not consecutive id.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
output_col |
str
|
optional name of the output column. |
'lhe_row_id'
|
Returns:
Type | Description |
---|---|
Callable
|
A function to be executed in the .transform() spark function. |