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(expr): fix casting rules for struct #7202

Merged
merged 3 commits into from
Jan 5, 2023
Merged

fix(expr): fix casting rules for struct #7202

merged 3 commits into from
Jan 5, 2023

Conversation

kwannoel
Copy link
Contributor

@kwannoel kwannoel commented Jan 5, 2023

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

What's changed and what's your intention?

Fix row type alignment. As mentioned by @xiangjinwu here:

It is due to the fact that we do not allow casting between the same type, so the 2nd field fails to match interval to interval 😂

Thanks to @xiangjinwu for pointing out the quick fix.

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)

Documentation

If your pull request contains user-facing changes, please specify the types of the changes, and create a release note. Otherwise, please feel free to remove this section.

Types of user-facing changes

Please keep the types that apply to your changes, and remove those that do not apply.

  • Installation and deployment
  • Connector (sources & sinks)
  • SQL commands, functions, and operators
  • RisingWave cluster configuration changes
  • Other (please specify in the release note below)

Release note

Please create a release note for your changes. In the release note, focus on the impact on users, and mention the environment or conditions where the impact may occur.

Refer to a related PR or issue link (optional)

Closes #7189

@kwannoel kwannoel changed the title fix row type alignment fix(expr): fix casting rules for struct Jan 5, 2023
@codecov
Copy link

codecov bot commented Jan 5, 2023

Codecov Report

Merging #7202 (4afbe2d) into main (80abae3) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #7202      +/-   ##
==========================================
+ Coverage   73.13%   73.14%   +0.01%     
==========================================
  Files        1055     1055              
  Lines      168781   168781              
==========================================
+ Hits       123430   123454      +24     
+ Misses      45351    45327      -24     
Flag Coverage Δ
rust 73.14% <100.00%> (+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/cast.rs 94.97% <100.00%> (+4.56%) ⬆️
src/storage/src/hummock/compactor/sstable_store.rs 74.54% <0.00%> (-0.91%) ⬇️
src/meta/src/hummock/mock_hummock_meta_client.rs 65.26% <0.00%> (-0.53%) ⬇️
src/object_store/src/object/mem.rs 87.12% <0.00%> (-0.38%) ⬇️
src/storage/src/hummock/compactor/iterator.rs 98.02% <0.00%> (-0.29%) ⬇️
src/meta/src/hummock/manager/mod.rs 79.39% <0.00%> (-0.06%) ⬇️
src/frontend/src/binder/select.rs 88.92% <0.00%> (+0.32%) ⬆️
src/frontend/src/expr/function_call.rs 87.82% <0.00%> (+7.82%) ⬆️

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

@kwannoel kwannoel marked this pull request as ready for review January 5, 2023 05:04
@kwannoel kwannoel requested review from xiangjinwu and BugenZhao and removed request for xiangjinwu January 5, 2023 05:04
Copy link
Contributor

@xiangjinwu xiangjinwu left a comment

Choose a reason for hiding this comment

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

Maybe also add to planner test, where we can see the computed common type and inserted cast.

@mergify mergify bot merged commit 77534a9 into main Jan 5, 2023
@mergify mergify bot deleted the kwannoel/fix-7189 branch January 5, 2023 06:41
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.

bug(binder): wrong type inference for struct with multiple fields in CASE expression
2 participants