title: Hive - How to insert in a hive table an array of struct
body: <p>So I learnt from <a href="https://stackoverflow.com/q/30446601/1773841">here</a> how to insert values into an array column:</p>
  
  <pre><code>INSERT INTO table 
  SELECT ARRAY("line1", "line2", "line3") as myArray
  FROM source1;
  </code></pre>
  
  <p>And from <a href="https://stackoverflow.com/q/39394499/1773841">here</a> how to insert values into an struct column:</p>
  
  <pre><code>INSERT INTO table 
  SELECT NAMED_STRUCT('houseno','123','streetname','GoldStreet', 'town','London', 'postcode','W1a9JF') AS address 
  FROM source2;
  </code></pre>
  
  <p>Now I was trying to insert in the same way values in an array of structs. Which has got the following schema:</p>
  
  <pre><code>additionalattribute:array&lt;struct&lt;attribute_value:string,key:string,value:string&gt;
  </code></pre>
  
  <p>I tried to extrapolate like this: </p>
  
  <pre><code>  INSERT INTO table 
    ARRAY(NAMED_STRUCT('attribute_value','null','key','null','value','null')) as additionalattribute
    FROM source2;
  </code></pre>
  
  <p>But it is not working. Does anyone know how to approach this issue?</p>