Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-14759

GenericUDF.getFuncName breaks with UDF Classnames less than 10 characters

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Patch Available
    • Trivial
    • Resolution: Unresolved
    • 2.1.0
    • None
    • UDF

    Description

      return getClass().getSimpleName().substring(10).toLowerCase();
      

      causes

      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)
      

      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.

      Attachments

        1. HIVE-14759.patch
          0.7 kB
          Clemens Valiente
        2. HIVE-14759.2.patch
          0.7 kB
          Clemens Valiente
        3. HIVE-14759.1.patch
          0.7 kB
          Clemens Valiente

        Activity

          People

            cvaliente Clemens Valiente
            cvaliente Clemens Valiente
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Time Spent - 20m Remaining Estimate - 40m
                40m
                Logged:
                Time Spent - 20m Remaining Estimate - 40m
                20m