[ 
https://issues.apache.org/jira/browse/HIVE-26003?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

László Bodor updated HIVE-26003:
--------------------------------
    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. 

{code}
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
{code}

UPDATE: okay, I've just realized there is hive.exec.drop.ignorenonexistent=true 
which causes this
I still don't like this, why don't we ignore nonexistent if we have an "if 
exist"

  was:
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. 

{code}
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
{code}


> DROP FUNCTION silently passes when function doesn't exist
> ---------------------------------------------------------
>
>                 Key: HIVE-26003
>                 URL: https://issues.apache.org/jira/browse/HIVE-26003
>             Project: Hive
>          Issue Type: Bug
>            Reporter: László Bodor
>            Assignee: László Bodor
>            Priority: Major
>
> 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. 
> {code}
> 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
> {code}
> UPDATE: okay, I've just realized there is 
> hive.exec.drop.ignorenonexistent=true which causes this
> I still don't like this, why don't we ignore nonexistent if we have an "if 
> exist"



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to