【问题标题】:ParseException in HiveHive 中的 ParseException
【发布时间】:2015-10-20 07:08:18
【问题描述】:

我正在尝试在蜂巢中使用UDF。但是当我尝试使用 userdate as 'unixtimeToDate' 创建一个临时函数时,我得到了这个异常

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

我不确定为什么不支持该字符。请给我一些指导。

【问题讨论】:

    标签: hive


    【解决方案1】:

    这里的异常很清楚,您的 SQL 中有错误。您的 SQL 中有一个全宽空间。更多关于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

      在我的情况下,这是因为' ' 不是普通的space。我都换掉了,没问题。

      【讨论】:

      • 我在 DbVis 中遇到了这个问题,你是如何用空格替换空格的?
      【解决方案3】:

      以下是在 hive 中添加 jar 的语法

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

      【讨论】:

        猜你喜欢
        • 2017-05-11
        • 1970-01-01
        • 2017-10-04
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-04-02
        • 1970-01-01
        • 2022-12-21
        相关资源
        最近更新 更多