Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuqi-lucas committed Jan 23, 2025
1 parent d3969a2 commit dbb20ee
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
1 change: 0 additions & 1 deletion datafusion/physical-optimizer/src/limit_pushdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ pub fn pushdown_limit_helper(
}
} else {
// Add fetch or a `LimitExec`:

// If the plan's children have limit, we shouldn't change the global state to true,
// because the children limit will be overridden if the global state is changed.
if pushdown_plan.children().iter().any(|child| {
Expand Down
11 changes: 0 additions & 11 deletions datafusion/physical-plan/src/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ pub struct MemoryExec {
cache: PlanProperties,
/// if partition sizes should be displayed
show_sizes: bool,
/// it is a flag used by limit pushdown logic, but we don't use limit value until now
limit: Option<usize>,
}

impl fmt::Debug for MemoryExec {
Expand Down Expand Up @@ -168,13 +166,6 @@ impl ExecutionPlan for MemoryExec {
self.projection.clone(),
))
}

/// This logic is used by limit pushdown, but we don't use limit until now
fn with_fetch(&self, limit: Option<usize>) -> Option<Arc<dyn ExecutionPlan>> {
let mut new_self = self.clone();
new_self.limit = limit;
Some(Arc::new(new_self))
}
}

impl MemoryExec {
Expand All @@ -201,7 +192,6 @@ impl MemoryExec {
sort_information: vec![],
cache,
show_sizes: true,
limit: None,
})
}

Expand Down Expand Up @@ -297,7 +287,6 @@ impl MemoryExec {
sort_information: vec![],
cache,
show_sizes: true,
limit: None,
})
}

Expand Down
20 changes: 13 additions & 7 deletions datafusion/sqllogictest/test_files/joins.slt
Original file line number Diff line number Diff line change
Expand Up @@ -4225,7 +4225,7 @@ query IIIIB
SELECT * FROM t0 FULL JOIN t1 ON t0.c2 >= t1.c2 LIMIT 2;
----
2 2 2 2 true
3 3 2 2 true
2 2 2 2 false

query IIIIB
SELECT * FROM t0 FULL JOIN t1 ON t0.c1 = t1.c1 AND t0.c2 >= t1.c2 LIMIT 2;
Expand All @@ -4247,8 +4247,10 @@ logical_plan
physical_plan
01)CoalesceBatchesExec: target_batch_size=3, fetch=2
02)--HashJoinExec: mode=CollectLeft, join_type=Full, on=[(c1@0, c1@0)]
03)----MemoryExec: partitions=1, partition_sizes=[1]
04)----MemoryExec: partitions=1, partition_sizes=[1]
03)----GlobalLimitExec: skip=0, fetch=2
04)------MemoryExec: partitions=1, partition_sizes=[1]
05)----GlobalLimitExec: skip=0, fetch=2
06)------MemoryExec: partitions=1, partition_sizes=[1]

## Test join.on.is_empty() && join.filter.is_some()
query TT
Expand All @@ -4264,8 +4266,10 @@ logical_plan
physical_plan
01)GlobalLimitExec: skip=0, fetch=2
02)--NestedLoopJoinExec: join_type=Full, filter=c2@0 >= c2@1
03)----MemoryExec: partitions=1, partition_sizes=[1]
04)----MemoryExec: partitions=1, partition_sizes=[1]
03)----GlobalLimitExec: skip=0, fetch=2
04)------MemoryExec: partitions=1, partition_sizes=[1]
05)----GlobalLimitExec: skip=0, fetch=2
06)------MemoryExec: partitions=1, partition_sizes=[1]

## Test !join.on.is_empty() && join.filter.is_some()
query TT
Expand All @@ -4281,8 +4285,10 @@ logical_plan
physical_plan
01)CoalesceBatchesExec: target_batch_size=3, fetch=2
02)--HashJoinExec: mode=CollectLeft, join_type=Full, on=[(c1@0, c1@0)], filter=c2@0 >= c2@1
03)----MemoryExec: partitions=1, partition_sizes=[1]
04)----MemoryExec: partitions=1, partition_sizes=[1]
03)----GlobalLimitExec: skip=0, fetch=2
04)------MemoryExec: partitions=1, partition_sizes=[1]
05)----GlobalLimitExec: skip=0, fetch=2
06)------MemoryExec: partitions=1, partition_sizes=[1]

# Test Utf8View as Join Key
# Issue: https://github.com/apache/datafusion/issues/12468
Expand Down

0 comments on commit dbb20ee

Please sign in to comment.