Skip to content

Commit

Permalink
[VL] Use collect_list aggregate function in velox (apache#5285)
Browse files Browse the repository at this point in the history
  • Loading branch information
liujiayi771 authored and guihuawen committed Apr 9, 2024
1 parent 8ec0e30 commit c54b559
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions cpp/velox/substrait/SubstraitParser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,7 @@ std::unordered_map<std::string, std::string> SubstraitParser::substraitVeloxFunc
{"murmur3hash", "hash_with_seed"},
{"modulus", "remainder"},
{"date_format", "format_datetime"},
{"collect_set", "set_agg"},
{"collect_list", "array_agg"}};
{"collect_set", "set_agg"}};

const std::unordered_map<std::string, std::string> SubstraitParser::typeMap_ = {
{"bool", "BOOLEAN"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import org.apache.gluten.backendsapi.BackendsApiManager
import org.apache.gluten.utils.PullOutProjectHelper

import org.apache.spark.sql.catalyst.expressions.{And, Attribute, AttributeSet, If, IsNotNull, IsNull, Literal, NamedExpression}
import org.apache.spark.sql.catalyst.expressions.aggregate.{AggregateExpression, CollectList, CollectSet, Complete, Final, Partial}
import org.apache.spark.sql.catalyst.expressions.aggregate.{AggregateExpression, CollectSet, Complete, Final, Partial}
import org.apache.spark.sql.catalyst.rules.Rule
import org.apache.spark.sql.execution.SparkPlan
import org.apache.spark.sql.execution.aggregate.BaseAggregateExec
Expand Down Expand Up @@ -53,7 +53,7 @@ object RewriteCollect extends Rule[SparkPlan] with PullOutProjectHelper {

private def shouldReplaceNullToEmptyArray(ae: AggregateExpression): Boolean = {
ae.aggregateFunction match {
case _: CollectSet | _: CollectList =>
case _: CollectSet =>
ae.mode match {
case Final | Complete => true
case _ => false
Expand Down

0 comments on commit c54b559

Please sign in to comment.