zjuwangg commented on code in PR #4872:
URL: https://github.com/apache/incubator-gluten/pull/4872#discussion_r1526517788
##########
backends-velox/src/main/scala/io/glutenproject/backendsapi/velox/SparkPlanExecApiImpl.scala:
##########
@@ -232,7 +232,24 @@ class SparkPlanExecApiImpl extends SparkPlanExecApi {
TransformHints.tagNotTransformable(shuffle, validationResult)
shuffle.withNewChildren(newChild :: Nil)
}
-
+ case RoundRobinPartitioning(num) if SQLConf.get.sortBeforeRepartition &&
num > 1 =>
+ val hashExpr = new Murmur3Hash(newChild.output)
+ val projectList = Seq(Alias(hashExpr, "hash_partition_key")()) ++
newChild.output
+ val projectTransformer = ProjectExecTransformer(projectList, newChild)
+ val sortOrder = SortOrder(projectTransformer.output.head, Ascending)
+ val sortByHashCode = SortExecTransformer(Seq(sortOrder), global =
false, projectTransformer)
+ val dropSortColumnTransformer =
ProjectExecTransformer(projectList.drop(1), sortByHashCode)
+ if (dropSortColumnTransformer.doValidate().isValid) {
+ ColumnarShuffleExchangeExec(
+ shuffle,
+ dropSortColumnTransformer,
+ dropSortColumnTransformer.output)
+ } else {
+ TransformHints.tagNotTransformable(
+ shuffle,
+ dropSortColumnTransformer.doValidate().reason.get)
Review Comment:
addressed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]