hive table to table copy


we also offer , online and classroom trainings
we support in POC
author: Bharat (sree ram)
contact :04042026071
__________________________________________________________




1)  hive>  insert overwrite table  tab1
                  select  *  from tab2;

     all  rows  of tab2 will be loaded to tab1.

2)  hive>  insert overwrite table tab1
                 select * from tab2 where   a>100;

  only matching rows with criteria   will be loaded into tab1.

3) tabx has ---->   a int, b int, c int, d int
   taby has --->  a int, d int columns

 now how to load only   a, d columns of taby to tabx.

   hive> insert overwrite  table tabx
               select  a, 0 as b, 0 as c, d from   taby;


   

0 comments: