配置单元 - 如何查看在Metastore中创建的表格? [英] Hive - How to see the table created in metastore?

查看:115
本文介绍了配置单元 - 如何查看在Metastore中创建的表格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我们的设置 -
我们的Hive使用另一台机器上的MySQL作为Metastore。
我可以启动Hive命令行shell并创建一个表并对其进行描述。
但是,当我登录到其中使用MySQL作为Metastore的其他机器时,我无法在MySQL上看到Hive表格的详细信息。

例如。以下是hive命令 -

  hive>创建表格学生(姓名STRING,ID INT); 
确定
所需时间:7.464秒
配置单元>描述学生;
OK
名称字符串
id int
所用时间:0.408秒
hive>

接下来,我登录到安装了MySQL的计算机,并将此MySQL用作Hive Metastore。我使用metastore数据库。但如果我想列出表格,我看不到我在Hive中创建的表格或表格信息。



如何在Metastore中查看Hive表格信息首先,找到存储在Metastore中的MySql数据库。这将会在你的hive-site.conf文件中找到。 - 连接网址。然后,一旦连接到MySql,您就可以使用Metastore;

 使用Metastore; 
显示表格;
从TBLS中选择*; < - 这会给你你的配置单元列表


Here is our setup - We have Hive that uses MySQL on another machine as a metastore. I can start the Hive command line shell and create a table and describe it. But when I log on to the other machine where MySQL is used as metastore, I cannot see the Hive table details on the MySQL.

e.g. Here are hive commands -

hive> create table student(name STRING, id INT);
OK
Time taken: 7.464 seconds
hive> describe student;
OK
name    string
id      int
Time taken: 0.408 seconds
hive>

Next, I log on to the machine where MySQL is installed and this MySQL is used as Hive metastore. I use the "metastore" database. But if I want to list the tables, I cannot see the table or the table info I have created in Hive.

How can I see the Hive table information in the metastore?

解决方案

First, find what MySql database the metastore is stored in. This is going to be in your hive-site.conf - connection URL. Then, once you connect to MySql you can

use metastore; 
show tables; 
select * from TBLS; <-- this will give you list of your hive tables

这篇关于配置单元 - 如何查看在Metastore中创建的表格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆