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(batch): scan_range should cast literal type to column's type #3470

Merged
merged 4 commits into from
Jun 27, 2022

Conversation

xxchan
Copy link
Member

@xxchan xxchan commented Jun 26, 2022

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

What's changed and what's your intention?

Fix #3452: point get/range scan returns empty results.

The problem is the literal's type mismatches with the column's type. In scan_range.slt, either make user_id BIGINT or add ORDER BY orders_count (which is actually BIGINT) can trigger this problem.

Not sure my cast is idiomatic 🥸 (Maybe a direct cast on Datum is better

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)

@xxchan xxchan requested review from skyzh and fuyufjh June 26, 2022 18:15
@github-actions github-actions bot added the type/fix Bug fix label Jun 26, 2022
@codecov
Copy link

codecov bot commented Jun 26, 2022

Codecov Report

Merging #3470 (0c6aab3) into main (6c84273) will decrease coverage by 0.02%.
The diff coverage is 2.50%.

@@            Coverage Diff             @@
##             main    #3470      +/-   ##
==========================================
- Coverage   74.42%   74.40%   -0.03%     
==========================================
  Files         769      769              
  Lines      107270   107303      +33     
==========================================
+ Hits        79840    79842       +2     
- Misses      27430    27461      +31     
Flag Coverage Δ
rust 74.40% <2.50%> (-0.03%) ⬇️

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

Impacted Files Coverage Δ
src/batch/src/executor/row_seq_scan.rs 15.47% <0.00%> (-3.79%) ⬇️
src/common/src/types/mod.rs 68.00% <100.00%> (ø)
src/frontend/src/expr/utils.rs 99.24% <0.00%> (+0.25%) ⬆️
src/meta/src/manager/id.rs 95.50% <0.00%> (+0.56%) ⬆️

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

@xxchan xxchan requested a review from TennyZhuang June 27, 2022 01:47
.literal();
let lit = LiteralExpression::try_from(bound.value.as_ref().unwrap()).unwrap();

let datum = cast(lit, bound_ty.clone());
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it might be better to store Datum with the correct data type in ScanRange instead of converting it here. 🤔

Copy link
Member Author

@xxchan xxchan Jun 27, 2022

Choose a reason for hiding this comment

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

I agree, but we don't have eval in fe yet? 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, but we don't have eval in fe yet? 🤔

We need one!

Copy link
Contributor

@fuyufjh fuyufjh left a comment

Choose a reason for hiding this comment

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

Approved as a temporary fix.

@xxchan xxchan added the mergify/can-merge Indicates that the PR can be added to the merge queue label Jun 27, 2022
@mergify
Copy link
Contributor

mergify bot commented Jun 27, 2022

Hey @xxchan, this pull request failed to merge and has been dequeued from the merge train. If you believe your PR failed in the merge train because of a flaky test, requeue it by commenting with @mergifyio requeue. More details can be found on the Queue: Embarked in merge train check-run.

@xxchan xxchan mentioned this pull request Jun 27, 2022
7 tasks
@xxchan
Copy link
Member Author

xxchan commented Jun 27, 2022

@Mergifyio requeue

@mergify
Copy link
Contributor

mergify bot commented Jun 27, 2022

requeue

❌ This pull request head commit has not been previously disembarked from queue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mergify/can-merge Indicates that the PR can be added to the merge queue type/fix Bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: filter condition on BatchScan does not work
2 participants