hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-14759) GenericUDF.getFuncName breaks with UDF Classnames less than 10 characters
Date Wed, 14 Sep 2016 15:26:21 GMT

    [ https://issues.apache.org/jira/browse/HIVE-14759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15490706#comment-15490706
] 

ASF GitHub Bot commented on HIVE-14759:
---------------------------------------

GitHub user cvaliente opened a pull request:

    https://github.com/apache/hive/pull/101

    HIVE-14759 remove GenericUDF from funcName instead of first 10 chars

    remove "GenericUDF" from the function Name instead of first 10 chars which causes IndexOutOfBounds
when my Classname is less than ten chars.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/cvaliente/hive HIVE-14759

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/hive/pull/101.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #101
    
----
commit 4bc0fe7b5edb5b458ff4c7eda58519bc6ef41036
Author: Clemens Valiente <clemens.valiente@trivago.com>
Date:   2016-09-14T15:23:28Z

    HIVE-14759 remove GenericUDF from funcName instead of first 10 characters.

----


> GenericUDF.getFuncName breaks with UDF Classnames less than 10 characters
> -------------------------------------------------------------------------
>
>                 Key: HIVE-14759
>                 URL: https://issues.apache.org/jira/browse/HIVE-14759
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>    Affects Versions: 2.1.0
>            Reporter: Clemens Valiente
>            Assignee: Clemens Valiente
>            Priority: Trivial
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> {code}
> return getClass().getSimpleName().substring(10).toLowerCase();
> {code}
> causes
> {code}
> java.lang.StringIndexOutOfBoundsException: String index out of range: -2
>     at java.lang.String.substring(String.java:1875)
>     at org.apache.hadoop.hive.ql.udf.generic.GenericUDF.getFuncName(GenericUDF.java:258)
> {code}
> if the Classname of my UDF is less than 10 characters.
> this was probably to remove "GenericUDF" from the classname but causes issues if the
class doesn't start with it.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message