SQL Task
Task Components in Ascend let you execute arbitrary SQL code as a Component. Unlike Transforms, SQL Tasks aren't directly tied to the Data Plane, giving you more flexibility.
Structuring Your SQL Component
In SQL Task Components, the config function defines the task type and its dependencies. This function specifies the input data and any Components that your task relies on.
Example
Here's a SQL Task Component example:
This example identifies routes with active closures today:
-
Config function: Defines the task type and dependencies. The task depends on the
route_closuresComponent for its data source. -
Common table expression (CTE): The
WITHclause creates a temporary result setclosures_todaythat filters theroute_closuresdata for routes where closures are active on the current date. -
Final selection: The query selects
route_idfrom the filtered data, which can be used for warnings or further processing.
Next Steps
- Learn more about Tasks in our Concept Guide
- Explore Task options in our Reference Guide