<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Implementing Conditional Logic for Dependent Tasks Using SQL Output and Task Values in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/implementing-conditional-logic-for-dependent-tasks-using-sql/m-p/96247#M39247</link>
    <description>&lt;P&gt;Hi - Did you try with Query / SQL file along with If/Else condition in the control flow. I guess that should work for you.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SathyaSDE_0-1729950081756.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/12316i5F555E351178EF02/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SathyaSDE_0-1729950081756.png" alt="SathyaSDE_0-1729950081756.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 26 Oct 2024 13:41:30 GMT</pubDate>
    <dc:creator>SathyaSDE</dc:creator>
    <dc:date>2024-10-26T13:41:30Z</dc:date>
    <item>
      <title>Implementing Conditional Logic for Dependent Tasks Using SQL Output and Task Values</title>
      <link>https://community.databricks.com/t5/data-engineering/implementing-conditional-logic-for-dependent-tasks-using-sql/m-p/96235#M39243</link>
      <description>&lt;P&gt;Hi team,&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Sat, 26 Oct 2024 12:19:35 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/implementing-conditional-logic-for-dependent-tasks-using-sql/m-p/96235#M39243</guid>
      <dc:creator>Viswanth</dc:creator>
      <dc:date>2024-10-26T12:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: Implementing Conditional Logic for Dependent Tasks Using SQL Output and Task Values</title>
      <link>https://community.databricks.com/t5/data-engineering/implementing-conditional-logic-for-dependent-tasks-using-sql/m-p/96247#M39247</link>
      <description>&lt;P&gt;Hi - Did you try with Query / SQL file along with If/Else condition in the control flow. I guess that should work for you.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SathyaSDE_0-1729950081756.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/12316i5F555E351178EF02/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SathyaSDE_0-1729950081756.png" alt="SathyaSDE_0-1729950081756.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Oct 2024 13:41:30 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/implementing-conditional-logic-for-dependent-tasks-using-sql/m-p/96247#M39247</guid>
      <dc:creator>SathyaSDE</dc:creator>
      <dc:date>2024-10-26T13:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: Implementing Conditional Logic for Dependent Tasks Using SQL Output and Task Values</title>
      <link>https://community.databricks.com/t5/data-engineering/implementing-conditional-logic-for-dependent-tasks-using-sql/m-p/96367#M39265</link>
      <description>&lt;P&gt;Thanks sathya,&lt;/P&gt;&lt;P&gt;I initially explored this approach but ran into challenges passing the SQL query output directly into an If/Else condition within the control flow. As a workaround, I used a Spark script to execute the SQL and then passed the output via dbutils.jobs.taskValues.set(key="my_value", value=my_result). However, if there’s a more streamlined method to achieve this directly, I’d love to learn about it. Any specific techniques or examples you could share on handling SQL outputs in control flow conditions would be invaluable. Thank you again for your insights!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2024 05:48:13 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/implementing-conditional-logic-for-dependent-tasks-using-sql/m-p/96367#M39265</guid>
      <dc:creator>Viswanth</dc:creator>
      <dc:date>2024-10-28T05:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: Implementing Conditional Logic for Dependent Tasks Using SQL Output and Task Values</title>
      <link>https://community.databricks.com/t5/data-engineering/implementing-conditional-logic-for-dependent-tasks-using-sql/m-p/97012#M39394</link>
      <description>&lt;P&gt;This feature is in the Private Preview.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2024 15:08:05 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/implementing-conditional-logic-for-dependent-tasks-using-sql/m-p/97012#M39394</guid>
      <dc:creator>Ramana</dc:creator>
      <dc:date>2024-10-31T15:08:05Z</dc:date>
    </item>
  </channel>
</rss>

