本帖最后由 boy461205160 于 2016-5-9 22:35 编辑
hive sellect查询表数据为null
创建表成功
hive> show create table wyp;
OK
CREATE TABLE `wyp`(
`id` int,
`name` string,
`age` int,
`tel` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://master:9000/user/hive/warehouse/wyp'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'totalSize'='85',
'transient_lastDdlTime'='1462786590')
Time taken: 0.054 seconds, Fetched: 18 row(s)
导入数据成功
hive> dfs -ls /user/hive/warehouse/wyp/wyp.txt;
-rw-r--r-- 2 root supergroup 85 2016-05-09 17:36 /user/hive/warehouse/wyp/wyp.txt
查询wyp表数值为null
hive> select * from wyp;
OK
NULL NULL NULL NULL
NULL NULL NULL NULL
NULL NULL NULL NULL
Time taken: 0.05 seconds, Fetched: 3 row(s)
数据格式
[root@master ~]# hadoop fs -cat /user/hive/warehouse/wyp/wyp.txt
16/05/09 22:30:33 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
1 wyp 25 13188888888888
2 test 30 13888888888888
3 zs 34 899314121
|