You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gluten.apache.org by ho...@apache.org on 2024/10/28 03:14:06 UTC

(incubator-gluten) branch main updated: [GLUTEN-7661][VL] Fix missing validation for native IfThen expr

This is an automated email from the ASF dual-hosted git repository.

hongze 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 190e9b4b5e [GLUTEN-7661][VL] Fix missing validation for native IfThen expr
190e9b4b5e is described below

commit 190e9b4b5e7982f36892ba12204539d37fa098a0
Author: Zhen Wang <64...@qq.com>
AuthorDate: Mon Oct 28 11:14:01 2024 +0800

    [GLUTEN-7661][VL] Fix missing validation for native IfThen expr
---
 cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc b/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc
index 2709fcda1d..3b74caf8ba 100644
--- a/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc
+++ b/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc
@@ -288,7 +288,12 @@ bool SubstraitToVeloxPlanValidator::validateIfThen(
     const ::substrait::Expression_IfThen& ifThen,
     const RowTypePtr& inputType) {
   for (const auto& subIfThen : ifThen.ifs()) {
-    return validateExpression(subIfThen.if_(), inputType) && validateExpression(subIfThen.then(), inputType);
+    if (!validateExpression(subIfThen.if_(), inputType) || !validateExpression(subIfThen.then(), inputType)) {
+      return false;
+    }
+  }
+  if (ifThen.has_else_() && !validateExpression(ifThen.else_(), inputType)) {
+    return false;
   }
   return true;
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org