【问题标题】:CBT Export BigTable DataCBT 导出 BigTable 数据
【发布时间】:2021-08-13 09:40:18
【问题描述】:

我正在寻找一种使用 cbt 命令从 CBT 实例导出数据的方法。

我可以看到它使用following steps 从 GUI 工作。

但是,我希望从终端执行此操作。有什么办法可以做到吗?

附:我已经试过了:

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 ...

不适合我。

【问题讨论】:

  • 您希望以什么格式导出数据?您链接的页面有几个不同的格式选项,您可以使用这些选项导出数据,这对于您要如何导出来说是一个重要因素。 cbt 允许您读取数据,因此您可以使用 read 命令编写一个 bash 脚本并将其记录到文件中
  • @BillyJacobson 我正在寻找的是cbt export 或类似命令。我将为此创建一个脚本。

标签: google-cloud-bigtable bigtable cbt


【解决方案1】:

根据@BillyJacobson 的评论将此作为社区 wiki 发布。

使用 GUI 和 cbt 命令导出数据的区别在于,GUI 允许您将数据导出为特定格式,而 cbt 命令只允许您读取数据。

因此,如果您想通过 cbt 命令导出数据,则必须创建一个使用 read 命令的 bash 脚本并将其记录到文件中。

documentation 中所述,您必须使用的命令如下:

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>]

值在哪里表示:

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

【讨论】:

  • 我要找的是命令。格式和一切都可以照顾。这是我最初的问题是
  • 好的,明白了,我用假定使用的命令编辑了答案。
猜你喜欢
  • 2023-03-14
  • 2020-12-25
  • 1970-01-01
  • 1970-01-01
  • 2018-04-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多