Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Best way for checking hive table metadata at once

Solved Go to solution

Best way for checking hive table metadata at once

New Contributor

I want to check metadata of table such as column ,data type, and table name . So I tried to access hive meta store in mysql. I tried this query on mysql,I get the following Error.(I tried same query using root user, but it didn't work.)

How can I see this table?? or What is the best way for checking table metadata at once?

[maria_dev@sandbox-hdp ~]$ mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1532
Server version: 5.6.38 MySQL Community Server (GPL)


Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.


Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


mysql> SELECT * FROM hive.COLUMNS_V2;
ERROR 1142 (42000): SELECT command denied to user ''@'localhost' for table 'COLUMNS_V2'
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Best way for checking hive table metadata at once

@tomoya yoshida,

Can you try connecting to mysql as below

mysql -uhive -p{password}

password is the password which you hive in ambari GUI while adding hive service.

Thanks,

Aditya

2 REPLIES 2
Highlighted

Re: Best way for checking hive table metadata at once

@tomoya yoshida,

Can you try connecting to mysql as below

mysql -uhive -p{password}

password is the password which you hive in ambari GUI while adding hive service.

Thanks,

Aditya

Re: Best way for checking hive table metadata at once

New Contributor

You can also run DESC <TABLE_NAME> command from CLI or BEELINE.

Don't have an account?
Coming from Hortonworks? Activate your account here