行错误解析异常的配置单元查询错误

Posted

技术标签:

【中文标题】行错误解析异常的配置单元查询错误【英文标题】:hive query error for rows error parse exception 【发布时间】:2021-08-27 09:07:21 【问题描述】:
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

【问题讨论】:

【参考方案1】:

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

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

【讨论】:

以上是关于行错误解析异常的配置单元查询错误的主要内容,如果未能解决你的问题,请参考以下文章

在配置单元中执行查询时显示 Tez 顶点错误

错误:当前子查询表达式仅允许作为配置单元中的 where 子句谓词

Hive:执行错误选择并同时删除分区配置单元查询

Spring里这个错误怎么解决啊?

Java错误和异常解析

Android之通过HttpURLConnection.getResponseCode状态码抛出异常的问题以及解决方法