zhztheplayer commented on code in PR #8144:
URL: https://github.com/apache/incubator-gluten/pull/8144#discussion_r1870856378
##########
gluten-substrait/src/main/scala/org/apache/gluten/extension/columnar/enumerated/RasOffload.scala:
##########
@@ -118,21 +119,29 @@ object RasOffload {
// 4. Validate current node. If passed, offload it.
validator.validate(from) match {
case Validator.Passed =>
- val offloadedPlan = base.offload(from)
- val offloadedNodes = offloadedPlan.collect[ValidatablePlan] {
- case t: ValidatablePlan => t
- }
- val outComes =
offloadedNodes.map(_.doValidate()).filter(!_.ok())
- if (outComes.nonEmpty) {
- // 5. If native validation fails on at least one of the
offloaded nodes, return
- // the original one.
- //
- // TODO: Tag the original plan with fallback reason. This is
a non-trivial work
- // in RAS as the query plan we got here may be a copy so
may not propagate tags
- // to original plan.
- from
- } else {
- offloadedPlan
+ try {
+ val offloadedPlan = base.offload(from)
+ val offloadedNodes = offloadedPlan.collect[ValidatablePlan] {
+ case t: ValidatablePlan => t
+ }
+ val outComes =
offloadedNodes.map(_.doValidate()).filter(!_.ok())
+ if (outComes.nonEmpty) {
+ // 5. If native validation fails on at least one of the
offloaded nodes, return
+ // the original one.
+ //
+ // TODO: Tag the original plan with fallback reason. This
is a non-trivial work
+ // in RAS as the query plan we got here may be a copy so
may not propagate tags
+ // to original plan.
+ from
+ } else {
+ offloadedPlan
+ }
+ } catch {
+ case _: GlutenNotSupportException =>
Review Comment:
I see. So in this PR we can shrink the range of the catch block to only
catch `doValidate()` to match legacy planner. Perhaps in future we should make
all exceptions be caught in `doValidate` internally to make `doValidate`
exception-free.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]