【问题标题】:Hive table is not showing up in command line interfaceHive 表未显示在命令行界面中
【发布时间】:2014-12-27 15:29:43
【问题描述】:

我有一个脚本来创建一个 hive 表,脚本成功完成但我看不到表,请帮忙。

下面是创建表的脚本 #!/bin/bash hive <<! > hive_out.log create table GoodRecords( id int, name string, state string, phone_no int, gender string) row format delimited fields terminated by ',' stored as textfile; exit; !

生成的日志: `hive> 创建表 GoodRecords(

id 整数, 名称字符串, 状态字符串, phone_no int, 性别字符串)以“,”结尾的行格式分隔字段 存储为文本文件; 蜂巢>退出;`

GUI Hadoop 显示表已创建: /user/hive/warehouse/goodrecords

命令行输出到showtables。 hive> show tables; OK Time taken: 0.34 seconds

【问题讨论】:

  • 尝试打印表格值。从 GoodRecords 中选择 *
  • 我已经执行了上述命令,但下面是输出.. 'hive> select * from GoodRecords ; FAILED: SemanticException [Error 10001]: Line 1:14 Table not found 'GoodRecords''
  • 创建表GoodRecords(id int, name string, state string, phone_no int, gender string) 以','结尾的行格式分隔字段存储为文本文件;从终端尝试此命令。然后运行显示表;

标签: hadoop hive bigdata


【解决方案1】:

设置 Hive Metastore 服务时存在一些问题。

只需尝试重新启动您的 Metastore 服务。它应该可以工作。

【讨论】:

  • 当我使用第三方软件创建表格时,我也面临同样的问题。我可以看到该表是在日志中创建的,但在 CLI 中看不到,但该表存在于 hadoop 中。
  • 这可能是因为您可能没有对 Metastore 临时文件夹的写入权限。例如,如果您的元存储在 mysql 中,则授予 tmp 文件夹上的所有权限。
猜你喜欢
  • 2014-11-20
  • 1970-01-01
  • 2021-06-26
  • 1970-01-01
  • 1970-01-01
  • 2017-08-04
  • 2018-07-31
  • 2013-10-30
  • 1970-01-01
相关资源
最近更新 更多