USE dwh;
DROP TABLE IF EXISTS dm_install_list_v2;
CREATE EXTERNAL TABLE `dm_install_list_v2`(
  device_id string,
  device_type string,
  platform string,
  package_name string,
  update_date string
)PARTITIONED BY (
  dt string,
  business string
) ROW FORMAT SERDE 'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
STORED AS INPUTFORMAT
  'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
OUTPUTFORMAT
  'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'
LOCATION 's3://mob-emr-test/dataplatform/DataWareHouse/data/dwh/dm_install_list_v2';

ALTER TABLE dm_install_list_v2 RENAME TO dm_install_list_v2_old;