cbt: Utility for reading data from Google Cloud’s Bigtable

“cbt” is a command-line utility that enables users to read data from Google Cloud’s Bigtable, a highly scalable and fully managed NoSQL database service. With “cbt,” users can interact with Bigtable, query data, and retrieve information directly from the command line, providing a convenient and efficient way to work with Bigtable data.

Here are the key features and functionalities of “cbt”:

  • Bigtable Data Access: “cbt” allows users to access and read data stored in Google Cloud’s Bigtable. It connects to the Bigtable service and provides a command-line interface for interacting with tables, rows, and columns within a Bigtable instance.
  • Command-Line Interface: “cbt” operates entirely through the command line, providing a text-based interface for interacting with Bigtable. Users can execute “cbt” commands, such as specifying the Bigtable instance and table, to retrieve data and perform operations on the stored data.
  • Data Retrieval: One of the primary functions of “cbt” is to facilitate the retrieval of data from Bigtable. Users can specify the desired table, row key, and column families/column qualifiers to read specific data from the database. This allows for targeted data retrieval based on specific criteria and filters.
  • Query Execution: “cbt” supports the execution of various queries to retrieve data from Bigtable. Users can use filters, range scans, and other query parameters to narrow down the data they want to retrieve. This provides flexibility and precision in accessing the desired data from Bigtable.
  • Integration with Google Cloud: “cbt” seamlessly integrates with Google Cloud’s Bigtable service, leveraging the underlying infrastructure and authentication mechanisms provided by Google Cloud Platform. Users can authenticate with their Google Cloud credentials and leverage the security and access control features of Google Cloud’s Bigtable service.
  • Automation and Scripting: “cbt” is designed to support automation and scripting tasks. Users can incorporate “cbt” commands into scripts or use it in conjunction with other command-line tools to perform batch operations, automate data retrieval tasks, or integrate Bigtable access into their workflow.

“cbt” serves as a powerful and flexible tool for accessing and retrieving data from Google Cloud’s Bigtable. Its command-line interface allows for quick and efficient interactions with Bigtable, making it suitable for both ad hoc queries and automated data retrieval tasks. By leveraging “cbt,” users can conveniently work with Bigtable data from the command line, streamlining their data access and retrieval workflows.

cbt Command Examples

1. List tables in the current project:

# cbt ls

2. Print count of rows in a specific table in the current project:

# cbt count "table_name"

3. Display a single row from a specific table with only 1 (most recent) cell revision per column in the current project:

# cbt lookup "table_name" "row_key" cells-per-column=1

4. Display a single row with only specific column(s) (omit qualifier to return entire family) in the current project:

# cbt lookup "table_name" "row_key" columns="family1:qualifier1,family2:qualifier2,..."

5. Search up to 5 rows in the current project by a specific regex pattern and print them:

# cbt read "table_name" regex="row_key_pattern" count=5

6. Read a specific range of rows and print only returned row keys in the current project:

# cbt read table_name start=start_row_key end=end_row_key keys-only=true
Related Post