hive query error for rows error parse exception


hive> create table sample(id int,name string, dept string, pvsl float, nval float, end int) row format delimited fields terminated by ',';
FAILED: ParseException line 1:77 mismatched input 'end' expecting Identifier near ',' in column specification

[training@localhost ~]$ cat emp90

7369,SMITH,CLERK,800.00,null,20
7499,ALLEN,SALESMAN,1600.00,300.00,30
7521,WARD,SALESMAN,1250.00,500.00,30
7566,JONES,MANAGER,2975.00,null,20
7654,MARTIN,SALESMAN,1250.00,1400.00,30
7698,BLAKE,MANAGER,2850.00,null,30
7782,CLARK,MANAGER,2450.00,null,10
7788,SCOTT,ANALYST,3000.00,null,20
7839,KING,PRESIDENT,5000.00,null,10
7844,TURNER,SALESMAN,1500.00,0.00,30
7876,ADAMS,CLERK,1100.00,null,20
7900,JAMES,CLERK,950.00,null,30
7902,FORD,ANALYST,3000.00,null,20
7934,MILLER,CLERK,1300.00,null,10

如果要使用保留字作为列名,请使用反号:

create table sample(id int,name string, dept string, pvsl float, nval float, `end` int) row format delimited fields terminated by ',';

相关内容