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

fix(udf): check the data type returned from UDF server #12202

Merged
merged 2 commits into from
Sep 12, 2023

Conversation

wangrunji0408
Copy link
Contributor

@wangrunji0408 wangrunji0408 commented Sep 11, 2023

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

fix #10828

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests (It seems not easy to test it.)
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
@github-actions github-actions bot added the type/fix Bug fix label Sep 11, 2023
@codecov
Copy link

codecov bot commented Sep 11, 2023

Codecov Report

Merging #12202 (25313a2) into main (d0a4984) will decrease coverage by 0.02%.
Report is 1 commits behind head on main.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main   #12202      +/-   ##
==========================================
- Coverage   69.79%   69.78%   -0.02%     
==========================================
  Files        1408     1408              
  Lines      235678   235723      +45     
==========================================
- Hits       164503   164498       -5     
- Misses      71175    71225      +50     
Flag Coverage Δ
rust 69.78% <0.00%> (-0.02%) ⬇️

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

Files Changed Coverage Δ
src/common/src/types/mod.rs 73.65% <0.00%> (-0.37%) ⬇️
src/common/src/types/struct_type.rs 72.16% <0.00%> (-6.49%) ⬇️
src/expr/src/expr/expr_udf.rs 0.00% <0.00%> (ø)
src/expr/src/table_function/user_defined.rs 0.00% <0.00%> (ø)

... and 7 files with indirect coverage changes

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

Copy link
Member

@xxchan xxchan left a comment

Choose a reason for hiding this comment

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

  1. Should we add some tests?
  2. When the error occurs, eval_infallible will call UDF for each row, right? Not sure if it has any problems in this case. I think it’s not a very big deal. 🤔️

src/common/src/types/struct_type.rs Show resolved Hide resolved
@wangrunji0408
Copy link
Contributor Author

wangrunji0408 commented Sep 11, 2023

  1. Should we add some tests?

Yes. But I couldn't think of a way to test this in sqllogictest. 🤔️

  1. When the error occurs, eval_infallible will call UDF for each row, right? Not sure if it has any problems in this case. I think it’s not a very big deal. 🤔️

Yes. I'm also not sure about it. I'll be soon working on fixing #11586. At that time I may put the responsibility of eval_infallible on each function. And for UDF it may simply fill all values to null.

@wangrunji0408 wangrunji0408 added this pull request to the merge queue Sep 12, 2023
Merged via the queue into main with commit faa1bcc Sep 12, 2023
10 of 11 checks passed
@wangrunji0408 wangrunji0408 deleted the wrj/fix-udf-type branch September 12, 2023 08:33
Li0k pushed a commit that referenced this pull request Sep 15, 2023
Signed-off-by: Runji Wang <wangrunji0408@163.com>
wangrunji0408 added a commit that referenced this pull request Sep 18, 2023
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/fix Bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UDF panics if the function signature was modified discreetly.
3 participants