title: hive external partitioned table
body: <p>First i created hive external table partitioned by code and date </p>
  
  <pre><code>CREATE EXTERNAL TABLE IF NOT EXISTS XYZ
  (
  ID STRING,
  SAL BIGINT,
  NAME STRING,
  
  )
  PARTITIONED BY (CODE INT,DATE STRING)
  ROW FORMAT SERDE 'parquet.hive.serde.ParquetHiveSerDe'
  STORED AS 
  INPUTFORMAT "parquet.hive.DeprecatedParquetInputFormat"
  OUTPUTFORMAT "parquet.hive.DeprecatedParquetOutputFormat"
  LOCATION '/old_work/XYZ';
  </code></pre>
  
  <p>and then i execute insert overwrite on this table taking data from other table</p>
  
  <pre><code>INSERT OVERWRITE TABLE XYZ PARTITION (CODE,DATE)
  SELECT
  *
  FROM TEMP_XYZ;
  </code></pre>
  
  <p>and after that i count the number of records in hive
      select count(*) from XYZ;
  it shows me 1000 records are there
  and then i rename or move the location '/old_work/XYZ' to '/new_work/XYZ'</p>
  
  <p>and then i again drop the XYZ table and created again pointing location to new directory
  means '/new_work/XYZ'</p>
  
  <pre><code>CREATE EXTERNAL TABLE IF NOT EXISTS XYZ
  (
  ID STRING,
  SAL BIGINT,
  NAME STRING,
  
  )
  PARTITIONED BY (CODE INT,DATE STRING)
  ROW FORMAT SERDE 'parquet.hive.serde.ParquetHiveSerDe'
  STORED AS 
  INPUTFORMAT "parquet.hive.DeprecatedParquetInputFormat"
  OUTPUTFORMAT "parquet.hive.DeprecatedParquetOutputFormat"
  LOCATION '/new_work/XYZ';
  </code></pre>
  
  <p>But then when i execute select count(*) from XYZ table in hive , it shows 0 records ,
  i think i missed something , please help me on this????</p>