You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "niebayes (via GitHub)" <gi...@apache.org> on 2025/03/14 08:57:14 UTC
[I] Bug: reconstruct LogicalPlan::Limit fails due to expressions out of order [datafusion]
niebayes opened a new issue, #15224:
URL: https://github.com/apache/datafusion/issues/15224
### Describe the bug
Say a Limit operator with skip 0 and fetch 5.
Calls `LogicalPlan::expressions` to get the expressions in the Limit operator, and then reconstructs it by feeding those expressions to `LogicalPlan::with_new_exprs`. The reconstructed Limit operator would be skip 5 and fetch 0.
Apparently, the expressions are out of order and the reconstructed Limit operator is not consistent with the original one.
### To Reproduce
The following test would fail.
#[test]
fn test_reconstruct_limit() -> Result<()> {
use datafusion_expr::lit;
let limit = LogicalPlan::Limit(Limit {
skip: Some(Box::new(lit(0))),
fetch: Some(Box::new(lit(5))),
input: Arc::new(LogicalPlan::EmptyRelation(EmptyRelation {
produce_one_row: false,
schema: Schema::empty().to_dfschema_ref()?,
})),
});
let expr = limit.expressions();
let new_limit = limit.with_new_exprs(
expr,
limit.inputs().into_iter().map(|x| x.clone()).collect(),
)?;
assert_eq!(limit, new_limit);
Ok(())
}
### Expected behavior
_No response_
### Additional context
_No response_
--
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: github-unsubscribe@datafusion.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] Bug: reconstruct LogicalPlan::Limit fails due to expressions out of order [datafusion]
Posted by "jonahgao (via GitHub)" <gi...@apache.org>.
jonahgao commented on issue #15224:
URL: https://github.com/apache/datafusion/issues/15224#issuecomment-2724149322
Can't reproduce on the main branch.
```
running 1 test
test logical_plan::plan::tests::test_reconstruct_limit ... ok
```
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] Bug: reconstruct LogicalPlan::Limit fails due to expressions out of order [datafusion]
Posted by "niebayes (via GitHub)" <gi...@apache.org>.
niebayes commented on issue #15224:
URL: https://github.com/apache/datafusion/issues/15224#issuecomment-2724218464
@jonahgao It's proved my codebase is stale. Sorry.
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] Bug: reconstruct LogicalPlan::Limit fails due to expressions out of order [datafusion]
Posted by "niebayes (via GitHub)" <gi...@apache.org>.
niebayes closed issue #15224: Bug: reconstruct LogicalPlan::Limit fails due to expressions out of order
URL: https://github.com/apache/datafusion/issues/15224
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org