Hbase 扫描命令到 windows 中的文本文件

Hbase scan commands into a text file in windows

是否可以捕获 hbase 命令 "scan table" 到文本文件。

命令是这样的:

hbase(main):001:0>scan sampletable

我尝试使用命令提示符命令

hbase(main):001:0>scan sampletable > textfile.txt 

但给出错误 "wrong number of arguments"

我也尝试了以下命令:

hbase(main):001:0>echo "scan 'sampletable'" | hbase shell | grep "^ " > registration.txt

但是命令"unrecognised characters ^ "有异常

您不能在 hbase shell 中执行 linux 命令,如 echo、hbase 等。您需要在 windows power shell 中执行这些命令。

退出hbaseshell并执行下面的命令

echo "scan 'sampletable'" | hbase shell | grep "^ " > registration.txt