Skip to content

Commit 4333dce

Browse files
authored
chore: Add safety check to CometBuffer (#1050)
* chore: Add safety check to CometBuffer * Add CometColumnarToRowExec * fix * fix * more * Update plan stability results * fix * fix * fix * Revert "fix" This reverts commit 9bad173. * Revert "Revert "fix"" This reverts commit d527ad1. * fix BucketedReadWithoutHiveSupportSuite * fix SparkPlanSuite
1 parent 2e0f00a commit 4333dce

File tree

830 files changed

+4101
-3761
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

830 files changed

+4101
-3761
lines changed

common/src/main/java/org/apache/comet/parquet/ColumnReader.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -172,28 +172,6 @@ public void close() {
172172

173173
/** Returns a decoded {@link CometDecodedVector Comet vector}. */
174174
public CometDecodedVector loadVector() {
175-
// Only re-use Comet vector iff:
176-
// 1. if we're not using dictionary encoding, since with dictionary encoding, the native
177-
// side may fallback to plain encoding and the underlying memory address for the vector
178-
// will change as result.
179-
// 2. if the column type is of fixed width, in other words, string/binary are not supported
180-
// since the native side may resize the vector and therefore change memory address.
181-
// 3. if the last loaded vector contains null values: if values of last vector are all not
182-
// null, Arrow C data API will skip loading the native validity buffer, therefore we
183-
// should not re-use the vector in that case.
184-
// 4. if the last loaded vector doesn't contain any null value, but the current vector also
185-
// are all not null, which means we can also re-use the loaded vector.
186-
// 5. if the new number of value is the same or smaller
187-
if ((hadNull || currentNumNulls == 0)
188-
&& currentVector != null
189-
&& dictionary == null
190-
&& currentVector.isFixedLength()
191-
&& currentVector.numValues() >= currentNumValues) {
192-
currentVector.setNumNulls(currentNumNulls);
193-
currentVector.setNumValues(currentNumValues);
194-
return currentVector;
195-
}
196-
197175
LOG.debug("Reloading vector");
198176

199177
// Close the previous vector first to release struct memory allocated to import Arrow array &

common/src/main/java/org/apache/comet/parquet/ConstantColumnReader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ public ConstantColumnReader(
5353

5454
public ConstantColumnReader(
5555
DataType type, ColumnDescriptor descriptor, Object value, boolean useDecimal128) {
56-
super(type, descriptor, useDecimal128);
56+
super(type, descriptor, useDecimal128, true);
5757
this.value = value;
5858
}
5959

6060
ConstantColumnReader(
6161
DataType type, ColumnDescriptor descriptor, int batchSize, boolean useDecimal128) {
62-
super(type, descriptor, useDecimal128);
62+
super(type, descriptor, useDecimal128, true);
6363
this.batchSize = batchSize;
6464
initNative();
6565
}

common/src/main/java/org/apache/comet/parquet/MetadataColumnReader.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,14 @@ public class MetadataColumnReader extends AbstractColumnReader {
4040
private ArrowArray array = null;
4141
private ArrowSchema schema = null;
4242

43-
public MetadataColumnReader(DataType type, ColumnDescriptor descriptor, boolean useDecimal128) {
43+
private boolean isConstant;
44+
45+
public MetadataColumnReader(
46+
DataType type, ColumnDescriptor descriptor, boolean useDecimal128, boolean isConstant) {
4447
// TODO: should we handle legacy dates & timestamps for metadata columns?
4548
super(type, descriptor, useDecimal128, false);
49+
50+
this.isConstant = isConstant;
4651
}
4752

4853
@Override
@@ -62,7 +67,7 @@ public void readBatch(int total) {
6267

6368
Native.currentBatch(nativeHandle, arrayAddr, schemaAddr);
6469
FieldVector fieldVector = Data.importVector(allocator, array, schema, null);
65-
vector = new CometPlainVector(fieldVector, useDecimal128);
70+
vector = new CometPlainVector(fieldVector, useDecimal128, false, isConstant);
6671
}
6772

6873
vector.setNumValues(total);

common/src/main/java/org/apache/comet/parquet/RowIndexColumnReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class RowIndexColumnReader extends MetadataColumnReader {
3333
private long offset;
3434

3535
public RowIndexColumnReader(StructField field, int batchSize, long[] indices) {
36-
super(field.dataType(), TypeUtil.convertToParquet(field), false);
36+
super(field.dataType(), TypeUtil.convertToParquet(field), false, false);
3737
this.indices = indices;
3838
setBatchSize(batchSize);
3939
}

common/src/main/java/org/apache/comet/vector/CometPlainVector.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,18 @@ public class CometPlainVector extends CometDecodedVector {
3838
private byte booleanByteCache;
3939
private int booleanByteCacheIndex = -1;
4040

41+
private boolean isReused;
42+
4143
public CometPlainVector(ValueVector vector, boolean useDecimal128) {
4244
this(vector, useDecimal128, false);
4345
}
4446

4547
public CometPlainVector(ValueVector vector, boolean useDecimal128, boolean isUuid) {
48+
this(vector, useDecimal128, isUuid, false);
49+
}
50+
51+
public CometPlainVector(
52+
ValueVector vector, boolean useDecimal128, boolean isUuid, boolean isReused) {
4653
super(vector, vector.getField(), useDecimal128, isUuid);
4754
// NullType doesn't have data buffer.
4855
if (vector instanceof NullVector) {
@@ -52,6 +59,15 @@ public CometPlainVector(ValueVector vector, boolean useDecimal128, boolean isUui
5259
}
5360

5461
isBaseFixedWidthVector = valueVector instanceof BaseFixedWidthVector;
62+
this.isReused = isReused;
63+
}
64+
65+
public boolean isReused() {
66+
return isReused;
67+
}
68+
69+
public void setReused(boolean isReused) {
70+
this.isReused = isReused;
5571
}
5672

5773
@Override

dev/diffs/3.4.3.diff

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/pom.xml b/pom.xml
2-
index d3544881af1..bf0e2b53c70 100644
2+
index d3544881af1..26ab186c65d 100644
33
--- a/pom.xml
44
+++ b/pom.xml
55
@@ -148,6 +148,8 @@
@@ -38,7 +38,7 @@ index d3544881af1..bf0e2b53c70 100644
3838
</dependencyManagement>
3939

4040
diff --git a/sql/core/pom.xml b/sql/core/pom.xml
41-
index b386d135da1..854aec17c2d 100644
41+
index b386d135da1..46449e3f3f1 100644
4242
--- a/sql/core/pom.xml
4343
+++ b/sql/core/pom.xml
4444
@@ -77,6 +77,10 @@
@@ -1284,6 +1284,27 @@ index 47679ed7865..9ffbaecb98e 100644
12841284
}.length == hashAggCount)
12851285
assert(collectWithSubqueries(plan) { case s: SortAggregateExec => s }.length == sortAggCount)
12861286
}
1287+
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlanSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlanSuite.scala
1288+
index b14f4a405f6..88815fd078f 100644
1289+
--- a/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlanSuite.scala
1290+
+++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlanSuite.scala
1291+
@@ -23,6 +23,7 @@ import org.apache.spark.sql.QueryTest
1292+
import org.apache.spark.sql.catalyst.InternalRow
1293+
import org.apache.spark.sql.catalyst.expressions.{Attribute, AttributeReference}
1294+
import org.apache.spark.sql.catalyst.plans.logical.Deduplicate
1295+
+import org.apache.spark.sql.comet.CometColumnarToRowExec
1296+
import org.apache.spark.sql.execution.datasources.v2.BatchScanExec
1297+
import org.apache.spark.sql.internal.SQLConf
1298+
import org.apache.spark.sql.test.SharedSparkSession
1299+
@@ -131,7 +132,7 @@ class SparkPlanSuite extends QueryTest with SharedSparkSession {
1300+
spark.range(1).write.parquet(path.getAbsolutePath)
1301+
val df = spark.read.parquet(path.getAbsolutePath)
1302+
val columnarToRowExec =
1303+
- df.queryExecution.executedPlan.collectFirst { case p: ColumnarToRowExec => p }.get
1304+
+ df.queryExecution.executedPlan.collectFirst { case p: CometColumnarToRowExec => p }.get
1305+
try {
1306+
spark.range(1).foreach { _ =>
1307+
columnarToRowExec.canonicalized
12871308
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/WholeStageCodegenSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/WholeStageCodegenSuite.scala
12881309
index ac710c32296..baae214c6ee 100644
12891310
--- a/sql/core/src/test/scala/org/apache/spark/sql/execution/WholeStageCodegenSuite.scala
@@ -2281,7 +2302,7 @@ index d083cac48ff..3c11bcde807 100644
22812302
import testImplicits._
22822303

22832304
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/sources/BucketedReadSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/sources/BucketedReadSuite.scala
2284-
index 266bb343526..a426d8396be 100644
2305+
index 266bb343526..c3e3d155813 100644
22852306
--- a/sql/core/src/test/scala/org/apache/spark/sql/sources/BucketedReadSuite.scala
22862307
+++ b/sql/core/src/test/scala/org/apache/spark/sql/sources/BucketedReadSuite.scala
22872308
@@ -24,10 +24,11 @@ import org.apache.spark.sql.catalyst.catalog.BucketSpec
@@ -2331,7 +2352,7 @@ index 266bb343526..a426d8396be 100644
23312352

23322353
val bucketColumnType = bucketedDataFrame.schema.apply(bucketColumnIndex).dataType
23332354
val rowsWithInvalidBuckets = fileScan.execute().filter(row => {
2334-
@@ -451,28 +461,44 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils with Adapti
2355+
@@ -451,28 +461,49 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils with Adapti
23352356
val joinOperator = if (joined.sqlContext.conf.adaptiveExecutionEnabled) {
23362357
val executedPlan =
23372358
joined.queryExecution.executedPlan.asInstanceOf[AdaptiveSparkPlanExec].executedPlan
@@ -2357,6 +2378,11 @@ index 266bb343526..a426d8396be 100644
23572378
+ case s: SortMergeJoinExec => s
23582379
+ case o => fail(s"expected SortMergeJoinExec, but found\n$o")
23592380
+ }
2381+
+ case CometColumnarToRowExec(child) =>
2382+
+ child.asInstanceOf[CometSortMergeJoinExec].originalPlan match {
2383+
+ case s: SortMergeJoinExec => s
2384+
+ case o => fail(s"expected SortMergeJoinExec, but found\n$o")
2385+
+ }
23602386
+ case o => fail(s"expected SortMergeJoinExec, but found\n$o")
23612387
+ }
23622388
}
@@ -2384,7 +2410,7 @@ index 266bb343526..a426d8396be 100644
23842410
s"expected sort in the right child to be $sortRight but found\n${joinOperator.right}")
23852411

23862412
// check the output partitioning
2387-
@@ -835,11 +861,11 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils with Adapti
2413+
@@ -835,11 +866,11 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils with Adapti
23882414
df1.write.format("parquet").bucketBy(8, "i").saveAsTable("bucketed_table")
23892415

23902416
val scanDF = spark.table("bucketed_table").select("j")
@@ -2398,7 +2424,7 @@ index 266bb343526..a426d8396be 100644
23982424
checkAnswer(aggDF, df1.groupBy("j").agg(max("k")))
23992425
}
24002426
}
2401-
@@ -1026,15 +1052,23 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils with Adapti
2427+
@@ -1026,15 +1057,23 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils with Adapti
24022428
expectedNumShuffles: Int,
24032429
expectedCoalescedNumBuckets: Option[Int]): Unit = {
24042430
val plan = sql(query).queryExecution.executedPlan

dev/diffs/3.5.1.diff

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/pom.xml b/pom.xml
2-
index 0f504dbee85..f6019da888a 100644
2+
index 0f504dbee85..430ec217e59 100644
33
--- a/pom.xml
44
+++ b/pom.xml
55
@@ -152,6 +152,8 @@
@@ -38,7 +38,7 @@ index 0f504dbee85..f6019da888a 100644
3838
</dependencyManagement>
3939

4040
diff --git a/sql/core/pom.xml b/sql/core/pom.xml
41-
index c46ab7b8fce..d8b99c2c115 100644
41+
index c46ab7b8fce..13357e8c7a6 100644
4242
--- a/sql/core/pom.xml
4343
+++ b/sql/core/pom.xml
4444
@@ -77,6 +77,10 @@
@@ -1309,8 +1309,29 @@ index 47679ed7865..9ffbaecb98e 100644
13091309
}.length == hashAggCount)
13101310
assert(collectWithSubqueries(plan) { case s: SortAggregateExec => s }.length == sortAggCount)
13111311
}
1312+
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlanSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlanSuite.scala
1313+
index b14f4a405f6..88815fd078f 100644
1314+
--- a/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlanSuite.scala
1315+
+++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlanSuite.scala
1316+
@@ -23,6 +23,7 @@ import org.apache.spark.sql.QueryTest
1317+
import org.apache.spark.sql.catalyst.InternalRow
1318+
import org.apache.spark.sql.catalyst.expressions.{Attribute, AttributeReference}
1319+
import org.apache.spark.sql.catalyst.plans.logical.Deduplicate
1320+
+import org.apache.spark.sql.comet.CometColumnarToRowExec
1321+
import org.apache.spark.sql.execution.datasources.v2.BatchScanExec
1322+
import org.apache.spark.sql.internal.SQLConf
1323+
import org.apache.spark.sql.test.SharedSparkSession
1324+
@@ -131,7 +132,7 @@ class SparkPlanSuite extends QueryTest with SharedSparkSession {
1325+
spark.range(1).write.parquet(path.getAbsolutePath)
1326+
val df = spark.read.parquet(path.getAbsolutePath)
1327+
val columnarToRowExec =
1328+
- df.queryExecution.executedPlan.collectFirst { case p: ColumnarToRowExec => p }.get
1329+
+ df.queryExecution.executedPlan.collectFirst { case p: CometColumnarToRowExec => p }.get
1330+
try {
1331+
spark.range(1).foreach { _ =>
1332+
columnarToRowExec.canonicalized
13121333
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/WholeStageCodegenSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/WholeStageCodegenSuite.scala
1313-
index 5a413c77754..c52f4b3818c 100644
1334+
index 5a413c77754..a6f97dccb67 100644
13141335
--- a/sql/core/src/test/scala/org/apache/spark/sql/execution/WholeStageCodegenSuite.scala
13151336
+++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/WholeStageCodegenSuite.scala
13161337
@@ -20,6 +20,7 @@ package org.apache.spark.sql.execution
@@ -2270,7 +2291,7 @@ index d083cac48ff..3c11bcde807 100644
22702291
import testImplicits._
22712292

22722293
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/sources/BucketedReadSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/sources/BucketedReadSuite.scala
2273-
index 746f289c393..1a2f1f7e3fd 100644
2294+
index 746f289c393..0c99d028163 100644
22742295
--- a/sql/core/src/test/scala/org/apache/spark/sql/sources/BucketedReadSuite.scala
22752296
+++ b/sql/core/src/test/scala/org/apache/spark/sql/sources/BucketedReadSuite.scala
22762297
@@ -25,10 +25,11 @@ import org.apache.spark.sql.catalyst.expressions
@@ -2320,7 +2341,7 @@ index 746f289c393..1a2f1f7e3fd 100644
23202341

23212342
val bucketColumnType = bucketedDataFrame.schema.apply(bucketColumnIndex).dataType
23222343
val rowsWithInvalidBuckets = fileScan.execute().filter(row => {
2323-
@@ -452,28 +462,44 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils with Adapti
2344+
@@ -452,28 +462,49 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils with Adapti
23242345
val joinOperator = if (joined.sqlContext.conf.adaptiveExecutionEnabled) {
23252346
val executedPlan =
23262347
joined.queryExecution.executedPlan.asInstanceOf[AdaptiveSparkPlanExec].executedPlan
@@ -2346,6 +2367,11 @@ index 746f289c393..1a2f1f7e3fd 100644
23462367
+ case s: SortMergeJoinExec => s
23472368
+ case o => fail(s"expected SortMergeJoinExec, but found\n$o")
23482369
+ }
2370+
+ case CometColumnarToRowExec(child) =>
2371+
+ child.asInstanceOf[CometSortMergeJoinExec].originalPlan match {
2372+
+ case s: SortMergeJoinExec => s
2373+
+ case o => fail(s"expected SortMergeJoinExec, but found\n$o")
2374+
+ }
23492375
+ case o => fail(s"expected SortMergeJoinExec, but found\n$o")
23502376
+ }
23512377
}
@@ -2373,7 +2399,7 @@ index 746f289c393..1a2f1f7e3fd 100644
23732399
s"expected sort in the right child to be $sortRight but found\n${joinOperator.right}")
23742400

23752401
// check the output partitioning
2376-
@@ -836,11 +862,11 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils with Adapti
2402+
@@ -836,11 +867,11 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils with Adapti
23772403
df1.write.format("parquet").bucketBy(8, "i").saveAsTable("bucketed_table")
23782404

23792405
val scanDF = spark.table("bucketed_table").select("j")
@@ -2387,7 +2413,7 @@ index 746f289c393..1a2f1f7e3fd 100644
23872413
checkAnswer(aggDF, df1.groupBy("j").agg(max("k")))
23882414
}
23892415
}
2390-
@@ -1029,15 +1055,21 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils with Adapti
2416+
@@ -1029,15 +1060,21 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils with Adapti
23912417
Seq(true, false).foreach { aqeEnabled =>
23922418
withSQLConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> aqeEnabled.toString) {
23932419
val plan = sql(query).queryExecution.executedPlan

dev/diffs/4.0.0-preview1.diff

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,6 +1438,27 @@ index 47679ed7865..9ffbaecb98e 100644
14381438
}.length == hashAggCount)
14391439
assert(collectWithSubqueries(plan) { case s: SortAggregateExec => s }.length == sortAggCount)
14401440
}
1441+
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlanSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlanSuite.scala
1442+
index 966f4e74712..a715193d96d 100644
1443+
--- a/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlanSuite.scala
1444+
+++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlanSuite.scala
1445+
@@ -23,6 +23,7 @@ import org.apache.spark.sql.QueryTest
1446+
import org.apache.spark.sql.catalyst.InternalRow
1447+
import org.apache.spark.sql.catalyst.expressions.{Attribute, AttributeReference}
1448+
import org.apache.spark.sql.catalyst.plans.logical.Deduplicate
1449+
+import org.apache.spark.sql.comet.CometColumnarToRowExec
1450+
import org.apache.spark.sql.execution.datasources.v2.BatchScanExec
1451+
import org.apache.spark.sql.internal.SQLConf
1452+
import org.apache.spark.sql.test.SharedSparkSession
1453+
@@ -134,7 +135,7 @@ class SparkPlanSuite extends QueryTest with SharedSparkSession {
1454+
spark.range(1).write.parquet(path.getAbsolutePath)
1455+
val df = spark.read.parquet(path.getAbsolutePath)
1456+
val columnarToRowExec =
1457+
- df.queryExecution.executedPlan.collectFirst { case p: ColumnarToRowExec => p }.get
1458+
+ df.queryExecution.executedPlan.collectFirst { case p: CometColumnarToRowExec => p }.get
1459+
try {
1460+
spark.range(1).foreach { _ =>
1461+
columnarToRowExec.canonicalized
14411462
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/WholeStageCodegenSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/WholeStageCodegenSuite.scala
14421463
index 3aaf61ffba4..4130ece2283 100644
14431464
--- a/sql/core/src/test/scala/org/apache/spark/sql/execution/WholeStageCodegenSuite.scala
@@ -2562,7 +2583,7 @@ index 6ff07449c0c..9f95cff99e5 100644
25622583
import testImplicits._
25632584

25642585
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/sources/BucketedReadSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/sources/BucketedReadSuite.scala
2565-
index 3573bafe482..a21767840a2 100644
2586+
index 3573bafe482..11d387110ea 100644
25662587
--- a/sql/core/src/test/scala/org/apache/spark/sql/sources/BucketedReadSuite.scala
25672588
+++ b/sql/core/src/test/scala/org/apache/spark/sql/sources/BucketedReadSuite.scala
25682589
@@ -25,10 +25,11 @@ import org.apache.spark.sql.catalyst.expressions
@@ -2612,7 +2633,7 @@ index 3573bafe482..a21767840a2 100644
26122633

26132634
val bucketColumnType = bucketedDataFrame.schema.apply(bucketColumnIndex).dataType
26142635
val rowsWithInvalidBuckets = fileScan.execute().filter(row => {
2615-
@@ -452,28 +462,44 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils with Adapti
2636+
@@ -452,28 +462,49 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils with Adapti
26162637
val joinOperator = if (joined.sparkSession.sessionState.conf.adaptiveExecutionEnabled) {
26172638
val executedPlan =
26182639
joined.queryExecution.executedPlan.asInstanceOf[AdaptiveSparkPlanExec].executedPlan
@@ -2638,6 +2659,11 @@ index 3573bafe482..a21767840a2 100644
26382659
+ case s: SortMergeJoinExec => s
26392660
+ case o => fail(s"expected SortMergeJoinExec, but found\n$o")
26402661
+ }
2662+
+ case CometColumnarToRowExec(child) =>
2663+
+ child.asInstanceOf[CometSortMergeJoinExec].originalPlan match {
2664+
+ case s: SortMergeJoinExec => s
2665+
+ case o => fail(s"expected SortMergeJoinExec, but found\n$o")
2666+
+ }
26412667
+ case o => fail(s"expected SortMergeJoinExec, but found\n$o")
26422668
+ }
26432669
}
@@ -2665,7 +2691,7 @@ index 3573bafe482..a21767840a2 100644
26652691
s"expected sort in the right child to be $sortRight but found\n${joinOperator.right}")
26662692

26672693
// check the output partitioning
2668-
@@ -836,11 +862,11 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils with Adapti
2694+
@@ -836,11 +867,11 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils with Adapti
26692695
df1.write.format("parquet").bucketBy(8, "i").saveAsTable("bucketed_table")
26702696

26712697
val scanDF = spark.table("bucketed_table").select("j")
@@ -2679,7 +2705,7 @@ index 3573bafe482..a21767840a2 100644
26792705
checkAnswer(aggDF, df1.groupBy("j").agg(max("k")))
26802706
}
26812707
}
2682-
@@ -1029,15 +1055,21 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils with Adapti
2708+
@@ -1029,15 +1060,21 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils with Adapti
26832709
Seq(true, false).foreach { aqeEnabled =>
26842710
withSQLConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> aqeEnabled.toString) {
26852711
val plan = sql(query).queryExecution.executedPlan

0 commit comments

Comments
 (0)