【发布时间】: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) 以','结尾的行格式分隔字段存储为文本文件;从终端尝试此命令。然后运行显示表;