<?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: Random error related to dynamic variables in SQL - at least one column must be specified (shallowclone table) in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/random-error-related-to-dynamic-variables-in-sql-at-least-one/m-p/35142#M25814</link>
    <description>&lt;P&gt;@Hubert Dudek​&amp;nbsp; thanks for replying &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The variable is different in each notebook.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The error only happened once so far, and I may need to keep eye on it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The idea to use a notebook template with dynamics table name, all merge statements &lt;/P&gt;&lt;P&gt;will be dynamically generated using table column list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached is _config&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;notebook call _config to set variables that are different because variable 'table' will be different in each notebook.&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/2317iA7EC1663A5FEC6A1/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt; &lt;/P&gt;</description>
    <pubDate>Mon, 15 Nov 2021 03:42:13 GMT</pubDate>
    <dc:creator>lizou</dc:creator>
    <dc:date>2021-11-15T03:42:13Z</dc:date>
    <item>
      <title>Random error related to dynamic variables in SQL - at least one column must be specified (shallowclone table)</title>
      <link>https://community.databricks.com/t5/data-engineering/random-error-related-to-dynamic-variables-in-sql-at-least-one/m-p/35139#M25811</link>
      <description>&lt;P&gt;Environment: Azure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A data transformation template that take s table name as variable. The variable is set in separate notebook  %run ../_config&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shallow clone is used to generate a staging table with exact same columns of target table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A random error occurs when the ETL is running concurrent notebooks at same time. &lt;/P&gt;&lt;P&gt;Error log attached. (May be related to cluster resources?)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance if any insight is provided... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-- Create a temp table for data transformation&lt;/P&gt;&lt;P&gt;&lt;B&gt;drop&lt;/B&gt; &lt;B&gt;table&lt;/B&gt; &lt;B&gt;if&lt;/B&gt; &lt;B&gt;exists&lt;/B&gt; ${v.source};&lt;/P&gt;&lt;P&gt;&lt;B&gt;create&lt;/B&gt; &lt;B&gt;table&lt;/B&gt; &lt;B&gt;if&lt;/B&gt; &lt;B&gt;not&lt;/B&gt; &lt;B&gt;exists&lt;/B&gt; ${v.source}&lt;/P&gt;&lt;P&gt;shallow clone referrals_audit;&lt;/P&gt;&lt;P&gt;&lt;B&gt;truncate&lt;/B&gt; &lt;B&gt;table&lt;/B&gt; ${v.source}; -- shallow clone also keeps data reference and we should remove it &lt;/P&gt;&lt;P&gt;&lt;B&gt;alter&lt;/B&gt; &lt;B&gt;table&lt;/B&gt; ${v.source} &lt;B&gt;add&lt;/B&gt; &lt;B&gt;columns&lt;/B&gt; (Error string); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error in SQL statement: AnalysisException: org.apache.hadoop.hive.ql.metadata.HiveException: at least one column must be specified for the table&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/2316iD50C05B6EDE38C2E/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Nov 2021 16:20:01 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/random-error-related-to-dynamic-variables-in-sql-at-least-one/m-p/35139#M25811</guid>
      <dc:creator>lizou</dc:creator>
      <dc:date>2021-11-13T16:20:01Z</dc:date>
    </item>
    <item>
      <title>Re: Random error related to dynamic variables in SQL - at least one column must be specified (shallowclone table)</title>
      <link>https://community.databricks.com/t5/data-engineering/random-error-related-to-dynamic-variables-in-sql-at-least-one/m-p/35141#M25813</link>
      <description>&lt;P&gt;&lt;I&gt;A random error occurs when the ETL is running concurrent notebooks at same time. &lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is both using the same variable value for ${v.source}?&lt;/P&gt;&lt;P&gt;If yes it can be just logic issue as one notebook is dropping temp table used by other notebook.&lt;/P&gt;</description>
      <pubDate>Sun, 14 Nov 2021 16:53:27 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/random-error-related-to-dynamic-variables-in-sql-at-least-one/m-p/35141#M25813</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2021-11-14T16:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: Random error related to dynamic variables in SQL - at least one column must be specified (shallowclone table)</title>
      <link>https://community.databricks.com/t5/data-engineering/random-error-related-to-dynamic-variables-in-sql-at-least-one/m-p/35142#M25814</link>
      <description>&lt;P&gt;@Hubert Dudek​&amp;nbsp; thanks for replying &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The variable is different in each notebook.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The error only happened once so far, and I may need to keep eye on it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The idea to use a notebook template with dynamics table name, all merge statements &lt;/P&gt;&lt;P&gt;will be dynamically generated using table column list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached is _config&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;notebook call _config to set variables that are different because variable 'table' will be different in each notebook.&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/2317iA7EC1663A5FEC6A1/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 15 Nov 2021 03:42:13 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/random-error-related-to-dynamic-variables-in-sql-at-least-one/m-p/35142#M25814</guid>
      <dc:creator>lizou</dc:creator>
      <dc:date>2021-11-15T03:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: Random error related to dynamic variables in SQL - at least one column must be specified (shallowclone table)</title>
      <link>https://community.databricks.com/t5/data-engineering/random-error-related-to-dynamic-variables-in-sql-at-least-one/m-p/35143#M25815</link>
      <description>&lt;P&gt;The error happens again. I have removed the shallow clone in each notebook run. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My reasoning is there is an overhead of using shallow clone, and there is no need to &lt;/P&gt;&lt;P&gt;recreate the temp table structure each time as the table schema does not change much.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have out shallow clone in a separate schema management task.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;truncate table is the only line remains and the issue should not occur again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 04:24:53 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/random-error-related-to-dynamic-variables-in-sql-at-least-one/m-p/35143#M25815</guid>
      <dc:creator>lizou</dc:creator>
      <dc:date>2021-11-29T04:24:53Z</dc:date>
    </item>
    <item>
      <title>Re: Random error related to dynamic variables in SQL - at least one column must be specified (shallowclone table)</title>
      <link>https://community.databricks.com/t5/data-engineering/random-error-related-to-dynamic-variables-in-sql-at-least-one/m-p/35145#M25817</link>
      <description>&lt;P&gt;resolved myself&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 14:04:05 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/random-error-related-to-dynamic-variables-in-sql-at-least-one/m-p/35145#M25817</guid>
      <dc:creator>lizou</dc:creator>
      <dc:date>2022-02-16T14:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: Random error related to dynamic variables in SQL - at least one column must be specified (shallowclone table)</title>
      <link>https://community.databricks.com/t5/data-engineering/random-error-related-to-dynamic-variables-in-sql-at-least-one/m-p/35146#M25818</link>
      <description>&lt;P&gt;@lizou​&amp;nbsp;- That's great! I'm so glad. Would you be happy to share your solution with us and then mark the answer as best? That will help others find the solution more quickly. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 16:10:48 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/random-error-related-to-dynamic-variables-in-sql-at-least-one/m-p/35146#M25818</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-02-16T16:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: Random error related to dynamic variables in SQL - at least one column must be specified (shallowclone table)</title>
      <link>https://community.databricks.com/t5/data-engineering/random-error-related-to-dynamic-variables-in-sql-at-least-one/m-p/35147#M25819</link>
      <description>&lt;P&gt;The solution is simple, don't include a shallow clone in a ETL that runs frequently. It is not necessary to change the table schema if there is no need to do so. Use a fixed table schema for a temp table in which data get truncated and reloaed.&lt;/P&gt;</description>
      <pubDate>Sun, 17 Apr 2022 22:28:56 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/random-error-related-to-dynamic-variables-in-sql-at-least-one/m-p/35147#M25819</guid>
      <dc:creator>lizou</dc:creator>
      <dc:date>2022-04-17T22:28:56Z</dc:date>
    </item>
  </channel>
</rss>

