ParseException in Hive

六眼飞鱼酱① 提交于 2021-02-07 14:20:37

问题


I am trying to use a UDF in hive. But when I try to create a temporary function using  userdate as 'unixtimeToDate', I get this exception

hive> create temporary function userdate1 as 'unixtimeToDate';
FAILED: ParseException line 1:25 character ' ' not supported here
line 1:35 character ' ' not supported here

I am not sure why the character is not supported. Could I get some guidance on this please.


回答1:


The exception is clear enough here, you have an error in your SQL. You have a full width space in your SQL. More about Halfwidth_and_fullwidth_forms

hive> create temporary function userdate1 as 'unixtimeToDate';
                                        ^^^here, you have a full width space



回答2:


org.apache.spark.sql.AnalysisException: line .. character ' ' not supported here

In my situation, it's because the ' ' is not a normal space. I replaced them all and it's OK.




回答3:


Below is syntax for adding jar in hive

ADD JAR absolute_path_of_jar_file;
CREATE TEMPORARY FUNCTION function_name AS 'packagename.ClassName';


来源:https://stackoverflow.com/questions/33230159/parseexception-in-hive

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!