title: Nesting Static Partition under Dynamic Partition
body: <p>In Hive why I am not allowed to nest a static partition under a dynamic partition?</p>
  
  <p>for eg the below is allowed</p>
  
  <pre><code>INSERT OVERWRITE TABLE T PARTITION (ds='2010-03-03', hr)
  SELECT key, value, /*ds,*/ hr FROM srcpart WHERE ds is not null and hr&gt;10;
  </code></pre>
  
  <p>but this is not allowed</p>
  
  <pre><code>INSERT OVERWRITE TABLE T PARTITION (ds, hr = 11)
  SELECT key, value, ds/*, hr*/ FROM srcpart WHERE ds is not null and hr=11;
  </code></pre>
  
  <p>I find the official wiki page explanation (shown below) insufficient. Prefer a logical explanation or an explanation at underlying map-reduce level.</p>
  
  <pre><code>SP is a subpartition of a DP: should throw an error because partition column order determins directory hierarchy. We cannot change the hierarchy in DML
  </code></pre>