Saving all output to "!!{outputDirectory}!!/alter_partition_protect_mode.q.raw". Enter "record" with no arguments to stop it. >>> !run !!{qFileDirectory}!!/alter_partition_protect_mode.q >>> -- Create table >>> create table if not exists alter_part_protect_mode(key string, value string ) partitioned by (year string, month string) stored as textfile ; No rows affected >>> >>> -- Load data >>> load data local inpath '../data/files/T1.txt' overwrite into table alter_part_protect_mode partition (year='1996', month='10'); No rows affected >>> load data local inpath '../data/files/T1.txt' overwrite into table alter_part_protect_mode partition (year='1996', month='12'); No rows affected >>> load data local inpath '../data/files/T1.txt' overwrite into table alter_part_protect_mode partition (year='1995', month='09'); No rows affected >>> load data local inpath '../data/files/T1.txt' overwrite into table alter_part_protect_mode partition (year='1994', month='07'); No rows affected >>> >>> -- offline >>> alter table alter_part_protect_mode partition (year='1996') disable offline; No rows affected >>> select * from alter_part_protect_mode where year = '1996'; 'key','value','year','month' '1','11','1996','10' '2','12','1996','10' '3','13','1996','10' '7','17','1996','10' '8','18','1996','10' '8','28','1996','10' '1','11','1996','12' '2','12','1996','12' '3','13','1996','12' '7','17','1996','12' '8','18','1996','12' '8','28','1996','12' 12 rows selected >>> alter table alter_part_protect_mode partition (year='1995') enable offline; No rows affected >>> alter table alter_part_protect_mode partition (year='1995') disable offline; No rows affected >>> select * from alter_part_protect_mode where year = '1995'; 'key','value','year','month' '1','11','1995','09' '2','12','1995','09' '3','13','1995','09' '7','17','1995','09' '8','18','1995','09' '8','28','1995','09' 6 rows selected >>> >>> -- no_drop >>> alter table alter_part_protect_mode partition (year='1996') enable no_drop; No rows affected >>> alter table alter_part_protect_mode partition (year='1995') disable no_drop; No rows affected >>> alter table alter_part_protect_mode drop partition (year='1995'); No rows affected >>> alter table alter_part_protect_mode partition (year='1994', month='07') disable no_drop; No rows affected >>> alter table alter_part_protect_mode drop partition (year='1994'); No rows affected >>> >>> -- Cleanup >>> alter table alter_part_protect_mode partition (year='1996') disable no_drop; No rows affected >>> drop table alter_part_protect_mode; No rows affected >>> !record