· 9 years ago · Sep 30, 2016, 09:04 PM
1CREATE EXTERNAL TABLE IF NOT EXISTS db.tableB LIKE db.tableA;
2
3insert overwrite table db.tableB partition (yymmddval, yymmddcrt)
4 select *
5 from db.tableA
6 where 1 = 1
7 and yymmddval between '${start}' and '${end}' ; # date 1 to date 7
8
9insert into table db.tableB partition (yymmddval, yymmddcrt)
10 select *
11 from db.tableA
12 where 1 = 1
13 and yymmddval between '${start}' and '${end}' ; # date 11 to date 17