title: Common syntax for creating named_struct in hive and presto
body: <p>I am trying to define a sql view that picks a subset of elements from a source struct data type and creates a new struct. In hive I can do this:</p>
  
  <pre><code>create view myview as 
  select
      id,
      named_struct("cnt", bkg.cnt, "val", bkg.val) as bkg
  from mybkgtable
  </code></pre>
  
  <p>This works. The trouble is, when this view is invoked from presto, it fails with: <code>Function named_struct not registered</code></p>
  
  <p>Found that presto has no <em>struct</em> data type, but has <em>ROW</em> instead. It works with this syntax:</p>
  
  <pre><code>select
      id,
      CAST(ROW(bkg.cnt, bkg.val) as row(cnt integer, val double)) as bkg
  from mybkgtable
  </code></pre>
  
  <p>However, this syntax isn't understood by Hive. </p>
  
  <p>Question is, is it possible to have one view definition that works on both hive and presto? </p>