diff --git a/gluten-core/src/main/scala/org/apache/gluten/execution/BasicPhysicalOperatorTransformer.scala b/gluten-core/src/main/scala/org/apache/gluten/execution/BasicPhysicalOperatorTransformer.scala index 0b792d52e056..97b4c3a3f807 100644 --- a/gluten-core/src/main/scala/org/apache/gluten/execution/BasicPhysicalOperatorTransformer.scala +++ b/gluten-core/src/main/scala/org/apache/gluten/execution/BasicPhysicalOperatorTransformer.scala @@ -311,15 +311,6 @@ case class ColumnarUnionExec(children: Seq[SparkPlan]) extends SparkPlan with Gl } override protected def doExecuteColumnar(): RDD[ColumnarBatch] = columnarInputRDD - - override protected def doValidateInternal(): ValidationResult = { - BackendsApiManager.getValidatorApiInstance - .doSchemaValidate(schema) - .map { - reason => ValidationResult.notOk(s"Found schema check failure for $schema, due to: $reason") - } - .getOrElse(ValidationResult.ok) - } } /** diff --git a/gluten-core/src/main/scala/org/apache/gluten/execution/ColumnarCoalesceExec.scala b/gluten-core/src/main/scala/org/apache/gluten/execution/ColumnarCoalesceExec.scala index 22285120c124..f40a7f8f07f6 100644 --- a/gluten-core/src/main/scala/org/apache/gluten/execution/ColumnarCoalesceExec.scala +++ b/gluten-core/src/main/scala/org/apache/gluten/execution/ColumnarCoalesceExec.scala @@ -16,8 +16,7 @@ */ package org.apache.gluten.execution -import org.apache.gluten.backendsapi.BackendsApiManager -import org.apache.gluten.extension.{GlutenPlan, ValidationResult} +import org.apache.gluten.extension.GlutenPlan import org.apache.spark.{Partition, SparkContext, TaskContext} import org.apache.spark.rdd.RDD @@ -33,16 +32,6 @@ case class ColumnarCoalesceExec(numPartitions: Int, child: SparkPlan) override def supportsColumnar: Boolean = true - override protected def doValidateInternal(): ValidationResult = { - BackendsApiManager.getValidatorApiInstance - .doSchemaValidate(child.schema) - .map { - reason => - ValidationResult.notOk(s"Found schema check failure for ${child.schema}, due to: $reason") - } - .getOrElse(ValidationResult.ok) - } - override def output: Seq[Attribute] = child.output override def outputPartitioning: Partitioning = { diff --git a/gluten-core/src/main/scala/org/apache/gluten/extension/GlutenPlan.scala b/gluten-core/src/main/scala/org/apache/gluten/extension/GlutenPlan.scala index 8f1004be4aaa..d29b29b0c104 100644 --- a/gluten-core/src/main/scala/org/apache/gluten/extension/GlutenPlan.scala +++ b/gluten-core/src/main/scala/org/apache/gluten/extension/GlutenPlan.scala @@ -65,7 +65,13 @@ trait GlutenPlan extends SparkPlan with Convention.KnownBatchType with LogLevelU final def doValidate(): ValidationResult = { try { TransformerState.enterValidation - val res = doValidateInternal() + val res = BackendsApiManager.getValidatorApiInstance + .doSchemaValidate(schema) + .map { + reason => + ValidationResult.notOk(s"Found schema check failure for $schema, due to: $reason") + } + .getOrElse(doValidateInternal()) if (!res.isValid) { TestStats.addFallBackClassName(this.getClass.toString) } diff --git a/gluten-core/src/main/scala/org/apache/spark/sql/execution/ColumnarBroadcastExchangeExec.scala b/gluten-core/src/main/scala/org/apache/spark/sql/execution/ColumnarBroadcastExchangeExec.scala index 4da7a2f6f11a..d55733fe4e97 100644 --- a/gluten-core/src/main/scala/org/apache/spark/sql/execution/ColumnarBroadcastExchangeExec.scala +++ b/gluten-core/src/main/scala/org/apache/spark/sql/execution/ColumnarBroadcastExchangeExec.scala @@ -17,7 +17,7 @@ package org.apache.spark.sql.execution import org.apache.gluten.backendsapi.BackendsApiManager -import org.apache.gluten.extension.{GlutenPlan, ValidationResult} +import org.apache.gluten.extension.GlutenPlan import org.apache.gluten.metrics.GlutenTimeMetric import org.apache.gluten.sql.shims.SparkShimLoader @@ -133,19 +133,6 @@ case class ColumnarBroadcastExchangeExec(mode: BroadcastMode, child: SparkPlan) ColumnarBroadcastExchangeExec(canonicalized, child.canonicalized) } - override protected def doValidateInternal(): ValidationResult = { - BackendsApiManager.getValidatorApiInstance - .doSchemaValidate(schema) - .map { - reason => - { - ValidationResult.notOk( - s"Unsupported schema in broadcast exchange: $schema, reason: $reason") - } - } - .getOrElse(ValidationResult.ok) - } - override def doPrepare(): Unit = { // Materialize the future. relationFuture