Managing context using different utility functions
This recipe provides you with examples of context management by the use of different Snowflake functions. These functions enable the contextual data processing commonly required in ETL.
Getting ready
The following steps explore the various contextual functions available, their intent, and how they may be used in broader processing.
How to do it…
Perform the following steps to try this recipe:
- This step elaborates on some of the most frequently used information in contextual processing, which is the current date. Snowflake provides the
CURRENT_DATE
function, which, as the name suggests, returns the current date in the default date format:SELECT CURRENT_DATE();
A result set showing the output of
CURRENT_DATE
looks as follows: - We can also combine the output of
CURRENT_DATE
with other processing logic. As an example, the following statement extracts the day name from...