Hi team,
I'm working on setting up a workflow with task dependencies where a subsequent task should execute conditionally, based on the result of a preceding SQL task. Specifically, I need to evaluate an if/else condition on the output of the SQL query to determine whether the dependent task should run.
Currently, I’m running the SQL query within a Spark script using Spark compute, setting task values from the SQL output with dbutils.jobs.taskValues.set(key="my_value", value=my_result). This approach has been working well with Spark, but I'm interested in using SQL Compute (SQL Warehouse) for this task, as it could be more efficient for SQL workloads. My goal is to maintain the ability to set and reference task values from the SQL output while using SQL Warehouse.
Does anyone have recommendations for achieving this, or alternative approaches to manage conditional task execution based on SQL output when using SQL Compute? Any insights into the best practices for conditional task dependencies in Databricks would be greatly appreciated.