title: Dynamic Partitioning + CREATE AS on HIVE
body: <p>I'm trying to create a new table from another table with <code>CREATE AS</code> and dynamic Partitioning on HiveCLI. I'm learning from Hive official wiki where there is this example:</p>
  <pre><code> CREATE TABLE T (key int, value string) 
   PARTITIONED BY (ds string, hr int) AS
   SELECT key, value, ds, hr+1 hr1 
     FROM srcpart 
     WHERE ds is not null 
     And hr&gt;10;
  </code></pre>
  <p>But I received this error:</p>
  <blockquote>
  <p>FAILED: SemanticException [Error 10065]:</p>
  <p>CREATE TABLE AS SELECT command cannot specify the list of columns for the target table</p>
  </blockquote>
  <p>Source: <a href="https://cwiki.apache.org/confluence/display/Hive/DynamicPartitions#DynamicPartitions-Syntax" rel="noreferrer">https://cwiki.apache.org/confluence/display/Hive/DynamicPartitions#DynamicPartitions-Syntax</a></p>