CBT Export BigTable Data

670 Views Asked by At

I am looking for a way to export data from CBT instance using cbt commands.

I could see it working from GUI using following steps.

However, I am looking to do it from Terminal. Is there a way I can do that?

P.S. I already tried this:

curl -f -O http://repo1.maven.org/maven2/com/google/cloud/bigtable/bigtable-beam-import/1.1.2/bigtable-beam-import-1.1.2-shaded.jar ...

Not working for me.

1

There are 1 best solutions below

2
On

Posting this as a community wiki as it's based on @BillyJacobson's comment.

The difference between exporting data using the GUI and cbt commands is that the GUI allows you to export data into specific formats while the cbt commands allow you to just read data.

So if you want to export data through cbt commands you are going to have to create a bash script that uses the read command and log that to a file.

The command you will have to use, as described in the documentation is the following:

cbt read <table-id> [start=<row-key>] [end=<row-key>] [prefix=<row-key-prefix>] [regex=<regex>] [columns=<family>:<qualifier>,...] [count=<n>] [cells-per-column=<n>] [app-profile=<app-profile-id>]

Where the value are represented by:

start=<row-key>                     Start reading at this row
end=<row-row>                       Stop reading before this row
prefix=<row-key-prefix>             Read rows with this prefix
regex=<regex>                       Read rows with keys matching this regex
columns=<family>:<qualifier>,...    Read only these columns, comma-separated
count=<n>                           Read only this many rows
cells-per-column=<n>                Read only this many cells per column
app-profile=<app-profile-id>        The app profile ID to use for the request