Search code examples
mysqlhadoophivemetadatametastore

Unable to view all the hive metastore tables in mysql setup


I have apache Hive - 0.12.0 and hadoop - 1.2.1 version on my machine. and used mysql for hive metastore.

Now when i fire show tables for metastore test, it only shows 20 rows/tables.

// My Environment
mysql> use metastore_db
Database changed
mysql> show tables;
+---------------------------+
| Tables_in_metastore_db    |
+---------------------------+
| BUCKETING_COLS            | 
| CDS                       | 
| COLUMNS_V2                | 
| DATABASE_PARAMS           | 
| DBS                       | 
| PARTITION_KEYS            | 
| SDS                       | 
| SD_PARAMS                 | 
| SEQUENCE_TABLE            | 
| SERDES                    | 
| SERDE_PARAMS              | 
| SKEWED_COL_NAMES          | 
| SKEWED_COL_VALUE_LOC_MAP  | 
| SKEWED_STRING_LIST        | 
| SKEWED_STRING_LIST_VALUES | 
| SKEWED_VALUES             | 
| SORT_COLS                 | 
| TABLE_PARAMS              | 
| TBLS                      | 
| VERSION                   | 
+---------------------------+
20 rows in set (0.06 sec)

Why am not able to see all the tables like below one. Do i need to use any other hive version for this ? Please suggest.

// Need to see all these tables
mysql> show tables;
+ --------------------------- +
| Tables_in_hive_demo  |
+ --------------------------- +
| BUCKETING_COLS |
| CDS |
| COLUMNS_V2 |
| DATABASE_PARAMS |
| DBS |
| DB_PRIVS |
| GLOBAL_PRIVS |
| IDXS |
| INDEX_PARAMS |
| NUCLEUS_TABLES |
| PARTITIONS |
| PARTITION_EVENTS |
| PARTITION_KEYS |
| PARTITION_KEY_VALS |
| PARTITION_PARAMS |
| PART_COL_PRIVS |
| PART_COL_STATS |
| PART_PRIVS |
| ROLES |
| ROLE_MAP |
| SDS |
| SD_PARAMS |
| SEQUENCE_TABLE |
| SERDES |
| SERDE_PARAMS |
| SKEWED_COL_NAMES |
| SKEWED_COL_VALUE_LOC_MAP |
| SKEWED_STRING_LIST |
| SKEWED_STRING_LIST_VALUES |
| SKEWED_VALUES |
| SORT_COLS |
| TABLE_PARAMS |
| TAB_COL_STATS |
| TBLS |
| TBL_COL_PRIVS |
| TBL_PRIVS |
| TYPES |
| TYPE_FIELDS |
| VERSION |
+ --------------------------- +
39 rowsinset (0.00 sec) 

Solution

  • Try to upgrade the hive schema by the available sql script (mysql in your case).

    mysql> use metastore_db
    Database changed
    
    mysql> SOURCE $HIVE_HOME/scripts/metastore/upgrade/mysql/hive-schema-0.12.0.mysql.sql;
    
    mysql> CREATE USER 'dbuser'@'%' IDENTIFIED BY 'dbpassword'; 
    
    mysql> GRANT all on *.* to 'dbuser'@localhost identified by 'dbpassword';
    
    mysql> flush privileges;
    

    Now requery your tables. It should show all the tables now.

    mysql> show tables;