From 1be2e5bc6d906f1d0a0f08cea741471994799ad9 Mon Sep 17 00:00:00 2001 From: "wangguangxin.cn" Date: Wed, 11 Dec 2024 12:58:28 +0800 Subject: [PATCH] Support collect_set in window --- .../gluten/execution/VeloxWindowExpressionSuite.scala | 7 ++----- cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc | 10 ---------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/backends-velox/src/test/scala/org/apache/gluten/execution/VeloxWindowExpressionSuite.scala b/backends-velox/src/test/scala/org/apache/gluten/execution/VeloxWindowExpressionSuite.scala index 6ae7f392a7c8..fe4e94338dc6 100644 --- a/backends-velox/src/test/scala/org/apache/gluten/execution/VeloxWindowExpressionSuite.scala +++ b/backends-velox/src/test/scala/org/apache/gluten/execution/VeloxWindowExpressionSuite.scala @@ -18,7 +18,6 @@ package org.apache.gluten.execution import org.apache.spark.SparkConf import org.apache.spark.sql.Row -import org.apache.spark.sql.execution.window.WindowExec import org.apache.spark.sql.types._ class VeloxWindowExpressionSuite extends WholeStageTransformerSuite { @@ -134,11 +133,9 @@ class VeloxWindowExpressionSuite extends WholeStageTransformerSuite { |FROM | t |ORDER BY 1, 2; - |""".stripMargin, - noFallBack = false + |""".stripMargin ) { - // Velox window doesn't support collect_set - checkSparkOperatorMatch[WindowExec] + checkGlutenOperatorMatch[WindowExecTransformer] } } } diff --git a/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc b/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc index 153db7097002..2f10932ae6e4 100644 --- a/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc +++ b/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc @@ -661,16 +661,6 @@ bool SubstraitToVeloxPlanValidator::validate(const ::substrait::WindowRel& windo } } - // Validate supported aggregate functions. - static const std::unordered_set unsupportedFuncs = {"collect_set"}; - for (const auto& funcSpec : funcSpecs) { - auto funcName = SubstraitParser::getNameBeforeDelimiter(funcSpec); - if (unsupportedFuncs.find(funcName) != unsupportedFuncs.end()) { - LOG_VALIDATION_MSG(funcName + " was not supported in WindowRel."); - return false; - } - } - // Validate groupby expression const auto& groupByExprs = windowRel.partition_expressions(); std::vector expressions;