-
Notifications
You must be signed in to change notification settings - Fork 715
fix: hash join behavior change after upgrade datafusion #8325
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
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Summary
This PR fixes a critical logical bug in the remote scan optimizer that emerged after upgrading DataFusion. The primary change involves renaming and inverting the semantic meaning of a boolean flag from is_remote_scan to has_remote_scan. The original flag used true to indicate "should add remote scan" and false for "already has remote scan". The new flag uses false to mean "does not have remote scan" and true for "already has remote scan", making the logic more intuitive.
All condition checks throughout the optimizer were updated accordingly - changing from if visitor.is_remote_scan to if !visitor.has_remote_scan to maintain the same logical behavior. This ensures that remote scan nodes are still properly added to execution plans that don't already have them.
Additionally, the PR adds explicit handling for HashJoinExec nodes, which appears to be necessary due to changes in how DataFusion represents join operations after the upgrade. The new logic iterates through each child of a join operation and wraps those without existing remote scans in RemoteScanExec nodes, preserving distributed query execution capabilities.
A minor cleanup removes the #[allow(dead_code)] attribute from the get_count() method, suggesting this method is now being used elsewhere in the codebase.
Confidence score: 4/5
- This PR addresses critical functionality for distributed query execution with mostly straightforward logic changes
- Score reflects confidence in the semantic inversion logic and new join handling, though DataFusion upgrade impacts could have subtle effects
- Pay close attention to the HashJoinExec handling logic and verify all condition inversions are correct
1 file reviewed, 1 comment
src/service/search/datafusion/optimizer/physical_optimizer/remote_scan.rs
Show resolved
Hide resolved
PR Code Suggestions ✨Explore these optional code suggestions:
|
No description provided.