title: hive view with nested selects and partition pruning
body: <p>I have a view in HIVE with subselect - the purpose of the view is to remove dups from the source table.</p>
  
  <p>The source table is partitioned by source_system column.</p>
  
  <pre><code>CREATE VIEW myview AS 
          SELECT * FROM (
              SELECT            
                *
                ,row_number() OVER (PARTITION BY source_system,key ORDER BY modification_date DESC) as seq_rn
              FROM mytable
          )  t
          WHERE seq_rn= 1
      ;
  </code></pre>
  
  <p>The problem is that if I do</p>
  
  <pre><code>EXPLAIN DEPENDENCY    SELECT * FROM myview WHERE source_system='AAA'
  </code></pre>
  
  <p>I see that all partitions are being scanned so partition pruning is not happening.</p>
  
  <p>Is there any way around this?</p>