How do you insert data into complex data type "Struct" in Hive
<p>I'm completely new to Hive and Stack Overflow. I'm trying to create a table with complex data type "STRUCT" and then populate it using <code>INSERT INTO TABLE</code> in Hive.</p>

<p>I'm using the following code:</p>

<pre><code>CREATE TABLE struct_test
(
 address STRUCT&lt;
                houseno:    STRING
               ,streetname: STRING
               ,town:       STRING
               ,postcode:   STRING
               &gt;
);

INSERT INTO TABLE struct_test
SELECT NAMED_STRUCT('123', 'GoldStreet', London', W1a9JF') AS address
FROM dummy_table
LIMIT 1;
</code></pre>

<p>I get the following error:</p>

<blockquote>
  <p>Error while compiling statement: FAILED: semanticException [Error
  10044]: Cannot insert into target because column number type are
  different 'struct_test': Cannot convert column 0 from struct to
  array>.</p>
</blockquote>

<p>I was able to use similar code with success to create and populate a data type Array but am having difficulty with Struct. I've tried lots of code examples I've found online but none of them seem to work for me... I would really appreciate some help on this as I've been stuck on it for quite a while now!  Thanks.</p>