Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/16986#discussion_r117835124
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala
---
@@ -652,6 +653,299 @@ case class MapObjects private(
}
}
+object CollectObjectsToMap {
+ private val curId = new java.util.concurrent.atomic.AtomicInteger()
+
+ /**
+ * Construct an instance of CollectObjects case class.
+ *
+ * @param keyFunction The function applied on the key collection
elements.
+ * @param keyInputData An expression that when evaluated returns a key
collection object.
+ * @param keyElementType The data type of key elements in the collection.
+ * @param valueFunction The function applied on the value collection
elements.
+ * @param valueInputData An expression that when evaluated returns a
value collection object.
+ * @param valueElementType The data type of value elements in the
collection.
+ * @param collClass The type of the resulting collection.
+ */
+ def apply(
+ keyFunction: Expression => Expression,
+ keyInputData: Expression,
+ keyElementType: DataType,
+ valueFunction: Expression => Expression,
+ valueInputData: Expression,
+ valueElementType: DataType,
+ collClass: Class[_]): CollectObjectsToMap = {
+ val id = curId.getAndIncrement()
+ val keyLoopValue = s"CollectObjectsToMap_keyLoopValue$id"
+ val keyLoopIsNull = s"CollectObjectsToMap_keyLoopIsNull$id"
--- End diff --
do we need this? the map key can not be null by definition
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]