Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update
  • Loading branch information
sigmod committed May 5, 2021
commit 564d8fb2189f9bfc6db658f312dc593442e07223
Original file line number Diff line number Diff line change
Expand Up @@ -2053,7 +2053,7 @@ object OptimizeLimitZero extends Rule[LogicalPlan] {
LocalRelation(plan.output, data = Seq.empty, isStreaming = plan.isStreaming)

def apply(plan: LogicalPlan): LogicalPlan = plan.transformUpWithPruning(
_.containsPattern(LIMIT)) {
_.containsAllPatterns(LIMIT, LITERAL)) {
// Nodes below GlobalLimit or LocalLimit can be pruned if the limit value is zero (0).
// Any subtree in the logical plan that has GlobalLimit 0 or LocalLimit 0 as its root is
// semantically equivalent to an empty relation.
Expand Down