marin-ma commented on code in PR #11461:
URL:
https://github.com/apache/incubator-gluten/pull/11461#discussion_r2716622622
##########
backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxSparkPlanExecApi.scala:
##########
@@ -370,7 +370,15 @@ class VeloxSparkPlanExecApi extends SparkPlanExecApi {
val newShuffle = shuffle.outputPartitioning match {
case HashPartitioning(exprs, _) =>
- val hashExpr = new Murmur3Hash(exprs)
+ val hashExpr = if (exprs.isEmpty) {
+ // In Spark, a hash expression with empty input is not resolvable
and an
+ // `WRONG_NUM_ARGS.WITHOUT_SUGGESTION` error will be reported when
validating the project
+ // transformer. So we directly return the seed here, which is the
intended hashed value
+ // for empty input given Spark's murmur3 hash logic.
+ Literal(new Murmur3Hash(Nil).seed, IntegerType)
+ } else {
+ new Murmur3Hash(exprs)
+ }
Review Comment:
Looks good. Thanks!
--
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]