-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-28797][DOC] Document DROP FUNCTION statement in SQL Reference. #25553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not sound right. We are talking about create in a drop action ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about -
"If specified, no exception is thrown when the function does not exist"
|
@sandeep-katta Hello, could you please update this by following the convention of existing merged PRS. Thanks a lot. |
e254049 to
e90795a
Compare
|
@dilipbiswal can you help me review this please |
|
|
||
| **This page is under construction** | ||
| ### Description | ||
| Dropping a user-defined function(UDF). An exception will be thrown if the function does not exist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DROP FUNCTION statement drops a temporary or user defined function(UDF)
| ### Example | ||
| {% highlight sql %} | ||
| -- Create a permanent function `test_avg` | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete this line ?
| CREATE FUNCTION test_avg as 'org.apache.hadoop.hive.ql.udf.generic.GenericUDAFAverage'; | ||
|
|
||
| -- List user functions | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: delete this line ?
| -- List user functions | ||
|
|
||
| SHOW user functions; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: delete this line ?
|
|
||
| SHOW user functions; | ||
|
|
||
| +-------------------+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Shift this by 2 space to align with other prs.
| -- Drop Permanent function | ||
|
|
||
| DROP FUNCTION test_avg; | ||
| +---------+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Shift this by 2 space to align with other prs.
| CREATE TEMPORARY FUNCTION temp_avg as 'org.apache.hadoop.hive.ql.udf.generic.GenericUDAFAverage'; | ||
|
|
||
| -- Drop Temporary function | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: delete this line.
| -- Drop Temporary function | ||
|
|
||
| DROP TEMPORARY FUNCTION IF EXISTS temp_avg; | ||
| +---------+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Shift this by 2 space to align with other prs.
| | Result | | ||
| +---------+ | ||
| +---------+ | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: delete this line ?
|
LGTM |
|
ok to test |
|
Test build #110628 has finished for PR 25553 at commit
|
| CREATE FUNCTION test_avg as 'org.apache.hadoop.hive.ql.udf.generic.GenericUDAFAverage'; | ||
|
|
||
| -- List user functions | ||
| SHOW user functions; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SHOW user functions; -> SHOW USER FUNCTIONS;?
|
Test build #110734 has finished for PR 25553 at commit
|
|
We need to show the precedence of temp view and table when they share the same name. |
|
Test build #110770 has finished for PR 25553 at commit
|
| | function | | ||
| +-------------------+ | ||
| | default.test_avg | | ||
| | temp_avg | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the functions having the same name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, one with permanent and other with Temporary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gatorsmile The permanent functions are always shown as database qualified where as the temporary functions are not qualified. Oh.. oops :-) one is test_avg and the other is temp_avg.. . @sandeep-katta can you check, please ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Test build #111178 has finished for PR 25553 at commit
|
|
@dilipbiswal @gatorsmile does any more changes are required for this PR ? |
|
|
||
| **This page is under construction** | ||
| ### Description | ||
| `DROP FUNCTION` statement drops a temporary or user defined function(UDF). An exception will be thrown if the function does not exist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Add "The" at the start. Also, space before (UDF). What does 'in the system' mean - can we just drop this or make it more specific?
|
Test build #111739 has finished for PR 25553 at commit
|
|
Test build #111762 has finished for PR 25553 at commit
|
| +-----------+ | ||
| | function | | ||
| +-----------+ | ||
| | temp_avg | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sandeep-katta Why is it temp_avg here ? Shouldn't it be temporary function test_avg ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ping @sandeep-katta to fix that part
| +-----------+ | ||
|
|
||
| -- Drop Temporary function | ||
| DROP TEMPORARY FUNCTION IF EXISTS temp_avg; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sandeep-katta same question :-)
| +-----------+ | ||
| | function | | ||
| +-----------+ | ||
| | temp_avg | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ping @sandeep-katta to fix that part
|
Test build #111895 has finished for PR 25553 at commit
|
|
Merged to master |
### What changes were proposed in this pull request? Add DROP FUNCTION sql description in SQL reference ### Why are the changes needed? Currently from spark there is no complete sql guide is present, so it is better to document all the sql commands, this jira is sub part of this task. ### Does this PR introduce any user-facing change? Yes before user cannot find any reference for drop function command in the spark docs. After Fix:    ### How was this patch tested? tested with jekyll build Closes apache#25553 from sandeep-katta/28797. Authored-by: sandeep katta <[email protected]> Signed-off-by: Sean Owen <[email protected]>

What changes were proposed in this pull request?
Add DROP FUNCTION sql description in SQL reference
Why are the changes needed?
Currently from spark there is no complete sql guide is present, so it is better to document all the sql commands, this jira is sub part of this task.
Does this PR introduce any user-facing change?
Yes before user cannot find any reference for drop function command in the spark docs.
After Fix:

How was this patch tested?
tested with jekyll build