文件数据的格式问题hive解析出现错误
2018-03-12 11:53
633 查看
[wangshumin@centoshostnameKL2 ~]$ hdfs dfs -put stu2 /user/hive/warehouse/hive2_db1.db/stu2
[wangshumin@centoshostnameKL2 ~]$ hdfs dfs -cat /user/hive/warehouse/hive2_db1.db/stu2/stu2
1 ,zhangshan ,20
2 ,wangwu , 19
3 ,xiaolu , 26
[wangshumin@centoshostnameKL2 ~]$ vim stu2
[wangshumin@centoshostnameKL2 ~]$ cp stu2 stu3
[wangshumin@centoshostnameKL2 ~]$ vim stu3
[wangshumin@centoshostnameKL2 ~]$ hdfs dfs -put stu3 /user/hive/warehouse/hive2_db1.db/stu3
^[[A[wangshumin@centoshostnameKL2 ~]$ hdfs dfs -cat /user/hive/warehouse/hive2_db1.db/stu3/stu3
1 , zhangshan , 20
2 , wangwu , 19
3 , xiaolu , 26
[wangshumin@centoshostnameKL2 ~]$ cat stu1
1 ,zhangshan ,20
2 ,wangwu , 19
3 ,xiaolu , 26
[wangshumin@centoshostnameKL2 ~]$ cat stu2
1 ,zhangshan ,20
2 ,wangwu , 19
3 ,xiaolu , 26
[wangshumin@centoshostnameKL2 ~]$ cat stu3
1 , zhangshan , 20
2 , wangwu , 19
3 , xiaolu , 26
[wangshumin@centoshostnameKL2 ~]$
hive> create table stu1( id int , name String , age int )
> row format delimited
> fields terminated by ' ' ;
OK
Time taken: 0.073 seconds
hive> select * from stu1;
OK
1 zhangshan 20
2 wangwu NULL
3 xiaolu NULL
Time taken: 0.078 seconds, Fetched: 3 row(s)
hive> select * from stu1;
OK
1 zhangshan 20
2 wangwu NULL
3 xiaolu NULL
Time taken: 0.074 seconds, Fetched: 3 row(s)
hive> select * from stu1;
OK
1 zhangshan 20
2 wangwu NULL
3 xiaolu NULL
Time taken: 0.073 seconds, Fetched: 3 row(s)
hive> select * from stu1;
OK
1 zhangshan 20
2 wangwu NULL
3 xiaolu NULL
Time taken: 0.113 seconds, Fetched: 3 row(s)
hive> create table stu1( id int , name String , age int )
> row format delimited
> fields terminated by ',' ;
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. AlreadyExistsException(message:Table stu1 already exists)
hive> create table stu2( id int , name String , age int )
> row format delimited
> fields terminated by ',' ;
OK
Time taken: 0.083 seconds
hive> select * from stu2;
OK
NULL zhangshan 20
NULL wangwu NULL
NULL xiaolu NULL
Time taken: 0.419 seconds, Fetched: 3 row(s)
hive> create table stu2( id int , name String , age int )
> row format delimited
> fields terminated by ',' ;
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. AlreadyExistsException(message:Table stu2 already exists)
hive> create table stu3( id int , name String , age int )
> row format delimited
> fields terminated by ',' ;
OK
Time taken: 0.073 seconds
hive> select * from stu3 ;
OK
NULL zhangshan NULL
NULL wangwu NULL
NULL xiaolu NULL
Time taken: 0.069 seconds, Fetched: 3 row(s)
hive>
[wangshumin@centoshostnameKL2 ~]$ hdfs dfs -cat /user/hive/warehouse/hive2_db1.db/stu2/stu2
1 ,zhangshan ,20
2 ,wangwu , 19
3 ,xiaolu , 26
[wangshumin@centoshostnameKL2 ~]$ vim stu2
[wangshumin@centoshostnameKL2 ~]$ cp stu2 stu3
[wangshumin@centoshostnameKL2 ~]$ vim stu3
[wangshumin@centoshostnameKL2 ~]$ hdfs dfs -put stu3 /user/hive/warehouse/hive2_db1.db/stu3
^[[A[wangshumin@centoshostnameKL2 ~]$ hdfs dfs -cat /user/hive/warehouse/hive2_db1.db/stu3/stu3
1 , zhangshan , 20
2 , wangwu , 19
3 , xiaolu , 26
[wangshumin@centoshostnameKL2 ~]$ cat stu1
1 ,zhangshan ,20
2 ,wangwu , 19
3 ,xiaolu , 26
[wangshumin@centoshostnameKL2 ~]$ cat stu2
1 ,zhangshan ,20
2 ,wangwu , 19
3 ,xiaolu , 26
[wangshumin@centoshostnameKL2 ~]$ cat stu3
1 , zhangshan , 20
2 , wangwu , 19
3 , xiaolu , 26
[wangshumin@centoshostnameKL2 ~]$
hive> create table stu1( id int , name String , age int )
> row format delimited
> fields terminated by ' ' ;
OK
Time taken: 0.073 seconds
hive> select * from stu1;
OK
1 zhangshan 20
2 wangwu NULL
3 xiaolu NULL
Time taken: 0.078 seconds, Fetched: 3 row(s)
hive> select * from stu1;
OK
1 zhangshan 20
2 wangwu NULL
3 xiaolu NULL
Time taken: 0.074 seconds, Fetched: 3 row(s)
hive> select * from stu1;
OK
1 zhangshan 20
2 wangwu NULL
3 xiaolu NULL
Time taken: 0.073 seconds, Fetched: 3 row(s)
hive> select * from stu1;
OK
1 zhangshan 20
2 wangwu NULL
3 xiaolu NULL
Time taken: 0.113 seconds, Fetched: 3 row(s)
hive> create table stu1( id int , name String , age int )
> row format delimited
> fields terminated by ',' ;
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. AlreadyExistsException(message:Table stu1 already exists)
hive> create table stu2( id int , name String , age int )
> row format delimited
> fields terminated by ',' ;
OK
Time taken: 0.083 seconds
hive> select * from stu2;
OK
NULL zhangshan 20
NULL wangwu NULL
NULL xiaolu NULL
Time taken: 0.419 seconds, Fetched: 3 row(s)
hive> create table stu2( id int , name String , age int )
> row format delimited
> fields terminated by ',' ;
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. AlreadyExistsException(message:Table stu2 already exists)
hive> create table stu3( id int , name String , age int )
> row format delimited
> fields terminated by ',' ;
OK
Time taken: 0.073 seconds
hive> select * from stu3 ;
OK
NULL zhangshan NULL
NULL wangwu NULL
NULL xiaolu NULL
Time taken: 0.069 seconds, Fetched: 3 row(s)
hive>
相关文章推荐
- Java 简单解决springmvc获取properties文件里面中文内容出现论码问题(我遇到的问题是数据提交检验时返回的错误提示出现乱码)
- Hive数据仓库(11)之解析Json格式文件
- Java解析DBF文件,错误Failed to parse Number: For input string: "-.---" 或读取不出数据或乱码问题都在这里解决
- Java解析DBF文件,错误Failed to parse Number: For input string: "-.---" 或读取不出数据或乱码问题都在这里解决
- 关于获取JSON数据,出现格式错误的问题记录
- jxl导出excel出现“文件错误,可能某些数据格式已丢失"
- sax解析xml文件出现编码错误问题Invalid byte 1 of 1-byte UTF-8 sequence.
- Asp.net上传文件限制,在大于5M的时候出现DNS解析错误,解决方法。
- 解决 JScript 中使用日期类型数据时出现类型错误的问题
- 搜狗拼音str数据文件格式错误解决办法
- Oracle IO问题解析(六)—— 数据文件相关的IO事件
- VC6.0打开文件,出现“MSDEV.EXE-应用程序错误 遇到问题需要关闭
- 如何处理ODBC中EXCEL驱动读取EXCEL文件中字段长度大于255字符时出现的"数据截断"问题.
- C# 读取EXCEL文件出现数据丢失问题
- ADO 读取Excel文件数据, 丢失数据或数据错误问题。
- Myeclipse6.5+weblogic8.1老是配置文件出现,sax解析错误,不能解析web-app的解决办法
- 解决打开CHM格式文件出现“网页不能浏览”错误的方法
- ADO 读取Excel文件数据, 丢失数据或数据错误问题。
- 解决打开CHM格式文件出现“网页不能浏览”错误的方法
- visual studio 2008安装出现"无法打开数据文件问题"