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 a bug that shuffle on expression cause wrong result #14060

Merged
merged 2 commits into from
Jan 8, 2024

Conversation

badboynt1
Copy link
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #https://github.com/matrixorigin/MO-Cloud/issues/2220

What this PR does / why we need it:

do not support shuffle on expression for now.

@matrix-meow matrix-meow added the size/S Denotes a PR that changes [10,99] lines label Jan 8, 2024
@mergify mergify bot requested a review from sukki37 January 8, 2024 10:16
@mergify mergify bot added the kind/bug Something isn't working label Jan 8, 2024
@matrix-meow
Copy link
Contributor

@badboynt1 Thanks for your contributions!

Review:

Title: fix a bug that shuffle on expression cause wrong result

Body: The PR is marked as a bug fix. It addresses an issue where shuffle on expression is not supported and causes incorrect results. The PR aims to fix this bug.

Changes:

  1. In the GetHashColumn function, the code has been modified to handle the case where the expression is of type *plan.Expr_F. Previously, the code would recursively check the arguments of the expression to find the hash column. However, in this PR, the code has been updated to return nil and -1 to indicate that shuffle on expression is not supported for now.

  2. In the determinShuffleForJoin function, the code has been modified to handle the case where the condition expression is of type *plan.Expr_F. Previously, the code would directly pass the condition expression to the GetHashColumn function. However, in this PR, the code has been updated to extract the first argument of the condition expression and pass it to the GetHashColumn function.

Overall, the changes in this PR address the bug where shuffle on expression is not supported and causes incorrect results. The code has been modified to return appropriate values when shuffle on expression is encountered.

Suggestions:

  1. It would be helpful to provide more context in the PR body about why shuffle on expression is not supported and any plans for future improvements. This can help other developers understand the reasoning behind the changes and any potential future work that may be needed.

  2. Consider adding comments to the code to explain the changes made and the reasoning behind them. This can make the code more understandable and maintainable for future developers.

  3. Consider adding test cases to cover the scenario where shuffle on expression is encountered. This can help ensure that the bug is fixed and prevent regressions in the future.

  4. It would be beneficial to optimize the code by finding a way to support shuffle on expression in the future. This can improve the functionality of the code and provide more flexibility to users.

Security Issues: No security issues were identified in this pull request.

@mergify mergify bot merged commit 3ac9acb into matrixorigin:1.1-dev Jan 8, 2024
16 of 18 checks passed
@badboynt1 badboynt1 deleted the shuffle1.1 branch January 9, 2024 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working size/S Denotes a PR that changes [10,99] lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants