jonahgao commented on code in PR #13028:
URL: https://github.com/apache/datafusion/pull/13028#discussion_r1810490001
##########
datafusion/expr/src/logical_plan/plan.rs:
##########
@@ -2799,14 +2817,71 @@ impl PartialOrd for Extension {
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Hash)]
pub struct Limit {
/// Number of rows to skip before fetch
- pub skip: usize,
+ pub skip: Option<Box<Expr>>,
Review Comment:
> What are the constraints on the expression that can be used here? For
example, can it have any column references?
I think it can be any integer expression, and can also contain column
references. Both PostgreSQL and DuckDB support `select 1 limit (select
max(col0) from t)`.
```sh
v1.1.1-dev319 af39bd0dcf
D create table t as values(1);
D select 1 limit (select max(col0) from t);
┌───────┐
│ 1 │
│ int32 │
├───────┤
│ 1 │
└───────┘
```
--
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]