This is an automated email from the ASF dual-hosted git repository.
exmy 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 31a02a2941 [GLUTEN-9631][CH] Fix: AggregateDescriptor.parameters is
not set in AggregateGroupLimitRelParser (#9632)
31a02a2941 is described below
commit 31a02a294131fc506e7aa6e85d9d153b218672a1
Author: lgbo <[email protected]>
AuthorDate: Thu May 15 10:51:21 2025 +0800
[GLUTEN-9631][CH] Fix: AggregateDescriptor.parameters is not set in
AggregateGroupLimitRelParser (#9632)
---
.../org/apache/gluten/backendsapi/clickhouse/CHBackend.scala | 12 ++++--------
.../apache/gluten/extension/ConvertWindowToAggregate.scala | 6 +++++-
.../local-engine/Parser/RelParsers/GroupLimitRelParser.cpp | 2 +-
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git
a/backends-clickhouse/src/main/scala/org/apache/gluten/backendsapi/clickhouse/CHBackend.scala
b/backends-clickhouse/src/main/scala/org/apache/gluten/backendsapi/clickhouse/CHBackend.scala
index 64fd6155d5..ef83c80339 100644
---
a/backends-clickhouse/src/main/scala/org/apache/gluten/backendsapi/clickhouse/CHBackend.scala
+++
b/backends-clickhouse/src/main/scala/org/apache/gluten/backendsapi/clickhouse/CHBackend.scala
@@ -166,6 +166,10 @@ object CHBackendSettings extends BackendSettingsApi with
Logging {
val GLUTEN_ELIMINATE_DEDUPLICATE_AGGREGATE_WITH_ANY_JOIN: String =
CHConfig.prefixOf("eliminate_deduplicate_aggregate_with_any_join")
+ // If the partition keys are high cardinality, the aggregation method is
slower.
+ val GLUTEN_ENABLE_WINDOW_GROUP_LIMIT_TO_AGGREGATE: String =
+
CHConfig.prefixOf("runtime_settings.enable_window_group_limit_to_aggregate")
+
def affinityMode: String = {
SparkEnv.get.conf
.get(
@@ -397,14 +401,6 @@ object CHBackendSettings extends BackendSettingsApi with
Logging {
)
}
- // If the partition keys are high cardinality, the aggregation method is
slower.
- def enableConvertWindowGroupLimitToAggregate(): Boolean = {
- SparkEnv.get.conf.getBoolean(
- CHConfig.runtimeConfig("enable_window_group_limit_to_aggregate"),
- defaultValue = true
- )
- }
-
def enableReplaceFromJsonWithGetJsonObject(): Boolean = {
SparkEnv.get.conf.getBoolean(
CHConfig.runtimeConfig("enable_replace_from_json_with_get_json_object"),
diff --git
a/backends-clickhouse/src/main/scala/org/apache/gluten/extension/ConvertWindowToAggregate.scala
b/backends-clickhouse/src/main/scala/org/apache/gluten/extension/ConvertWindowToAggregate.scala
index ad2b22ba6c..d41778345c 100644
---
a/backends-clickhouse/src/main/scala/org/apache/gluten/extension/ConvertWindowToAggregate.scala
+++
b/backends-clickhouse/src/main/scala/org/apache/gluten/extension/ConvertWindowToAggregate.scala
@@ -36,7 +36,11 @@ case class ConverRowNumbertWindowToAggregateRule(spark:
SparkSession)
with Logging {
override def apply(plan: SparkPlan): SparkPlan = {
- if (!CHBackendSettings.enableConvertWindowGroupLimitToAggregate) {
+ if (
+ !spark.conf
+ .get(CHBackendSettings.GLUTEN_ENABLE_WINDOW_GROUP_LIMIT_TO_AGGREGATE,
"true")
+ .toBoolean
+ ) {
return plan
}
plan.transformUp {
diff --git a/cpp-ch/local-engine/Parser/RelParsers/GroupLimitRelParser.cpp
b/cpp-ch/local-engine/Parser/RelParsers/GroupLimitRelParser.cpp
index 468a9a26f5..f7f3829f89 100644
--- a/cpp-ch/local-engine/Parser/RelParsers/GroupLimitRelParser.cpp
+++ b/cpp-ch/local-engine/Parser/RelParsers/GroupLimitRelParser.cpp
@@ -331,7 +331,7 @@ DB::AggregateDescription
AggregateGroupLimitRelParser::buildAggregateDescription
DB::AggregateDescription agg_desc;
agg_desc.column_name = aggregate_tuple_column_name;
agg_desc.argument_names = {aggregate_tuple_column_name};
- DB::Array parameters;
+ auto & parameters = agg_desc.parameters;
parameters.push_back(static_cast<UInt32>(limit));
auto sort_directions = buildSQLLikeSortDescription(input_header,
win_rel_def->sorts());
parameters.push_back(sort_directions);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]