<?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: Creating a table like in SQL with Spark in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/creating-a-table-like-in-sql-with-spark/m-p/12194#M7048</link>
    <description>&lt;P&gt;Hi @Adrien MERAT​&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to share the following documentation that will provide examples on how to create Delta tables:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Create Delta table &lt;A href="https://docs.databricks.com/spark/2.x/spark-sql/language-manual/create-table.html#data-types" alt="https://docs.databricks.com/spark/2.x/spark-sql/language-manual/create-table.html#data-types" target="_blank"&gt;link&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Delta data types &lt;A href="https://docs.databricks.com/spark/2.x/spark-sql/language-manual/create-table.html#data-types" alt="https://docs.databricks.com/spark/2.x/spark-sql/language-manual/create-table.html#data-types" target="_blank"&gt;link&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
    <pubDate>Fri, 29 Oct 2021 23:12:34 GMT</pubDate>
    <dc:creator>jose_gonzalez</dc:creator>
    <dc:date>2021-10-29T23:12:34Z</dc:date>
    <item>
      <title>Creating a table like in SQL with Spark</title>
      <link>https://community.databricks.com/t5/data-engineering/creating-a-table-like-in-sql-with-spark/m-p/12192#M7046</link>
      <description>&lt;P&gt;Hi !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm working on a project at my company on Databricks using Scala and Spark. I'm new to Spark and Databricks and so I would like to know how to create a table on specific location (on the Delta Lake of my company). In SQL + some Delta features, I would have done it like so :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CREATE OR REPLACE TABLE delta.`mnt/peth/to/MyTable` (
    id SERIAL    PRIMARY KEY,
    m1 TIMESTAMP NOT NULL,
    m2 TIMESTAMP NOT NULL
) USING DELTA&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However, it seems that PRIMARY KEY as well as SERIAL is not recognize by Spark. So how can I make it understand I want this column to be in auto-increment and signed integer so I can simply do this to add new values :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;INSERT INTO MyTable VALUES (m1Value, m2Value)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS : I tried to use dataframes but when making unions to add a new row, Spark decide to only keep the last row of the table + the new row, so I want to skip dataframes if possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS2 : MyTable will not be used simultaneously by many process. It will be only successive calls&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 12:34:51 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/creating-a-table-like-in-sql-with-spark/m-p/12192#M7046</guid>
      <dc:creator>Adrien</dc:creator>
      <dc:date>2021-10-28T12:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table like in SQL with Spark</title>
      <link>https://community.databricks.com/t5/data-engineering/creating-a-table-like-in-sql-with-spark/m-p/12194#M7048</link>
      <description>&lt;P&gt;Hi @Adrien MERAT​&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to share the following documentation that will provide examples on how to create Delta tables:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Create Delta table &lt;A href="https://docs.databricks.com/spark/2.x/spark-sql/language-manual/create-table.html#data-types" alt="https://docs.databricks.com/spark/2.x/spark-sql/language-manual/create-table.html#data-types" target="_blank"&gt;link&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Delta data types &lt;A href="https://docs.databricks.com/spark/2.x/spark-sql/language-manual/create-table.html#data-types" alt="https://docs.databricks.com/spark/2.x/spark-sql/language-manual/create-table.html#data-types" target="_blank"&gt;link&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Fri, 29 Oct 2021 23:12:34 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/creating-a-table-like-in-sql-with-spark/m-p/12194#M7048</guid>
      <dc:creator>jose_gonzalez</dc:creator>
      <dc:date>2021-10-29T23:12:34Z</dc:date>
    </item>
  </channel>
</rss>

