<?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 handle Blank values in Array of struct elements in pyspark in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-handle-blank-values-in-array-of-struct-elements-in/m-p/27215#M19095</link>
    <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi @Anbazhagan anbutech17,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;Can you please try as in below answers,&lt;P&gt;&lt;/P&gt;&lt;A href="https://stackoverflow.com/questions/56942683/how-to-add-null-columns-to-complex-array-struct-in-spark-with-a-udf" target="_blank"&gt;https://stackoverflow.com/questions/56942683/how-to-add-null-columns-to-complex-array-struct-in-spark-with-a-udf&lt;/A&gt;</description>
    <pubDate>Wed, 15 Apr 2020 19:05:23 GMT</pubDate>
    <dc:creator>shyam_9</dc:creator>
    <dc:date>2020-04-15T19:05:23Z</dc:date>
    <item>
      <title>How to handle Blank values in Array of struct elements in pyspark</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-handle-blank-values-in-array-of-struct-elements-in/m-p/27214#M19094</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Hello All,&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;We have a data in a column in pyspark dataframe having array of struct type&lt;P&gt;&lt;/P&gt;having multiple nested fields present.if the value is not blank it will save&lt;P&gt;&lt;/P&gt;the data in the same array of struct type in spark delta table.&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;please advise on the below case:&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;if the same column coming as blank ,it is treated as array&amp;lt;string&amp;gt; in the&lt;P&gt;&lt;/P&gt;dataframe.&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;f the same column coming as array of struct elements it is fine.&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;Could you please advise how do we handle this scenario in pyspark to avoid&lt;P&gt;&lt;/P&gt;the error "Failed to merge incompatible data types StructType(StructField(ac&lt;P&gt;&lt;/P&gt;...................... and StringType&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;how do we handle array of struct type and array&amp;lt;string&amp;gt; in the same column&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;Thanks 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 06:14:28 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-handle-blank-values-in-array-of-struct-elements-in/m-p/27214#M19094</guid>
      <dc:creator>Anbazhagananbut</dc:creator>
      <dc:date>2020-04-08T06:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle Blank values in Array of struct elements in pyspark</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-handle-blank-values-in-array-of-struct-elements-in/m-p/27215#M19095</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi @Anbazhagan anbutech17,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;Can you please try as in below answers,&lt;P&gt;&lt;/P&gt;&lt;A href="https://stackoverflow.com/questions/56942683/how-to-add-null-columns-to-complex-array-struct-in-spark-with-a-udf" target="_blank"&gt;https://stackoverflow.com/questions/56942683/how-to-add-null-columns-to-complex-array-struct-in-spark-with-a-udf&lt;/A&gt;</description>
      <pubDate>Wed, 15 Apr 2020 19:05:23 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-handle-blank-values-in-array-of-struct-elements-in/m-p/27215#M19095</guid>
      <dc:creator>shyam_9</dc:creator>
      <dc:date>2020-04-15T19:05:23Z</dc:date>
    </item>
  </channel>
</rss>

