Skip to content

Commit

Permalink
SparkArrowbasedOperationSuite adapt Spark-3.1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
cfmcgrady committed Apr 6, 2023
1 parent 573a262 commit c83cf3f
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,12 @@ class SparkArrowbasedOperationSuite extends WithSparkSQLEngine with SparkDataTyp
returnSize.foreach { size =>
val df = spark.sql(s"select * from t_1 limit $size")
val headPlan = df.queryExecution.executedPlan.collectLeaves().head
assert(headPlan.isInstanceOf[AdaptiveSparkPlanExec])
val finalPhysicalPlan =
SparkDatasetHelper.finalPhysicalPlan(headPlan.asInstanceOf[AdaptiveSparkPlanExec])
assert(finalPhysicalPlan.isInstanceOf[CollectLimitExec])
if (SPARK_ENGINE_RUNTIME_VERSION >= "3.2") {
assert(headPlan.isInstanceOf[AdaptiveSparkPlanExec])
val finalPhysicalPlan =
SparkDatasetHelper.finalPhysicalPlan(headPlan.asInstanceOf[AdaptiveSparkPlanExec])
assert(finalPhysicalPlan.isInstanceOf[CollectLimitExec])
}

val arrowBinary = SparkDatasetHelper.executeArrowBatchCollect(df.queryExecution.executedPlan)

Expand Down

0 comments on commit c83cf3f

Please sign in to comment.