diff --git a/gluten-ut/spark32/src/test/scala/org/apache/spark/sql/extension/CustomerColumnarPreRules.scala b/gluten-ut/spark32/src/test/scala/org/apache/spark/sql/extension/CustomerColumnarPreRules.scala index fe37da206a56..2ee1573ea07a 100644 --- a/gluten-ut/spark32/src/test/scala/org/apache/spark/sql/extension/CustomerColumnarPreRules.scala +++ b/gluten-ut/spark32/src/test/scala/org/apache/spark/sql/extension/CustomerColumnarPreRules.scala @@ -35,7 +35,7 @@ case class CustomerColumnarPreRules(session: SparkSession) extends Rule[SparkPla fileSourceScan.tableIdentifier, fileSourceScan.disableBucketedScan ) - if (transformer.doValidate().isValid) { + if (transformer.doValidate().ok()) { transformer } else { plan diff --git a/gluten-ut/spark33/src/test/scala/org/apache/spark/sql/execution/FallbackStrategiesSuite.scala b/gluten-ut/spark33/src/test/scala/org/apache/spark/sql/execution/FallbackStrategiesSuite.scala index b9c9d8a270bf..54d7596b602c 100644 --- a/gluten-ut/spark33/src/test/scala/org/apache/spark/sql/execution/FallbackStrategiesSuite.scala +++ b/gluten-ut/spark33/src/test/scala/org/apache/spark/sql/execution/FallbackStrategiesSuite.scala @@ -19,7 +19,7 @@ package org.apache.spark.sql.execution import org.apache.gluten.backendsapi.BackendsApiManager import org.apache.gluten.execution.BasicScanExecTransformer import org.apache.gluten.extension.GlutenPlan -import org.apache.gluten.extension.columnar.{FallbackEmptySchemaRelation, FallbackTags, TRANSFORM_UNSUPPORTED} +import org.apache.gluten.extension.columnar.{FallbackEmptySchemaRelation, FallbackTags} import org.apache.gluten.extension.columnar.heuristic.HeuristicApplier import org.apache.gluten.extension.columnar.transition.InsertTransitions import org.apache.gluten.utils.QueryPlanSelector @@ -124,17 +124,16 @@ class FallbackStrategiesSuite extends GlutenSQLTestsTrait { testGluten("Tag not transformable more than once") { val originalPlan = UnaryOp1(LeafOp(supportsColumnar = true)) - FallbackTags.tag(originalPlan, TRANSFORM_UNSUPPORTED(Some("fake reason"))) + FallbackTags.add(originalPlan, "fake reason") val rule = FallbackEmptySchemaRelation() val newPlan = rule.apply(originalPlan) - val reason = FallbackTags.getTag(newPlan).asInstanceOf[TRANSFORM_UNSUPPORTED].reason - assert(reason.isDefined) + val reason = FallbackTags.get(newPlan).reason() if (BackendsApiManager.getSettings.fallbackOnEmptySchema(newPlan)) { assert( - reason.get.contains("fake reason") && - reason.get.contains("at least one of its children has empty output")) + reason.contains("fake reason") && + reason.contains("at least one of its children has empty output")) } else { - assert(reason.get.contains("fake reason")) + assert(reason.contains("fake reason")) } } diff --git a/gluten-ut/spark33/src/test/scala/org/apache/spark/sql/extension/CustomerColumnarPreRules.scala b/gluten-ut/spark33/src/test/scala/org/apache/spark/sql/extension/CustomerColumnarPreRules.scala index fe37da206a56..2ee1573ea07a 100644 --- a/gluten-ut/spark33/src/test/scala/org/apache/spark/sql/extension/CustomerColumnarPreRules.scala +++ b/gluten-ut/spark33/src/test/scala/org/apache/spark/sql/extension/CustomerColumnarPreRules.scala @@ -35,7 +35,7 @@ case class CustomerColumnarPreRules(session: SparkSession) extends Rule[SparkPla fileSourceScan.tableIdentifier, fileSourceScan.disableBucketedScan ) - if (transformer.doValidate().isValid) { + if (transformer.doValidate().ok()) { transformer } else { plan diff --git a/gluten-ut/spark34/src/test/scala/org/apache/spark/sql/execution/FallbackStrategiesSuite.scala b/gluten-ut/spark34/src/test/scala/org/apache/spark/sql/execution/FallbackStrategiesSuite.scala index 8ce0af8df051..5150a4768851 100644 --- a/gluten-ut/spark34/src/test/scala/org/apache/spark/sql/execution/FallbackStrategiesSuite.scala +++ b/gluten-ut/spark34/src/test/scala/org/apache/spark/sql/execution/FallbackStrategiesSuite.scala @@ -19,7 +19,7 @@ package org.apache.spark.sql.execution import org.apache.gluten.backendsapi.BackendsApiManager import org.apache.gluten.execution.BasicScanExecTransformer import org.apache.gluten.extension.GlutenPlan -import org.apache.gluten.extension.columnar.{FallbackEmptySchemaRelation, FallbackTags, TRANSFORM_UNSUPPORTED} +import org.apache.gluten.extension.columnar.{FallbackEmptySchemaRelation, FallbackTags} import org.apache.gluten.extension.columnar.heuristic.HeuristicApplier import org.apache.gluten.extension.columnar.transition.InsertTransitions import org.apache.gluten.utils.QueryPlanSelector @@ -125,17 +125,16 @@ class FallbackStrategiesSuite extends GlutenSQLTestsTrait { testGluten("Tag not transformable more than once") { val originalPlan = UnaryOp1(LeafOp(supportsColumnar = true)) - FallbackTags.tag(originalPlan, TRANSFORM_UNSUPPORTED(Some("fake reason"))) + FallbackTags.add(originalPlan, "fake reason") val rule = FallbackEmptySchemaRelation() val newPlan = rule.apply(originalPlan) - val reason = FallbackTags.getTag(newPlan).asInstanceOf[TRANSFORM_UNSUPPORTED].reason - assert(reason.isDefined) + val reason = FallbackTags.get(newPlan).reason() if (BackendsApiManager.getSettings.fallbackOnEmptySchema(newPlan)) { assert( - reason.get.contains("fake reason") && - reason.get.contains("at least one of its children has empty output")) + reason.contains("fake reason") && + reason.contains("at least one of its children has empty output")) } else { - assert(reason.get.contains("fake reason")) + assert(reason.contains("fake reason")) } } diff --git a/gluten-ut/spark34/src/test/scala/org/apache/spark/sql/extension/CustomerColumnarPreRules.scala b/gluten-ut/spark34/src/test/scala/org/apache/spark/sql/extension/CustomerColumnarPreRules.scala index fe37da206a56..2ee1573ea07a 100644 --- a/gluten-ut/spark34/src/test/scala/org/apache/spark/sql/extension/CustomerColumnarPreRules.scala +++ b/gluten-ut/spark34/src/test/scala/org/apache/spark/sql/extension/CustomerColumnarPreRules.scala @@ -35,7 +35,7 @@ case class CustomerColumnarPreRules(session: SparkSession) extends Rule[SparkPla fileSourceScan.tableIdentifier, fileSourceScan.disableBucketedScan ) - if (transformer.doValidate().isValid) { + if (transformer.doValidate().ok()) { transformer } else { plan diff --git a/gluten-ut/spark35/src/test/scala/org/apache/spark/sql/execution/FallbackStrategiesSuite.scala b/gluten-ut/spark35/src/test/scala/org/apache/spark/sql/execution/FallbackStrategiesSuite.scala index 8ce0af8df051..5150a4768851 100644 --- a/gluten-ut/spark35/src/test/scala/org/apache/spark/sql/execution/FallbackStrategiesSuite.scala +++ b/gluten-ut/spark35/src/test/scala/org/apache/spark/sql/execution/FallbackStrategiesSuite.scala @@ -19,7 +19,7 @@ package org.apache.spark.sql.execution import org.apache.gluten.backendsapi.BackendsApiManager import org.apache.gluten.execution.BasicScanExecTransformer import org.apache.gluten.extension.GlutenPlan -import org.apache.gluten.extension.columnar.{FallbackEmptySchemaRelation, FallbackTags, TRANSFORM_UNSUPPORTED} +import org.apache.gluten.extension.columnar.{FallbackEmptySchemaRelation, FallbackTags} import org.apache.gluten.extension.columnar.heuristic.HeuristicApplier import org.apache.gluten.extension.columnar.transition.InsertTransitions import org.apache.gluten.utils.QueryPlanSelector @@ -125,17 +125,16 @@ class FallbackStrategiesSuite extends GlutenSQLTestsTrait { testGluten("Tag not transformable more than once") { val originalPlan = UnaryOp1(LeafOp(supportsColumnar = true)) - FallbackTags.tag(originalPlan, TRANSFORM_UNSUPPORTED(Some("fake reason"))) + FallbackTags.add(originalPlan, "fake reason") val rule = FallbackEmptySchemaRelation() val newPlan = rule.apply(originalPlan) - val reason = FallbackTags.getTag(newPlan).asInstanceOf[TRANSFORM_UNSUPPORTED].reason - assert(reason.isDefined) + val reason = FallbackTags.get(newPlan).reason() if (BackendsApiManager.getSettings.fallbackOnEmptySchema(newPlan)) { assert( - reason.get.contains("fake reason") && - reason.get.contains("at least one of its children has empty output")) + reason.contains("fake reason") && + reason.contains("at least one of its children has empty output")) } else { - assert(reason.get.contains("fake reason")) + assert(reason.contains("fake reason")) } } diff --git a/gluten-ut/spark35/src/test/scala/org/apache/spark/sql/extension/CustomerColumnarPreRules.scala b/gluten-ut/spark35/src/test/scala/org/apache/spark/sql/extension/CustomerColumnarPreRules.scala index fe37da206a56..2ee1573ea07a 100644 --- a/gluten-ut/spark35/src/test/scala/org/apache/spark/sql/extension/CustomerColumnarPreRules.scala +++ b/gluten-ut/spark35/src/test/scala/org/apache/spark/sql/extension/CustomerColumnarPreRules.scala @@ -35,7 +35,7 @@ case class CustomerColumnarPreRules(session: SparkSession) extends Rule[SparkPla fileSourceScan.tableIdentifier, fileSourceScan.disableBucketedScan ) - if (transformer.doValidate().isValid) { + if (transformer.doValidate().ok()) { transformer } else { plan