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

cannot create temporary udf dynamically, with a ClassNotFoundException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Duplicate
    • 0.3.0
    • None
    • Query Processor
    • None

    Description

      I found the ClassLoader cannot load my UDF when doing FunctionTask, because the ClassLoader hasnot append its classpaths on-the-fly yet.
      The ExecDriver' s addToClassPath(String[] newPaths) method is the only entry for ClassLoader dynamically append its classhpaths (besides hadoop's GenericOptionsParser).
      But that function wasnot called before FunctionTask getting my UDF class by class name. I think this is the reason why I came across that failure.

      scenario description:

      I set a peroperty in hive-site.xml to configure the classpath of my udf.
      <property>
      <name>hive.aux.jars.path</name>
      <value>/home/hadoop/hdpsoft/hive-auxs/zhoumin.jar</value>
      </property>

      but failed to register it with a ClassNotFoundException when creating udf through the sql command.
      CREATE TEMPORARY FUNCTION strlen AS 'hadoop.hive.udf.UdfStringLength'

      I'll make a patch soon.

      Attachments

        1. registerjars1.patch
          12 kB
          Min Zhou
        2. registerjars2.patch
          13 kB
          Min Zhou
        3. registerjars-v3.patch
          14 kB
          Min Zhou

        Issue Links

          Activity

            People

              Unassigned Unassigned
              coderplay Min Zhou
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: