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

DROP FUNCTION silently passes when function doesn't exist

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      DROP FUNCTION silently passes when a function doesn't exist, which is bad, especially because hive has "DROP FUNCTION IF EXISTS".
      I was working with functions when I found that "DROP FUNCTION myfunc" passed, and I thought it simply dropped the function, but then it kept working. I realized I was supposed to call "DROP FUNCTION default.myfunc" because it's registered as "default.myfunc". This "default" usecase is just one example where DROP FUNCTION seems to work expected but silently causes confusion.

      CREATE FUNCTION qtest_get_java_boolean AS 'org.apache.hadoop.hive.ql.udf.generic.GenericUDFTestGetJavaBoolean';
      describe function extended qtest_get_java_boolean;
      
      drop function if exists qtest_get_java_boolean_typo; #PASS, find
      
      drop function qtest_get_java_boolean_typo; #PASS, should fail I believe
      

      UPDATE: okay, I've just realized there is hive.exec.drop.ignorenonexistent=true which causes this
      I still don't like this, why do we ignore non-existent functions if we have a separate "if exist" clause? at least a message should appear that the function is invalid but we don't throw SemanticException

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              abstractdog László Bodor
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: