hbase shell 导出数据转json

数据

ROW                                     COLUMN+CELL
 1001                                   column=info:name, timestamp=1502368030841, value=张三
 1001                                   column=info:age, timestamp=1502368069926, value=18
 1001                                   column=info:sex, timestamp=1502368093636, value=male
 1001                                   column=info:addr, timestamp=1502368030841, value=杨浦
 1002                                   column=info:name, timestamp=1502368069926, value=里斯
 1002                                   column=info:age, timestamp=1502368093636, value=30
 1002                                   column=info:sex, timestamp=1502368030841, value=male
 1002                                   column=info:addr, timestamp=1502368069926, value=静安
8 row(s) in 0.0380 seconds

草稿

cat test.log | sed -e ‘/row(s)/d‘ -e ‘/ROW/d‘ | awk ‘{print }‘ | uniq
cat test.log | awk ‘{print ,,}‘ | grep ‘^1001‘ | sed -e ‘s/column=info:\|value=\|,//g‘ | awk ‘{print ,}‘
cat middile.log  | awk ‘BEGIN{printf "{ "} {printf("\"%s\":\"%s\", ", $2,$3)} END{printf "\"rowkey\"=\"1001\" }\n"}‘

hbase shell 导出数据转json

上一篇:CentOS7编译安装php7.1配置教程详解


下一篇:PostCSS_自动处理css3属性前缀