Skip to content
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

feat(frontend): support basic CREATE / DROP FUNCTION #7265

Merged
merged 16 commits into from
Jan 9, 2023

Conversation

wangrunji0408
Copy link
Contributor

@wangrunji0408 wangrunji0408 commented Jan 9, 2023

I hereby agree to the terms of the Singularity Data, Inc. Contributor License Agreement.

What's changed and what's your intention?

This PR adds necessary code to frontend to support basic CREATE FUNCTION and DROP FUNCTION statement.

The supported syntax of CREATE FUNCTION is a subset of postgres':

create function func(int, int) returns int as 'http://localhost:8815' language arrow_flight;

This PR only stores the given information in catalog. They will be used to connect the external function service in the future.

At last, since I'm new to the frontend and not familar with the code, please feel free to point out anything I have missed. Thanks! 🥹

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • All checks passed in ./risedev check (or alias, ./risedev c)

Refer to a related PR or issue link (optional)

Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Copy link
Contributor

@chenzl25 chenzl25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! This PR establishes the basic logic of creating and dropping functions.

Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
@codecov
Copy link

codecov bot commented Jan 9, 2023

Codecov Report

Merging #7265 (6868c61) into main (53e33b5) will decrease coverage by 0.17%.
The diff coverage is 15.03%.

@@            Coverage Diff             @@
##             main    #7265      +/-   ##
==========================================
- Coverage   73.19%   73.02%   -0.18%     
==========================================
  Files        1058     1063       +5     
  Lines      169375   169707     +332     
==========================================
- Hits       123980   123921      -59     
- Misses      45395    45786     +391     
Flag Coverage Δ
rust 73.02% <15.03%> (-0.18%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/common/common_service/src/observer_manager.rs 43.56% <ø> (ø)
src/common/src/catalog/mod.rs 58.25% <0.00%> (-13.18%) ⬇️
src/common/src/types/mod.rs 72.46% <0.00%> (-0.24%) ⬇️
src/expr/src/expr/expr_udf.rs 0.00% <0.00%> (ø)
src/expr/src/expr/mod.rs 41.07% <0.00%> (-0.75%) ⬇️
src/frontend/src/catalog/catalog_service.rs 6.06% <0.00%> (-0.40%) ⬇️
src/frontend/src/catalog/function_catalog.rs 0.00% <0.00%> (ø)
src/frontend/src/catalog/mod.rs 75.00% <ø> (ø)
src/frontend/src/expr/expr_mutator.rs 52.08% <0.00%> (-8.90%) ⬇️
src/frontend/src/expr/expr_rewriter.rs 52.22% <0.00%> (-5.81%) ⬇️
... and 32 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Signed-off-by: Runji Wang <wangrunji0408@163.com>
@mergify mergify bot merged commit 6638c09 into main Jan 9, 2023
@mergify mergify bot deleted the wrj/frontend-create-function branch January 9, 2023 09:59
stdrc pushed a commit that referenced this pull request Jan 9, 2023
This PR adds necessary code to frontend to support basic `CREATE FUNCTION` and `DROP FUNCTION` statement.

The supported syntax of `CREATE FUNCTION` is a subset of [postgres](https://www.postgresql.org/docs/current/sql-createfunction.html)':
```sql
create function func(int, int) returns int as 'http://localhost:8815' language arrow_flight;
```

This PR only stores the given information in catalog. They will be used to connect the external function service in the future.

At last, since I'm new to the frontend and not familar with the code, please feel free to point out anything I have missed. Thanks! 🥹

Approved-By: chenzl25
@neverchanje neverchanje added the user-facing-changes Contains changes that are visible to users label May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature user-facing-changes Contains changes that are visible to users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants