Skip to content

Conversation

@chenkovsky
Copy link
Contributor

@chenkovsky chenkovsky commented Apr 12, 2025

Which issue does this PR close?

Rationale for this change

There are two issues.

  1. projection in scan table is dropped in try_transform_to_simple_table_scan_with_filters
  2. projection in selectbuilder can only be setted once. it's ok if there's a projection plan outside, but for dataframe api or optimized logical plan. it's not always true. for join, we need to add selected expressions from left plan, and selected expressions from right plan.

What changes are included in this PR?

  1. add projection in try_transform_to_simple_table_scan_with_filters
  2. enable setting projection in selectbuilder twice for join logical plan.

Are these changes tested?

UT

Are there any user-facing changes?

No

@chenkovsky chenkovsky marked this pull request as ready for review April 12, 2025 14:56
@github-actions github-actions bot added the sql SQL Planner label Apr 12, 2025
@goldmedal goldmedal self-requested a review April 14, 2025 01:41
Copy link
Contributor

@goldmedal goldmedal left a comment

Choose a reason for hiding this comment

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

Thanks @chenkovsky. The change and the testing look good to me. I only have some minor comments.

@goldmedal goldmedal merged commit ac7156f into apache:main Apr 16, 2025
27 checks passed
@goldmedal
Copy link
Contributor

Thanks @chenkovsky

nirnayroy pushed a commit to nirnayroy/datafusion that referenced this pull request May 2, 2025
* fix: unparse join without projection * update based on goldmedal's suggestion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sql SQL Planner

2 participants