[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>