This is an automated email from the ASF dual-hosted git repository.
philo-he pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gluten.git
The following commit(s) were added to refs/heads/main by this push:
new 0b3e8a456a [GLUTEN-12282][VL] Check JoinRel's post-join filter in
native validation (#12315)
0b3e8a456a is described below
commit 0b3e8a456acdc9427655870abd037164a0a01741
Author: Shilong Duan <[email protected]>
AuthorDate: Thu Jun 18 07:12:17 2026 +0800
[GLUTEN-12282][VL] Check JoinRel's post-join filter in native validation
(#12315)
---
.../apache/gluten/execution/FallbackSuite.scala | 22 ++++++++++++++++++++++
.../substrait/SubstraitToVeloxPlanValidator.cc | 3 +++
2 files changed, 25 insertions(+)
diff --git
a/backends-velox/src/test/scala/org/apache/gluten/execution/FallbackSuite.scala
b/backends-velox/src/test/scala/org/apache/gluten/execution/FallbackSuite.scala
index 508980778d..d47d4c85ae 100644
---
a/backends-velox/src/test/scala/org/apache/gluten/execution/FallbackSuite.scala
+++
b/backends-velox/src/test/scala/org/apache/gluten/execution/FallbackSuite.scala
@@ -401,6 +401,28 @@ class FallbackSuite extends
VeloxWholeStageTransformerSuite with AdaptiveSparkPl
}
}
+ test("fallback when join post filter has unsupported expression") {
+ GlutenSuiteUtils.withFallbackEventListener(spark.sparkContext) {
+ events =>
+ val df = spark.sql("""
+ |select tmp1.c1, tmp1.c2 from tmp1
+ |left join tmp2
+ |on tmp1.c1 = tmp2.c1
+ |and tmp1.c2 not rlike
'^[\\u4e00-\\u9fa5]{2,10}[0-9]+$'
+ |""".stripMargin)
+ df.collect()
+ GlutenSuiteUtils.waitUntilEmpty(spark.sparkContext)
+
+ val broadcastHashJoin = find(df.queryExecution.executedPlan) {
+ _.isInstanceOf[BroadcastHashJoinExec]
+ }
+ assert(broadcastHashJoin.isDefined)
+ val fallbackReasons = events.flatMap(_.fallbackNodeToReason.values)
+ assert(fallbackReasons.nonEmpty)
+ assert(fallbackReasons.forall(_.contains("rlike due to Pattern")))
+ }
+ }
+
test("no fallback event emitted for vanilla Spark execution with gluten
disabled") {
// Regression test: before the fix, GlutenQueryExecutionListener would
post a
// GlutenPlanFallbackEvent even when spark.gluten.enabled=false (e.g. the
vanilla baseline run
diff --git a/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc
b/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc
index 9c87b7230c..767af98c76 100644
--- a/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc
+++ b/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc
@@ -1071,6 +1071,9 @@ bool SubstraitToVeloxPlanValidator::validate(const
::substrait::JoinRel& joinRel
}
if (joinRel.has_post_join_filter()) {
+ if (!validateExpression(joinRel.post_join_filter(), rowType)) {
+ return false;
+ }
auto expression = exprConverter_->toVeloxExpr(joinRel.post_join_filter(),
rowType);
exec::ExprSet exprSet({std::move(expression)}, execCtx_.get());
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]