cloud-fan commented on a change in pull request #34077:
URL: https://github.com/apache/spark/pull/34077#discussion_r714907048
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala
##########
@@ -3532,22 +3509,29 @@ case class ArrayDistinct(child: Expression)
|}
""".stripMargin
- val processArray = withArrayNullAssignment(
- s"$jt $value = ${genGetValue(array, i)};" +
- SQLOpenHashSet.withNaNCheckCode(elementType, value, hashSet, body,
- (valueNaN: String) =>
- s"""
- |$size++;
- |$builder.$$plus$$eq($valueNaN);
- |""".stripMargin))
+ val processArray = SQLOpenHashSet.withNullCheckCode(dataType,
dataType, hashSet,
Review comment:
can we follow the code style of the interpreted code path?
```
val withNaNCheckCodeGenerator = (array: String, index: String) => ...
val processArray = SQLOpenHashSet.withNullCheckCode(..., array =>
withNaNCheckCodeGenerator(array, _), ...)
```
--
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]