# !/bin/bash
# 功能:按时间查找相应列的数据量
# 开发人:jhy
# 输入参数据:$1库名 $2表名 $3列簇名 $4起始时间 $5截止时间 $6列名
# ps:sh hbase_select.sh huihuahua app_call_records app '2018-03-01 00:00:00' '2018-03-28 00:00:00' customer_id
# 按列名进行删除,必须删除所有列
if [ $# -lt 6 ];then
echo "wrong arg[] number"
exit 1
fi
ns1=$1
t1=$2
c1=$3
l1=$6
start_date="$4"
end_date="$5"
start_tm=`date -d "$start_date" +%s`
end_tm=`date -d "$end_date" +%s`
start_tm_rs=$((start_tm*1000+`date "+%N"`/1000000))
end_tm_rs=$((end_tm*1000+`date "+%N"`/1000000))
echo "scan '$ns1:$t1', { COLUMN => '$c1:$l1', TIMERANGE => [$s
通过列名称查询hbase中指定时间段的数据
最新推荐文章于 2024-04-01 14:41:12 发布