title: Use named_struct function in Hive with all the columns of a table
body: <p>In Hive, you can use a function <code>named_struct</code> in order to create a list of key value pairs; the keys are usually the column names and the values are the values in the corresponding column. For example, </p>
  
  <pre><code>$hive&gt; select id, named_struct('foo', name, 'address', address) as list from users;
  id list
  1  {'foo':'Alice', 'address':'Wonderland'}
  2  {'foo':'Bob', 'address':'Portland'}
  ...
  </code></pre>
  
  <p>However, in order to make the list, I needed to explicitly write each column name. Is there any way to avoid doing this with either <code>named_struct</code> or some other similar function?</p>
  
  <p>I expect to be able to write something like (assuming <code>users</code> has only three columns). </p>
  
  <pre><code>$hive&gt; select id, named_struct(*) as list from users;
  </code></pre>