calcite icon indicating copy to clipboard operation
calcite copied to clipboard

[CALCITE-6432] Infinite loop for JoinPushTransitivePredicatesRule

Open asdfgh19 opened this issue 1 year ago • 1 comments

jira: CALCITE-6432

Infinite loop for JoinPushTransitivePredicatesRule when there are multiple project expressions reference the same input field.

asdfgh19 avatar Jun 09 '24 03:06 asdfgh19

Due to reformatting github shows the changes as being much larger than they are. Is there a way to make this PR easier to review by preserving the original formatting? Also, some comments would be nice, the code changes are quite subtle.

mihaibudiu avatar Jun 19 '24 17:06 mihaibudiu

what is the status of this PR?

mihaibudiu avatar Aug 14 '24 22:08 mihaibudiu

Due to reformatting github shows the changes as being much larger than they are. Is there a way to make this PR easier to review by preserving the original formatting? Also, some comments would be nice, the code changes are quite subtle.

@mihaibudiu Thank you for your reply and suggestions.

In the original implementation, there is a class ExprsItr, which is used to find all possible predicates based on the Join condition, but it was originally an inner class of JoinConditionBasedPredicateInference; in order to reuse ExprsItr to find all possible situations for Project, I moved ExprsItr to the outside and made it static.

For example, the left input of Join has a predicate $0 + $1 > 10, and the Join condition is $0 = $7 and $1 = $8, ExprsItr can find all possibilities ($0 + $1 > 10, $0 + $8 > 10, $7 + $1 > 10, $7 + $8 > 10); Project is similar, for example, Project expr $0 and $7 both refer to the same input so $0 =$7

asdfgh19 avatar Sep 06 '24 03:09 asdfgh19

This looks like a useful PR, can we make it work? Can you please fix the conflicts first?

mihaibudiu avatar Nov 11 '24 19:11 mihaibudiu

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 90 days if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the [email protected] list. Thank you for your contributions.

github-actions[bot] avatar Dec 12 '24 03:12 github-actions[bot]

Closing in favor of https://github.com/apache/calcite/pull/4346

mihaibudiu avatar Apr 30 '25 00:04 mihaibudiu