@@ -58,7 +58,7 @@ class FilterPushdownSuite extends PlanTest {
58
58
59
59
val testRelation1 = LocalRelation (attrD)
60
60
61
- val simpleDisjuncitvePredicate =
61
+ val simpleDisjunctivePredicate =
62
62
(" x.a" .attr > 3 ) && (" y.a" .attr > 13 ) || (" x.a" .attr > 1 ) && (" y.a" .attr > 11 )
63
63
val expectedCNFPredicatePushDownResult = {
64
64
val left = testRelation.where((' a > 3 || ' a > 1 )).subquery(' x )
@@ -1251,10 +1251,7 @@ class FilterPushdownSuite extends PlanTest {
1251
1251
val x = testRelation.subquery(' x )
1252
1252
val y = testRelation.subquery(' y )
1253
1253
1254
- val originalQuery = {
1255
- x.join(y)
1256
- .where((" x.b" .attr === " y.b" .attr) && (simpleDisjuncitvePredicate))
1257
- }
1254
+ val originalQuery = x.join(y).where((" x.b" .attr === " y.b" .attr) && (simpleDisjunctivePredicate))
1258
1255
1259
1256
val optimized = Optimize .execute(originalQuery.analyze)
1260
1257
comparePlans(optimized, expectedCNFPredicatePushDownResult)
@@ -1264,9 +1261,8 @@ class FilterPushdownSuite extends PlanTest {
1264
1261
val x = testRelation.subquery(' x )
1265
1262
val y = testRelation.subquery(' y )
1266
1263
1267
- val originalQuery = {
1268
- x.join(y, condition = Some ((" x.b" .attr === " y.b" .attr) && (simpleDisjuncitvePredicate)))
1269
- }
1264
+ val originalQuery =
1265
+ x.join(y, condition = Some ((" x.b" .attr === " y.b" .attr) && (simpleDisjunctivePredicate)))
1270
1266
1271
1267
val optimized = Optimize .execute(originalQuery.analyze)
1272
1268
comparePlans(optimized, expectedCNFPredicatePushDownResult)
@@ -1296,11 +1292,10 @@ class FilterPushdownSuite extends PlanTest {
1296
1292
val x = testRelation.subquery(' x )
1297
1293
val y = testRelation.subquery(' y )
1298
1294
1299
- val originalQuery = {
1295
+ val originalQuery =
1300
1296
x.join(y, condition = Some ((" x.b" .attr === " y.b" .attr)
1301
1297
&& Not ((" x.a" .attr > 3 )
1302
1298
&& (" x.a" .attr < 2 || (" y.a" .attr > 13 )) || (" x.a" .attr > 1 ) && (" y.a" .attr > 11 ))))
1303
- }
1304
1299
1305
1300
val optimized = Optimize .execute(originalQuery.analyze)
1306
1301
val left = testRelation.where(' a <= 3 || ' a >= 2 ).subquery(' x )
@@ -1317,10 +1312,9 @@ class FilterPushdownSuite extends PlanTest {
1317
1312
val x = testRelation.subquery(' x )
1318
1313
val y = testRelation.subquery(' y )
1319
1314
1320
- val originalQuery = {
1315
+ val originalQuery =
1321
1316
x.join(y, joinType = LeftOuter , condition = Some ((" x.b" .attr === " y.b" .attr)
1322
- && simpleDisjuncitvePredicate))
1323
- }
1317
+ && simpleDisjunctivePredicate))
1324
1318
1325
1319
val optimized = Optimize .execute(originalQuery.analyze)
1326
1320
val left = testRelation.subquery(' x )
@@ -1337,10 +1331,9 @@ class FilterPushdownSuite extends PlanTest {
1337
1331
val x = testRelation.subquery(' x )
1338
1332
val y = testRelation.subquery(' y )
1339
1333
1340
- val originalQuery = {
1334
+ val originalQuery =
1341
1335
x.join(y, joinType = RightOuter , condition = Some ((" x.b" .attr === " y.b" .attr)
1342
- && simpleDisjuncitvePredicate))
1343
- }
1336
+ && simpleDisjunctivePredicate))
1344
1337
1345
1338
val optimized = Optimize .execute(originalQuery.analyze)
1346
1339
val left = testRelation.where(' a > 3 || ' a > 1 ).subquery(' x )
@@ -1357,10 +1350,9 @@ class FilterPushdownSuite extends PlanTest {
1357
1350
val x = testRelation.subquery(' x )
1358
1351
val y = testRelation.subquery(' y )
1359
1352
1360
- val originalQuery = {
1353
+ val originalQuery =
1361
1354
x.join(y, condition = Some ((" x.b" .attr === " y.b" .attr) && (((" x.a" .attr > 3 ) &&
1362
1355
(" x.a" .attr < 13 ) && (" y.c" .attr <= 5 )) || ((" y.a" .attr > 2 ) && (" y.c" .attr < 1 )))))
1363
- }
1364
1356
1365
1357
val optimized = Optimize .execute(originalQuery.analyze)
1366
1358
val left = testRelation.subquery(' x )
@@ -1376,11 +1368,10 @@ class FilterPushdownSuite extends PlanTest {
1376
1368
val x = testRelation.subquery(' x )
1377
1369
val y = testRelation.subquery(' y )
1378
1370
1379
- val originalQuery = {
1371
+ val originalQuery =
1380
1372
x.join(y, condition = Some ((" x.b" .attr === " y.b" .attr)
1381
1373
&& (((" x.a" .attr > 3 ) && (" x.a" .attr < 13 ) && (" y.c" .attr <= 5 ))
1382
1374
|| ((" y.a" .attr > 2 ) && (" y.c" .attr < 1 )))))
1383
- }
1384
1375
1385
1376
Seq (0 , 10 ).foreach { count =>
1386
1377
withSQLConf(SQLConf .MAX_CNF_NODE_COUNT .key -> count.toString) {
0 commit comments