pushnanashi2 commented on code in PR #25074:
URL: https://github.com/apache/datafusion/pull/25074#discussion_r3960122958
##########
datafusion/optimizer/src/unions_to_filter.rs:
##########
@@ -200,14 +206,22 @@ fn extract_branch(plan: LogicalPlan) ->
Result<Option<UnionBranch>> {
debug!("unions_to_filter skipped: branch contains ORDER BY /
SORT");
Ok(None)
}
- other => Ok(Some(UnionBranch {
- source: strip_passthrough_nodes(other),
- predicate: Expr::Literal(
- datafusion_common::ScalarValue::Boolean(Some(true)),
- None,
- ),
- wrappers,
- })),
+ other => {
+ let Some(source) = strip_passthrough_nodes(other) else {
Review Comment:
Thanks for pointing this out. You're right: after peel_wrappers, other
cannot be a Projection or SubqueryAlias, so strip_passthrough_nodes always
returns Some(other) here. I’ll use other directly as the source and remove the
redundant check and unreachable debug message
--
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]