hive分区导入

for((i=1;i<1000;i++));do
date1=$( date -d -${i}day +%Y-%m-%d )
 
hive  -v -e "set mapred.job.queue.name=${queueName};use social; insert overwrite table social_checkins partition(y = '${date1:0:4}', m ='${date1:5:2}', d = '${date1:8:2}') select uid ,id,title,address,lon,lat,category ,city  ,province ,country ,url,phone ,postcode ,weiboId,categorys,categoryName,icon,checkinUserNum ,poiStreetAddress ,poiStreetSummary ,checkinTime from t_social_checkins where substr(checkinTime,0,10 ) = ${date1}  ";   
   
done

你可能感兴趣的:(hive)