Add new column with existing partition table

 Use Alter command to add new column with CASCADE.


(1) alter table `db_name`.`table_name` add columns(flag string) CASCADE;

(2)  Please assign database name to both source and target tables to sync metastore with DB.

(3) Add column in schema with partition table.

(4) Then execute below Hive recipe.

insert overwrite table `db_name`.`emp_part1` partition(job)
SELECT 
`empno`
,`ename`
,`hiredate`
,`salary`
,`deptno`
,flag
,`job`
  FROM `prd_tbl_uacolob_hk_nsen`.`Emp_3`








Comments

Popular posts from this blog

Exponential Value parsing in SQL

Date format issue with spark sql

Root path does not exist