@@ -34,7 +34,7 @@ class FilterPushdownSuite extends PlanTest {
34
34
object Optimize extends RuleExecutor [LogicalPlan ] {
35
35
36
36
override protected val blacklistedOnceBatches : Set [String ] =
37
- Set (" Push predicate through join by CNF " )
37
+ Set (" Push CNF predicate through join" )
38
38
39
39
val batches =
40
40
Batch (" Subqueries" , Once ,
@@ -45,7 +45,7 @@ class FilterPushdownSuite extends PlanTest {
45
45
BooleanSimplification ,
46
46
PushPredicateThroughJoin ,
47
47
CollapseProject ) ::
48
- Batch (" Push predicate through join by CNF " , Once ,
48
+ Batch (" Push CNF predicate through join" , Once ,
49
49
PushCNFPredicateThroughJoin ) :: Nil
50
50
}
51
51
@@ -1340,26 +1340,6 @@ class FilterPushdownSuite extends PlanTest {
1340
1340
comparePlans(optimized, correctAnswer)
1341
1341
}
1342
1342
1343
- test(" inner join: rewrite to conjunctive normal form avoid generating too many predicates" ) {
1344
- val x = testRelation.subquery(' x )
1345
- val y = testRelation.subquery(' y )
1346
-
1347
- val originalQuery = {
1348
- x.join(y, condition = Some ((" x.b" .attr === " y.b" .attr)
1349
- && (((" x.a" .attr > 3 ) && (" x.a" .attr < 13 ) && (" y.c" .attr <= 5 ))
1350
- || ((" y.a" .attr > 2 ) && (" y.c" .attr < 1 )))))
1351
- }
1352
-
1353
- val optimized = Optimize .execute(originalQuery.analyze)
1354
- val left = testRelation.subquery(' x )
1355
- val right = testRelation.where(' c <= 5 || (' a > 2 && ' c < 1 )).subquery(' y )
1356
- val correctAnswer = left.join(right, condition = Some (" x.b" .attr === " y.b" .attr
1357
- && (((" x.a" .attr > 3 ) && (" x.a" .attr < 13 ) && (" y.c" .attr <= 5 ))
1358
- || ((" y.a" .attr > 2 ) && (" y.c" .attr < 1 ))))).analyze
1359
-
1360
- comparePlans(optimized, correctAnswer)
1361
- }
1362
-
1363
1343
test(s " Disable rewrite to CNF by setting ${SQLConf .MAX_CNF_NODE_COUNT .key}=0 " ) {
1364
1344
val x = testRelation.subquery(' x )
1365
1345
val y = testRelation.subquery(' y )
@@ -1370,14 +1350,14 @@ class FilterPushdownSuite extends PlanTest {
1370
1350
|| ((" y.a" .attr > 2 ) && (" y.c" .attr < 1 )))))
1371
1351
}
1372
1352
1373
- Seq (0 , 10 ).foreach { depth =>
1374
- withSQLConf(SQLConf .MAX_CNF_NODE_COUNT .key -> depth .toString) {
1353
+ Seq (0 , 10 ).foreach { count =>
1354
+ withSQLConf(SQLConf .MAX_CNF_NODE_COUNT .key -> count .toString) {
1375
1355
val optimized = Optimize .execute(originalQuery.analyze)
1376
- val (left, right) = if (depth == 0 ) {
1356
+ val (left, right) = if (count == 0 ) {
1377
1357
(testRelation.subquery(' x ), testRelation.subquery(' y ))
1378
1358
} else {
1379
1359
(testRelation.subquery(' x ),
1380
- testRelation.where(' c <= 5 || ( ' a > 2 && ' c < 1 )).subquery(' y ))
1360
+ testRelation.where(( ' c <= 5 || ' c < 1 ) && ( ' c <= 5 || ' a > 2 )).subquery(' y ))
1381
1361
}
1382
1362
val correctAnswer = left.join(right, condition = Some (" x.b" .attr === " y.b" .attr
1383
1363
&& (((" x.a" .attr > 3 ) && (" x.a" .attr < 13 ) && (" y.c" .attr <= 5 ))
0 commit comments