@Krishna RIn your Hive terminal, set the following properties
set hive.exec.compress.output=true;
set mapreduce.output.fileoutputformat.compress.codec=org.apache.hadoop.io.compress.GzipCodec;
This will enable the compression and will set the compression codec, gzip in this case.
Now you can insert the data into an HDFS directory and the output will be in gzip format.
insert overwrite directory 'myHDFSDirectory' row format delimited fields terminated by ',' select * from myTable;
This will store the output of my select * query in the HDFS directory.
Let know if that works for you.