<?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 SET configuration in SQL DLT pipeline not working in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/set-configuration-in-sql-dlt-pipeline-not-working/m-p/9170#M4633</link>
    <description>&lt;P&gt;I'm not able to get the SET command to work when using sql in DLT pipeline. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am copying the code from this documentation &lt;A href="https://docs.databricks.com/workflows/delta-live-tables/delta-live-tables-sql-ref.html#sql-spec" alt="https://docs.databricks.com/workflows/delta-live-tables/delta-live-tables-sql-ref.html#sql-spec" target="_blank"&gt;https://docs.databricks.com/workflows/delta-live-tables/delta-live-tables-sql-ref.html#sql-spec&lt;/A&gt; (relevant code below). When I run something similar, I get empty value for ${startDate}.  Any way to set a variable for the sql inside a notebook for DLT pipelines?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the code in the documentation&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SET startDate='2020-01-01';
&amp;nbsp;
CREATE OR REFRESH LIVE TABLE filtered
AS SELECT * FROM src
WHERE date &amp;gt; ${startDate}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the code I tried running:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SET startDate='2020-01-01';
 
CREATE OR REFRESH LIVE TABLE filtered
AS SELECT * FROM (select '2021-01-01' as date)
WHERE date &amp;gt; ${startDate}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my error message when running dlt pipeline. It is setting ${startDate} to empty string. It works when I set the configuration value inside the settings of the dlt pipeline but not when I specify it in the notebook.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/668i721D91EC328D35E2/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 17 Feb 2023 00:03:10 GMT</pubDate>
    <dc:creator>oteng</dc:creator>
    <dc:date>2023-02-17T00:03:10Z</dc:date>
    <item>
      <title>SET configuration in SQL DLT pipeline not working</title>
      <link>https://community.databricks.com/t5/data-engineering/set-configuration-in-sql-dlt-pipeline-not-working/m-p/9170#M4633</link>
      <description>&lt;P&gt;I'm not able to get the SET command to work when using sql in DLT pipeline. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am copying the code from this documentation &lt;A href="https://docs.databricks.com/workflows/delta-live-tables/delta-live-tables-sql-ref.html#sql-spec" alt="https://docs.databricks.com/workflows/delta-live-tables/delta-live-tables-sql-ref.html#sql-spec" target="_blank"&gt;https://docs.databricks.com/workflows/delta-live-tables/delta-live-tables-sql-ref.html#sql-spec&lt;/A&gt; (relevant code below). When I run something similar, I get empty value for ${startDate}.  Any way to set a variable for the sql inside a notebook for DLT pipelines?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the code in the documentation&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SET startDate='2020-01-01';
&amp;nbsp;
CREATE OR REFRESH LIVE TABLE filtered
AS SELECT * FROM src
WHERE date &amp;gt; ${startDate}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the code I tried running:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SET startDate='2020-01-01';
 
CREATE OR REFRESH LIVE TABLE filtered
AS SELECT * FROM (select '2021-01-01' as date)
WHERE date &amp;gt; ${startDate}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my error message when running dlt pipeline. It is setting ${startDate} to empty string. It works when I set the configuration value inside the settings of the dlt pipeline but not when I specify it in the notebook.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/668i721D91EC328D35E2/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2023 00:03:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/set-configuration-in-sql-dlt-pipeline-not-working/m-p/9170#M4633</guid>
      <dc:creator>oteng</dc:creator>
      <dc:date>2023-02-17T00:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: SET configuration in SQL DLT pipeline not working</title>
      <link>https://community.databricks.com/t5/data-engineering/set-configuration-in-sql-dlt-pipeline-not-working/m-p/9172#M4635</link>
      <description>&lt;P&gt;Hi @Oliver Teng​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope all is well! Just wanted to check in if you were able to resolve your issue and would you be happy to share the solution or mark an answer as best? Else please let us know if you need more help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We'd love to hear from you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Mar 2023 02:06:52 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/set-configuration-in-sql-dlt-pipeline-not-working/m-p/9172#M4635</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-11T02:06:52Z</dc:date>
    </item>
  </channel>
</rss>

