wiedld opened a new pull request, #9685: URL: https://github.com/apache/arrow-datafusion/pull/9685
## Which issue does this PR close? Closes #9678 ## Rationale for this change After the TreeNode refactor, the [common_subexpr_eliminate was producing an error](https://github.com/apache/arrow-datafusion/issues/9678) in a very specific use case. First commit is the reproducer of this issue. It was specifically occurring with short-circuited expressions. It occurred in case/when expressions (without an alias), and coalesce (but only when also used with an alias?). ## What changes are included in this PR? Second commit is a proposed fix; although I'm soliciting feedback for what is the proper fix. The stack of visited nodes was not populated for common expressions that were short-circuited. The change made in the TreeNode refactor did two things: * returned after `self.pop_enter_mark()` without populating the visited stack * no longer detecting the unpopulated stack, but the removal of the panic `unreachable!("Enter mark should paired with node number")` ## Are these changes tested? Yes. First commit has reproducer tests. ## Are there any user-facing changes? No API changes. Only removes a bug in query execution. -- 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]
