按照这个操作的外部表
http://www.aboutyun.com/forum.php?mod=viewthread&tid=7458
有一个小问题哈
建表如下:
[mw_shl_code=shell,true]hive> create external table tbl_ext(id int ,name String, age int,tel string) location '/home/hadoop/ck/external';[/mw_shl_code]
导入过程和结果:
[mw_shl_code=shell,true]Loading data to table default.tbl_ext
OK
Time taken: 0.248 seconds
hive> show tables;
OK
hivepersons
tb_test_insertfile
tbl_ext
Time taken: 0.029 seconds, Fetched: 3 row(s)
hive> select * from tab_ext;
FAILED: SemanticException [Error 10001]: Line 1:14 Table not found 'tab_ext'
hive> select * from tbl_ext;
OK
NULL NULL NULL NULL
NULL NULL NULL NULL
NULL NULL NULL NULL
Time taken: 0.122 seconds, Fetched: 3 row(s)[/mw_shl_code]
我的数据如下:
[mw_shl_code=shell,true][hadoop@master external]$ hadoop fs -cat /home/hadoop/ck/external/ck.txt
1 ck 24 1111111111111
2 test 30 22222222222
3 zs 34 3333333333333 [/mw_shl_code]
问题是 为什么都是NULL 呢 感觉条数也是对的?
|