class monad.config.SQLLambda
monad.config.SQLLambdaDefines the modification of columns, e.g., casting column entries to the specified data type.
from monad.config import SQLLambda
SQLLambda(alias="price_float", expression="TO_DOUBLE(price)")
SQLLambda(alias="category_string", expression="CAST({{ resolve_fn('category', data_sources_path=['products']) }} AS STRING)")| Parameters |
|---|
alias: str
Alias used to identify column created with this sql lambda.
expression: str
Valid SQL expression. Column names from joined data sources should be passed wrapped in resolve_fn. For the columns belonging to the top-level data source, can be passes without wrapping, but all necessary escaping is on the user side.
