Dandandan opened a new pull request, #27636: URL: https://github.com/apache/datafusion/pull/27636
## Rationale for this change An intermediate inner join can appear too large to broadcast even when one input is unique on the join key and the estimated opposite input is small. Choosing a partitioned hash join then adds an exchange. ## What changes are included in this PR? Use a declared single-column unique or primary key on either input of an ordinary equality lookup to bound the estimated intermediate rows. For fixed-width projections, use the estimate as an additional way to satisfy both existing single-partition thresholds. Include an allowance for row validity and hash table entries. ## What is the testing strategy for this PR? A physical optimizer regression supplies a pessimistic intermediate estimate and checks the outer join distribution with and without the uniqueness constraint. Benchmark coverage depends on the source exposing that constraint. Plain Parquet inputs can therefore retain their original plans. ## Are there any user-facing changes? The optimizer can collect the build side of eligible joins. The existing byte and row thresholds control this decision. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
