Built with Tutify.io

    AIStudyLabs

    HBase - Exists and Count with examples

    HBase - Exists and Count with examples

    This tutorial describes how to check/verify if the table exists and get the counts in a table using the HBase shell and will practice with some examples.

    <a id="h-verifying-table-exists-using-hbase-shell"></a>

    Verifying table exists using HBase Shell

    Use exists command to verify if the table present in the database. Let’s see the syntax, usage with some examples.

    <a id="h-syntax-exists-lt-namespace-gt-lt-table-name-gt"></a>

    Syntax: exists '<namespace>:<table_name>'

    Example:

    exists returns boolean along with the message. returns 'true' when the table present in the database.

    Returns 'false' when table not present in the database.

    <a id="h-count-usage"></a>

    Count Usage

    Use count command to get the total records in a table. Let’s see the syntax, usage with some examples.

    <a id="h-syntax-count-lt-namespace-gt-lt-table-name-gt"></a>

    Syntax: count '<namespace>,<table_name>'

    Returns the number of rows in a table.

    When table is not found it returns an error 'Unknown table'

    Next, Let's learn how to Disable and Enable a table.

    <a id="h-related-articles"></a>

    Related Articles