How can I dump hbase table in a text file?

前端 未结 2 1103
醉话见心
醉话见心 2021-01-19 05:01

I need to take a dump of one table in HBase and need it in a text file/csv format? I looked for scan, export and get commands in HBase

2条回答
  •  自闭症患者
    2021-01-19 05:28

    If we need to have more control with Java code, hope below link will be helpful.

    https://gist.github.com/sakthiinfotec/102fca54c91b411f626a

    This will backup a single HBase table as CSV format in local filesystem. We need to pre-define the list of columns we needed from a single column family. This code uses necessary jars to connect HBase table along with OpenCSV jar to write CSV records.

    Assumption here is all the columns are only string.

提交回复
热议问题