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

refactor(binder): prepare for implicit cast support #3381

Merged
merged 4 commits into from
Jun 21, 2022

Conversation

xiangjinwu
Copy link
Contributor

What's changed and what's your intention?

This PR contains 4 refactors that prepares for implicit cast (preview in #3296).

  • FuncSigMap hides the implementation of HashMap<FuncSign, DataTypeName>. It will be updated to another lookup structure. With this refactoring, the build_type_derive_map with insert calls can be reused.
  • infer_type interface takes input exprs and potentially returns them casted to the matching function's parameters.
  • DataTypeName to DataType mapping extracted
  • cast_ok_base works on DataTypeName rather than DataType.

Checklist

  • I have written necessary docs and 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)

@xiangjinwu xiangjinwu marked this pull request as ready for review June 21, 2022 07:39
@codecov
Copy link

codecov bot commented Jun 21, 2022

Codecov Report

Merging #3381 (43722e6) into main (198bf4f) will decrease coverage by 0.00%.
The diff coverage is 97.29%.

@@            Coverage Diff             @@
##             main    #3381      +/-   ##
==========================================
- Coverage   73.68%   73.68%   -0.01%     
==========================================
  Files         759      759              
  Lines      104111   104104       -7     
==========================================
- Hits        76717    76710       -7     
  Misses      27394    27394              
Flag Coverage Δ
rust 73.68% <97.29%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
src/frontend/src/expr/type_inference/mod.rs 92.30% <88.23%> (-3.15%) ⬇️
src/frontend/src/expr/type_inference/func.rs 99.71% <98.78%> (+0.24%) ⬆️
src/frontend/src/expr/function_call.rs 96.44% <100.00%> (-0.05%) ⬇️
src/frontend/src/expr/type_inference/cast.rs 100.00% <100.00%> (ø)
src/sqlparser/src/ast/mod.rs 88.75% <0.00%> (-0.12%) ⬇️
src/storage/src/hummock/local_version_manager.rs 84.53% <0.00%> (+0.15%) ⬆️
src/meta/src/hummock/mock_hummock_meta_client.rs 41.50% <0.00%> (+0.94%) ⬆️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

Copy link
Contributor

@yezizp2012 yezizp2012 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants