问题
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