Skip to content

refactor(bigframes): Make join nullity optimizations more robust#16541

Open
TrevorBergeron wants to merge 3 commits intomainfrom
tbergeron_null_prop_rewriter
Open

refactor(bigframes): Make join nullity optimizations more robust#16541
TrevorBergeron wants to merge 3 commits intomainfrom
tbergeron_null_prop_rewriter

Conversation

@TrevorBergeron
Copy link
Copy Markdown
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a nulls_equal attribute to JoinNode to explicitly handle pandas-style null equality in joins. It includes a new rewrite rule, simplify_join, which optimizes SQL generation by removing unnecessary nullity checks when join columns are non-nullable. The feedback suggests refining the simplify_join logic to be less restrictive by using an and condition for nullability checks, ensuring the optimization is applied more broadly. Additionally, it is recommended to reorder the compiler steps to ensure all join nodes are optimized and to remove an unused import in the new rewrite module.

@TrevorBergeron TrevorBergeron force-pushed the tbergeron_null_prop_rewriter branch from 84eccc4 to 7fd26f9 Compare April 2, 2026 22:14
@TrevorBergeron TrevorBergeron force-pushed the tbergeron_null_prop_rewriter branch from 7fd26f9 to 7f635df Compare April 2, 2026 23:10
@TrevorBergeron TrevorBergeron marked this pull request as ready for review April 3, 2026 20:08
@TrevorBergeron TrevorBergeron requested review from a team as code owners April 3, 2026 20:08
@TrevorBergeron TrevorBergeron requested a review from sycai April 3, 2026 20:08
right_child: BigFrameNode
left_col: ex.DerefOp
indicator_col: identifiers.ColumnId
nulls_equal: bool = True
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you add a comment on what this field means? It's not very obvious to me

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added comment

@TrevorBergeron TrevorBergeron requested a review from sycai April 3, 2026 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants