<?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: insert into a table with an identity column fails in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/insert-into-a-table-with-an-identity-column-fails/m-p/28756#M20533</link>
    <description>&lt;P&gt;Hi, Looks like it is not supported. &lt;/P&gt;&lt;P&gt;Please refer: &lt;A href="https://github.com/delta-io/delta/issues/1215" alt="https://github.com/delta-io/delta/issues/1215" target="_blank"&gt;https://github.com/delta-io/delta/issues/1215&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 08 Oct 2022 05:16:17 GMT</pubDate>
    <dc:creator>Debayan</dc:creator>
    <dc:date>2022-10-08T05:16:17Z</dc:date>
    <item>
      <title>insert into a table with an identity column fails</title>
      <link>https://community.databricks.com/t5/data-engineering/insert-into-a-table-with-an-identity-column-fails/m-p/28755#M20532</link>
      <description>&lt;P&gt;i am trying to insert into a table with an identity column  using a select query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, if i include the identity column or ignore the identity column in my insert it throws errors. Is thee a way to insert into select * from a table if the insert table has an identity column?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%sql&lt;/P&gt;&lt;P&gt;CREATE OR REPLACE TABLE demo (&lt;/P&gt;&lt;P&gt;&amp;nbsp;id BIGINT GENERATED ALWAYS AS IDENTITY,&lt;/P&gt;&lt;P&gt;&amp;nbsp;product_type STRING,&lt;/P&gt;&lt;P&gt;&amp;nbsp;sales BIGINT&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%sql&lt;/P&gt;&lt;P&gt;insert into demo_test&lt;/P&gt;&lt;P&gt;SELECT id,product_type, sales from demo&lt;/P&gt;&lt;P&gt;AnalysisException: Providing values for GENERATED ALWAYS AS IDENTITY column id is not supported.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%sql&lt;/P&gt;&lt;P&gt;insert into demo_test&lt;/P&gt;&lt;P&gt;SELECT product_type, sales from demo&lt;/P&gt;&lt;P&gt;nalysisException: Cannot write to 'spark_catalog.default.demo_test', not enough data columns; target table has 3 column(s) but the inserted data has 2 column(s)&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 15:53:57 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/insert-into-a-table-with-an-identity-column-fails/m-p/28755#M20532</guid>
      <dc:creator>nbakh</dc:creator>
      <dc:date>2022-10-06T15:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: insert into a table with an identity column fails</title>
      <link>https://community.databricks.com/t5/data-engineering/insert-into-a-table-with-an-identity-column-fails/m-p/28758#M20535</link>
      <description>&lt;P&gt;instead of using&lt;/P&gt;&lt;P&gt;GENERATED ALWAYS AS IDENTITY,&lt;/P&gt;&lt;P&gt;you need to use&lt;/P&gt;&lt;P&gt;GENERATED BY DEFAULT AS IDENTITY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 12:27:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/insert-into-a-table-with-an-identity-column-fails/m-p/28758#M20535</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2022-10-14T12:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: insert into a table with an identity column fails</title>
      <link>https://community.databricks.com/t5/data-engineering/insert-into-a-table-with-an-identity-column-fails/m-p/28756#M20533</link>
      <description>&lt;P&gt;Hi, Looks like it is not supported. &lt;/P&gt;&lt;P&gt;Please refer: &lt;A href="https://github.com/delta-io/delta/issues/1215" alt="https://github.com/delta-io/delta/issues/1215" target="_blank"&gt;https://github.com/delta-io/delta/issues/1215&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Oct 2022 05:16:17 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/insert-into-a-table-with-an-identity-column-fails/m-p/28756#M20533</guid>
      <dc:creator>Debayan</dc:creator>
      <dc:date>2022-10-08T05:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: insert into a table with an identity column fails</title>
      <link>https://community.databricks.com/t5/data-engineering/insert-into-a-table-with-an-identity-column-fails/m-p/50798#M28892</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Specify insert columns as below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;%sql&lt;BR /&gt;INSERT INTO demo_test (product_type, sales)&lt;BR /&gt;SELECT product_type, sales FROM demo&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 06:22:55 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/insert-into-a-table-with-an-identity-column-fails/m-p/50798#M28892</guid>
      <dc:creator>karan_singh</dc:creator>
      <dc:date>2023-11-10T06:22:55Z</dc:date>
    </item>
  </channel>
</rss>

