This is an automated email from the ASF dual-hosted git repository.
philo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git
The following commit(s) were added to refs/heads/main by this push:
new 7e495ecda [CORE] Catch more specific exceptions in Gluten plan
validation (#5036)
7e495ecda is described below
commit 7e495ecda4c5b793fa14078d174cddabb3d9873e
Author: PHILO-HE <[email protected]>
AuthorDate: Wed Mar 20 14:02:13 2024 +0800
[CORE] Catch more specific exceptions in Gluten plan validation (#5036)
---
.../scala/io/glutenproject/expression/ExpressionConverter.scala | 3 +++
.../src/main/scala/io/glutenproject/extension/GlutenPlan.scala | 6 +++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git
a/gluten-core/src/main/scala/io/glutenproject/expression/ExpressionConverter.scala
b/gluten-core/src/main/scala/io/glutenproject/expression/ExpressionConverter.scala
index dd9fbed1c..278f40dd8 100644
---
a/gluten-core/src/main/scala/io/glutenproject/expression/ExpressionConverter.scala
+++
b/gluten-core/src/main/scala/io/glutenproject/expression/ExpressionConverter.scala
@@ -83,6 +83,9 @@ object ExpressionConverter extends SQLConfHelper with Logging
{
udf: ScalaUDF,
attributeSeq: Seq[Attribute],
expressionsMap: Map[Class[_], String]): ExpressionTransformer = {
+ if (!udf.udfName.isDefined) {
+ throw new GlutenNotSupportException("UDF name is not found!")
+ }
val substraitExprName = UDFMappings.scalaUDFMap.get(udf.udfName.get)
substraitExprName match {
case Some(name) =>
diff --git
a/gluten-core/src/main/scala/io/glutenproject/extension/GlutenPlan.scala
b/gluten-core/src/main/scala/io/glutenproject/extension/GlutenPlan.scala
index 211dd58df..c86bcdd8e 100644
--- a/gluten-core/src/main/scala/io/glutenproject/extension/GlutenPlan.scala
+++ b/gluten-core/src/main/scala/io/glutenproject/extension/GlutenPlan.scala
@@ -18,6 +18,7 @@ package io.glutenproject.extension
import io.glutenproject.GlutenConfig
import io.glutenproject.backendsapi.BackendsApiManager
+import io.glutenproject.exception.GlutenNotSupportException
import io.glutenproject.expression.TransformerState
import io.glutenproject.substrait.SubstraitContext
import io.glutenproject.substrait.plan.PlanBuilder
@@ -69,7 +70,10 @@ trait GlutenPlan extends SparkPlan with LogLevelUtil {
}
res
} catch {
- case e: Exception =>
+ case e @ (_: GlutenNotSupportException | _:
UnsupportedOperationException) =>
+ if (!e.isInstanceOf[GlutenNotSupportException]) {
+ logDebug(s"This exception may need to be fixed: ${e.getMessage}")
+ }
// FIXME: Use a validation-specific method to catch validation failures
TestStats.addFallBackClassName(this.getClass.toString)
logValidationMessage(s"Validation failed with exception for plan:
$nodeName, due to:", e)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]