title: How to union two exploded results when one is empty?
body: <p>env: spark2.4.5</p>
  
  <p>My spark sql:</p>
  
  <pre><code>SELECT A.*
  FROM table_0
      LATERAL VIEW explode(table_0.Array_0) exploded_a_values AS A
  UNION
  SELECT B.*
  FROM table_0
      LATERAL VIEW explode(table_0.Array_1) exploded_a_values AS B
  </code></pre>
  
  <p>The explode structure A and B have the same schema. Error occurs when one of them is empty:</p>
  
  <pre><code>Can only star expand struct data types. Attribute: `ArrayBuffer)`;
  </code></pre>
  
  <p>Notice that elements in array is type of struct. My purpose is to pick out distinct elements in different array.</p>
  
  <p>So how can I handles such empty case? I would be very grateful if you could give me some suggestion. </p>