|
17 | 17 |
|
18 | 18 | //! [`EliminateCrossJoin`] converts `CROSS JOIN` to `INNER JOIN` if join predicates are available.
|
19 | 19 | use crate::{OptimizerConfig, OptimizerRule};
|
20 |
| -use recursive::recursive; |
21 | 20 | use std::sync::Arc;
|
22 | 21 |
|
23 | 22 | use crate::join_key_set::JoinKeySet;
|
@@ -80,7 +79,7 @@ impl OptimizerRule for EliminateCrossJoin {
|
80 | 79 | true
|
81 | 80 | }
|
82 | 81 |
|
83 |
| - #[recursive] |
| 82 | + #[cfg_attr(feature = "recursive-protection", recursive::recursive)] |
84 | 83 | fn rewrite(
|
85 | 84 | &self,
|
86 | 85 | plan: LogicalPlan,
|
@@ -651,7 +650,7 @@ mod tests {
|
651 | 650 | " Inner Join: t1.a = t2.a [a:UInt32, b:UInt32, c:UInt32, a:UInt32, b:UInt32, c:UInt32, a:UInt32, b:UInt32, c:UInt32]",
|
652 | 651 | " Inner Join: t1.a = t3.a [a:UInt32, b:UInt32, c:UInt32, a:UInt32, b:UInt32, c:UInt32]",
|
653 | 652 | " TableScan: t1 [a:UInt32, b:UInt32, c:UInt32]",
|
654 |
| - " TableScan: t3 [a:UInt32, b:UInt32, c:UInt32]", |
| 653 | + " TableScan: t3 [a:UInt32, b:UInt32, c:UInt32]", |
655 | 654 | " TableScan: t2 [a:UInt32, b:UInt32, c:UInt32]"
|
656 | 655 | ];
|
657 | 656 |
|
@@ -1237,10 +1236,10 @@ mod tests {
|
1237 | 1236 | .build()?;
|
1238 | 1237 |
|
1239 | 1238 | let expected = vec![
|
1240 |
| - "Filter: t1.a + UInt32(100) = t2.a * UInt32(2) OR t2.b = t1.a [a:UInt32, b:UInt32, c:UInt32, a:UInt32, b:UInt32, c:UInt32]", |
1241 |
| - " Cross Join: [a:UInt32, b:UInt32, c:UInt32, a:UInt32, b:UInt32, c:UInt32]", |
1242 |
| - " TableScan: t1 [a:UInt32, b:UInt32, c:UInt32]", |
1243 |
| - " TableScan: t2 [a:UInt32, b:UInt32, c:UInt32]", |
| 1239 | + "Filter: t1.a + UInt32(100) = t2.a * UInt32(2) OR t2.b = t1.a [a:UInt32, b:UInt32, c:UInt32, a:UInt32, b:UInt32, c:UInt32]", |
| 1240 | + " Cross Join: [a:UInt32, b:UInt32, c:UInt32, a:UInt32, b:UInt32, c:UInt32]", |
| 1241 | + " TableScan: t1 [a:UInt32, b:UInt32, c:UInt32]", |
| 1242 | + " TableScan: t2 [a:UInt32, b:UInt32, c:UInt32]", |
1244 | 1243 | ];
|
1245 | 1244 |
|
1246 | 1245 | assert_optimized_plan_eq(plan, expected);
|
@@ -1293,10 +1292,10 @@ mod tests {
|
1293 | 1292 | .build()?;
|
1294 | 1293 |
|
1295 | 1294 | let expected = vec![
|
1296 |
| - "Filter: t2.c < UInt32(15) OR t2.c = UInt32(688) [a:UInt32, b:UInt32, c:UInt32, a:UInt32, b:UInt32, c:UInt32]", |
1297 |
| - " Inner Join: t1.a + UInt32(100) = t2.a * UInt32(2) [a:UInt32, b:UInt32, c:UInt32, a:UInt32, b:UInt32, c:UInt32]", |
1298 |
| - " TableScan: t1 [a:UInt32, b:UInt32, c:UInt32]", |
1299 |
| - " TableScan: t2 [a:UInt32, b:UInt32, c:UInt32]", |
| 1295 | + "Filter: t2.c < UInt32(15) OR t2.c = UInt32(688) [a:UInt32, b:UInt32, c:UInt32, a:UInt32, b:UInt32, c:UInt32]", |
| 1296 | + " Inner Join: t1.a + UInt32(100) = t2.a * UInt32(2) [a:UInt32, b:UInt32, c:UInt32, a:UInt32, b:UInt32, c:UInt32]", |
| 1297 | + " TableScan: t1 [a:UInt32, b:UInt32, c:UInt32]", |
| 1298 | + " TableScan: t2 [a:UInt32, b:UInt32, c:UInt32]", |
1300 | 1299 | ];
|
1301 | 1300 |
|
1302 | 1301 | assert_optimized_plan_eq(plan, expected);
|
|
0 commit comments