<?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: How to read enum[] (enum of array) datatype from postgres using spark in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-read-enum-enum-of-array-datatype-from-postgres-using/m-p/13507#M8180</link>
    <description>&lt;P&gt;You can try custom schema for JDBC read&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;.option("customSchema", "colname STRING") &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Jan 2023 13:12:26 GMT</pubDate>
    <dc:creator>Hubert-Dudek</dc:creator>
    <dc:date>2023-01-05T13:12:26Z</dc:date>
    <item>
      <title>How to read enum[] (enum of array) datatype from postgres using spark</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-read-enum-enum-of-array-datatype-from-postgres-using/m-p/13506#M8179</link>
      <description>&lt;P&gt;We are trying to read a column which is enum of array datatype from postgres as string datatype to target.  We could able to achieve this by expilcitly using concat function while extracting like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;val jdbcDF3 = spark.read&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;&amp;nbsp;.format("jdbc")&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;&amp;nbsp;.option("url", &amp;lt;jdbc url&amp;gt;)&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;&amp;nbsp;.option("query", "SELECT concat(colname) as colname FROM &amp;lt;tablename&amp;gt; ")&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;&amp;nbsp;.load()&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does spark not support reading &lt;B&gt;array&lt;/B&gt; datatype as &lt;B&gt;string&lt;/B&gt; by default without using concat function?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are getting the "&lt;B&gt;SQLException: Unsupported type ARRAY&lt;/B&gt;" error if we dont use concat function while extracting&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2023 12:29:51 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-read-enum-enum-of-array-datatype-from-postgres-using/m-p/13506#M8179</guid>
      <dc:creator>RamyaN</dc:creator>
      <dc:date>2023-01-05T12:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to read enum[] (enum of array) datatype from postgres using spark</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-read-enum-enum-of-array-datatype-from-postgres-using/m-p/13507#M8180</link>
      <description>&lt;P&gt;You can try custom schema for JDBC read&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;.option("customSchema", "colname STRING") &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2023 13:12:26 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-read-enum-enum-of-array-datatype-from-postgres-using/m-p/13507#M8180</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2023-01-05T13:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to read enum[] (enum of array) datatype from postgres using spark</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-read-enum-enum-of-array-datatype-from-postgres-using/m-p/13508#M8181</link>
      <description>&lt;P&gt;Tried.. No luck @Hubert Dudek​&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2023 04:01:15 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-read-enum-enum-of-array-datatype-from-postgres-using/m-p/13508#M8181</guid>
      <dc:creator>RamyaN</dc:creator>
      <dc:date>2023-01-06T04:01:15Z</dc:date>
    </item>
  </channel>
</rss>

