<?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: SET configuration in SQL DLT pipeline does not work in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/set-configuration-in-sql-dlt-pipeline-does-not-work/m-p/69295#M33890</link>
    <description>&lt;P&gt;Have you considered use checkpoint?&lt;BR /&gt;If you do this maybe empty dataset comes becouse there are no date in future...&amp;nbsp;created_at &amp;gt; current_time().&lt;/P&gt;&lt;P&gt;Read more about [Change Data Feed] Enable it in your base table and then capture only new changes feed.&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.databricks.com/en/delta-live-tables/sql-ref.html" target="_blank" rel="noopener"&gt;DLT Doc&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.databricks.com/en/delta-live-tables/cdc.html#language-sql" target="_blank" rel="noopener"&gt;Stream Apply Changes&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 17 May 2024 17:16:23 GMT</pubDate>
    <dc:creator>Icassatti</dc:creator>
    <dc:date>2024-05-17T17:16:23Z</dc:date>
    <item>
      <title>SET configuration in SQL DLT pipeline does not work</title>
      <link>https://community.databricks.com/t5/data-engineering/set-configuration-in-sql-dlt-pipeline-does-not-work/m-p/68758#M33739</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to set a dynamic value to use in a DLT query, and the code from the example documentation does not work.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SET startDate='2020-01-01';

CREATE OR REFRESH LIVE TABLE filtered
AS SELECT * FROM my_table
WHERE created_at &amp;gt; ${startDate};&lt;/LI-CODE&gt;&lt;P&gt;It is getting an error because it plugs in an empty value for the variable in the query.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[PARSE_SYNTAX_ERROR] Syntax error at or near end of input. SQLSTATE: 42601 (line 3, pos 19)

== SQL ==
CREATE OR REFRESH LIVE TABLE filtered
AS SELECT * FROM my_table
WHERE created_at &amp;gt; 
-------------------^^^&lt;/LI-CODE&gt;&lt;P&gt;It seems like the documentation is wrong. Is there a different way to do this?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2024 16:25:34 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/set-configuration-in-sql-dlt-pipeline-does-not-work/m-p/68758#M33739</guid>
      <dc:creator>MarkD</dc:creator>
      <dc:date>2024-05-10T16:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: SET configuration in SQL DLT pipeline does not work</title>
      <link>https://community.databricks.com/t5/data-engineering/set-configuration-in-sql-dlt-pipeline-does-not-work/m-p/69197#M33850</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/104693"&gt;@MarkD&lt;/a&gt;&amp;nbsp;how are you?&lt;/P&gt;
&lt;P&gt;The `SET` command alone is typically used to change the settings of a session, such as configuration parameters.&lt;/P&gt;
&lt;P&gt;To define a variable inside a SQL statement, you can use SET VAR &amp;lt;variablename&amp;gt; = &amp;lt;variablevalue&amp;gt; or SET VARIABLE &amp;lt;variablename&amp;gt; = &amp;lt;variablevalue&amp;gt; to define, as on the example below:&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN class="c1"&gt;-- Set a SQL variable to a value using SET VAR&lt;/SPAN&gt;
&lt;SPAN class="o"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="k"&gt;SET&lt;/SPAN&gt; &lt;SPAN class="n"&gt;VAR&lt;/SPAN&gt; &lt;SPAN class="n"&gt;myvar1&lt;/SPAN&gt; &lt;SPAN class="o"&gt;=&lt;/SPAN&gt; &lt;SPAN class="mi"&gt;5&lt;/SPAN&gt;&lt;SPAN class="p"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="o"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="k"&gt;VALUES&lt;/SPAN&gt; &lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="n"&gt;myvar1&lt;/SPAN&gt;&lt;SPAN class="p"&gt;);&lt;/SPAN&gt;
  &lt;SPAN class="mi"&gt;5&lt;/SPAN&gt;

&lt;SPAN class="c1"&gt;-- Set a SQL variable to 7 using the SET VARIABLE command&lt;/SPAN&gt;
&lt;SPAN class="o"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="k"&gt;SET&lt;/SPAN&gt; &lt;SPAN class="k"&gt;VARIABLE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;myvar1&lt;/SPAN&gt; &lt;SPAN class="o"&gt;=&lt;/SPAN&gt; &lt;SPAN class="k"&gt;7&lt;/SPAN&gt;&lt;SPAN class="p"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="o"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="k"&gt;VALUES&lt;/SPAN&gt; &lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="n"&gt;myvar1&lt;/SPAN&gt;&lt;SPAN class="p"&gt;);&lt;/SPAN&gt;
  &lt;SPAN class="mi"&gt;7&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;Please relate to the SET VAR documentation for further reference: &lt;A href="https://docs.databricks.com/ja/sql/language-manual/sql-ref-syntax-aux-set-variable.html" target="_blank"&gt;https://docs.databricks.com/ja/sql/language-manual/sql-ref-syntax-aux-set-variable.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Take care!&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 19:34:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/set-configuration-in-sql-dlt-pipeline-does-not-work/m-p/69197#M33850</guid>
      <dc:creator>anardinelli</dc:creator>
      <dc:date>2024-05-16T19:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: SET configuration in SQL DLT pipeline does not work</title>
      <link>https://community.databricks.com/t5/data-engineering/set-configuration-in-sql-dlt-pipeline-does-not-work/m-p/69198#M33851</link>
      <description>&lt;P&gt;The example I gave is directly from Databrick's DLT documentation, but as you say does not appear the be the right way to set a variable and doesn't work.&lt;/P&gt;&lt;P&gt;Unfortunately SET VAR is not supported in Delta Live Tables.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 19:42:49 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/set-configuration-in-sql-dlt-pipeline-does-not-work/m-p/69198#M33851</guid>
      <dc:creator>MarkD</dc:creator>
      <dc:date>2024-05-16T19:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: SET configuration in SQL DLT pipeline does not work</title>
      <link>https://community.databricks.com/t5/data-engineering/set-configuration-in-sql-dlt-pipeline-does-not-work/m-p/69203#M33854</link>
      <description>&lt;P&gt;For DLT pipelines, please use the "Advanced" panel, on the pipeline menu, to set your variables:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="anardinelli_0-1715891788808.png" style="width: 667px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/7613i2FCBF83B9CA1DDE2/image-dimensions/667x201?v=v2" width="667" height="201" role="button" title="anardinelli_0-1715891788808.png" alt="anardinelli_0-1715891788808.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;That will set up a new configuration value that can be referenced inside your code as a variable:&lt;/P&gt;
&lt;PRE class="lia-code-sample  language-markup"&gt;&lt;CODE&gt;CREATE OR REFRESH LIVE TABLE filtered
AS SELECT * FROM my_table
WHERE created_at &amp;gt; ${startDate};&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Would this solve your issue? Also, can you please share the documentation from DLT that states that the SET command can be used to create variables?&lt;/P&gt;
&lt;P&gt;Alessandro&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 20:39:43 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/set-configuration-in-sql-dlt-pipeline-does-not-work/m-p/69203#M33854</guid>
      <dc:creator>anardinelli</dc:creator>
      <dc:date>2024-05-16T20:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: SET configuration in SQL DLT pipeline does not work</title>
      <link>https://community.databricks.com/t5/data-engineering/set-configuration-in-sql-dlt-pipeline-does-not-work/m-p/69204#M33855</link>
      <description>&lt;P&gt;I've used the advanced configuration option for other variables, but in this case I wanted something dynamic. I want to `SET startDate = current_time()` and then use `startDate` through all my queries to make sure they are all using the same time comparison in their queries.&lt;/P&gt;&lt;P&gt;Here's the documentation that shows using "SET" as I did in the initial question. &lt;A href="https://docs.databricks.com/en/delta-live-tables/sql-ref.html#set-configuration-values-for-a-table-or-view" target="_blank"&gt;https://docs.databricks.com/en/delta-live-tables/sql-ref.html#set-configuration-values-for-a-table-or-view&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 21:33:18 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/set-configuration-in-sql-dlt-pipeline-does-not-work/m-p/69204#M33855</guid>
      <dc:creator>MarkD</dc:creator>
      <dc:date>2024-05-16T21:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: SET configuration in SQL DLT pipeline does not work</title>
      <link>https://community.databricks.com/t5/data-engineering/set-configuration-in-sql-dlt-pipeline-does-not-work/m-p/69207#M33856</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/104693"&gt;@MarkD&lt;/a&gt;&amp;nbsp;I beleve that you don't need use a var like that.&lt;BR /&gt;&lt;BR /&gt;What do you think about use only a function current_time(), like that:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CREATE OR REFRESH LIVE TABLE filtered
AS SELECT * FROM my_table
WHERE created_at &amp;gt; current_time();&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 17 May 2024 00:12:38 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/set-configuration-in-sql-dlt-pipeline-does-not-work/m-p/69207#M33856</guid>
      <dc:creator>Icassatti</dc:creator>
      <dc:date>2024-05-17T00:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: SET configuration in SQL DLT pipeline does not work</title>
      <link>https://community.databricks.com/t5/data-engineering/set-configuration-in-sql-dlt-pipeline-does-not-work/m-p/69208#M33857</link>
      <description>&lt;P&gt;The reason I want to use a variable is so that I can use the same cut off time in multiple queries to make sure to make sure that I don't get records in one query with a later date than another.&lt;/P&gt;&lt;P&gt;For example&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CREATE OR REFRESH LIVE TABLE filtered_one
AS SELECT * FROM my_table_one
WHERE created_at &amp;gt; current_time();

CREATE OR REFRESH LIVE TABLE filtered_two
AS SELECT * FROM my_table_two
WHERE created_at &amp;gt; current_time();&lt;/LI-CODE&gt;&lt;P&gt;If I want to compare records in `filtered_one` to the results in `filtered_two` I can't rely on them having used the same value for `current_time()`.&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2024 01:18:22 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/set-configuration-in-sql-dlt-pipeline-does-not-work/m-p/69208#M33857</guid>
      <dc:creator>MarkD</dc:creator>
      <dc:date>2024-05-17T01:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: SET configuration in SQL DLT pipeline does not work</title>
      <link>https://community.databricks.com/t5/data-engineering/set-configuration-in-sql-dlt-pipeline-does-not-work/m-p/69275#M33882</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/104693"&gt;@MarkD&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;You may use&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;set variable_name.var= '1900-01-01'&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;to set the value of variable and in order to use the value of variable&amp;nbsp;&lt;BR /&gt;use&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;${automated_date.var}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;set automated_date.var= '1800-01-01'
select * from my table where date = CAST(${automated_date.var} as DATE)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2024 13:29:58 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/set-configuration-in-sql-dlt-pipeline-does-not-work/m-p/69275#M33882</guid>
      <dc:creator>Hkesharwani</dc:creator>
      <dc:date>2024-05-17T13:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: SET configuration in SQL DLT pipeline does not work</title>
      <link>https://community.databricks.com/t5/data-engineering/set-configuration-in-sql-dlt-pipeline-does-not-work/m-p/69295#M33890</link>
      <description>&lt;P&gt;Have you considered use checkpoint?&lt;BR /&gt;If you do this maybe empty dataset comes becouse there are no date in future...&amp;nbsp;created_at &amp;gt; current_time().&lt;/P&gt;&lt;P&gt;Read more about [Change Data Feed] Enable it in your base table and then capture only new changes feed.&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.databricks.com/en/delta-live-tables/sql-ref.html" target="_blank" rel="noopener"&gt;DLT Doc&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.databricks.com/en/delta-live-tables/cdc.html#language-sql" target="_blank" rel="noopener"&gt;Stream Apply Changes&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2024 17:16:23 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/set-configuration-in-sql-dlt-pipeline-does-not-work/m-p/69295#M33890</guid>
      <dc:creator>Icassatti</dc:creator>
      <dc:date>2024-05-17T17:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: SET configuration in SQL DLT pipeline does not work</title>
      <link>https://community.databricks.com/t5/data-engineering/set-configuration-in-sql-dlt-pipeline-does-not-work/m-p/100359#M40270</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/105332"&gt;@anardinelli&lt;/a&gt;&amp;nbsp;Can you please help with a solution? I am am having issue with setting a variable in delta live table pipeline and use it with APPLY CHANGES INTO syntax.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2024 17:16:43 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/set-configuration-in-sql-dlt-pipeline-does-not-work/m-p/100359#M40270</guid>
      <dc:creator>smit_tw</dc:creator>
      <dc:date>2024-11-28T17:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: SET configuration in SQL DLT pipeline does not work</title>
      <link>https://community.databricks.com/t5/data-engineering/set-configuration-in-sql-dlt-pipeline-does-not-work/m-p/101082#M40533</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/133875"&gt;@smit_tw&lt;/a&gt;&amp;nbsp;Have you tried setting it on the "Advanced" tab as my previous suggests?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 14:15:56 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/set-configuration-in-sql-dlt-pipeline-does-not-work/m-p/101082#M40533</guid>
      <dc:creator>anardinelli</dc:creator>
      <dc:date>2024-12-05T14:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: SET configuration in SQL DLT pipeline does not work</title>
      <link>https://community.databricks.com/t5/data-engineering/set-configuration-in-sql-dlt-pipeline-does-not-work/m-p/126516#M47706</link>
      <description>&lt;P&gt;This ${configuration_key} syntax works great in DLT pipelines.&amp;nbsp; For a DLT pipeline, the Advanced panel navigation is as follows: Click Jobs &amp;amp; Pipelines (left panel) &amp;gt; Search or find Pipeline name and click Pipeline name (middle) &amp;gt; Settings (top right) &amp;gt; Advanced (bottom of page) &amp;gt; Save (extreme bottom right).&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jul 2025 22:02:27 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/set-configuration-in-sql-dlt-pipeline-does-not-work/m-p/126516#M47706</guid>
      <dc:creator>SFDataEng</dc:creator>
      <dc:date>2025-07-25T22:02:27Z</dc:date>
    </item>
  </channel>
</rss>

