spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cloud-fan <...@git.apache.org>
Subject [GitHub] spark pull request #16986: [SPARK-18891][SQL] Support for Scala Map collecti...
Date Mon, 22 May 2017 20:14:35 GMT
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message