findepi commented on code in PR #13028:
URL: https://github.com/apache/datafusion/pull/13028#discussion_r1810451330
##########
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?
##########
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>>,
/// Maximum number of rows to fetch,
/// None means fetching all rows
- pub fetch: Option<usize>,
+ pub fetch: Option<Box<Expr>>,
/// The logical plan
pub input: Arc<LogicalPlan>,
}
+/// Different types of skip expression in Limit plan.
+pub enum SkipType {
+ /// The skip expression is a literal value.
+ Literal(usize),
+ /// Currently only supports expressions that can be folded into constants.
+ UnsupportedExpr,
Review Comment:
Limit is a relational operator, so this will always need to be
constant-foldable.
--
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]