cloud-fan commented on code in PR #52153:
URL: https://github.com/apache/spark/pull/52153#discussion_r2317702183
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/ShuffleExchangeExec.scala:
##########
@@ -399,6 +403,10 @@ object ShuffleExchangeExec {
case SinglePartition => identity
case KeyGroupedPartitioning(expressions, _, _, _) =>
row => bindReferences(expressions, outputAttributes).map(_.eval(row))
+ case s: ShufflePartitionIdPassThrough =>
+ // For ShufflePartitionIdPassThrough, the expression directly
evaluates to the partition ID
+ val projection = UnsafeProjection.create(s.partitionIdExpression ::
Nil, outputAttributes)
+ row => projection(row).getInt(0)
Review Comment:
let's leave a commet here: if the value is null, `getInt` returns 0.
--
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]