hbase shell 根据rowKey范围批量删除
tablename=$1
startrow=$2
endrow=$3
if [ $
echo "请输入表名,startRow,endRow"
exit 0
fi
echo "scan '${tablename}',{STARTROW=>'${startrow}',ENDROW=>'${endrow}'}" |hbase shell|awk -F ' ' '{print $1'\t'}'> ./file.txt
sed -i '1,6d' file.txt
sed -i '$d' file.txt
sed -i '$d' file.txt
cat ./file.txt|awk '{print $1}'|while read rowvalue
do
echo -e "deleteall '${tablename}','${rowvalue}'" >> ./deleteRowFile.txt
done
rm ./file.txt
echo "exit" >> ./deleteRowFile.txt
转载请注明原文地址:https://ipadbbs.8miu.com/read-741.html