You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by cloud-fan <gi...@git.apache.org> on 2017/03/16 00:11:27 UTC

[GitHub] spark pull request #16541: [SPARK-19088][SQL] Optimize sequence type deseria...

Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16541#discussion_r106313293
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala ---
    @@ -589,6 +590,170 @@ case class MapObjects private(
       }
     }
     
    +object CollectObjects {
    +  private val curId = new java.util.concurrent.atomic.AtomicInteger()
    +
    +  /**
    +   * Construct an instance of CollectObjects case class.
    +   *
    +   * @param function The function applied on the collection elements.
    +   * @param inputData An expression that when evaluated returns a collection object.
    +   * @param elementType The data type of elements in the collection.
    +   * @param collClass The type of the resulting collection.
    +   */
    +  def apply(
    +             function: Expression => Expression,
    +             inputData: Expression,
    +             elementType: DataType,
    +             collClass: Class[_]): CollectObjects = {
    +    val loopValue = "CollectObjects_loopValue" + curId.getAndIncrement()
    +    val loopIsNull = "CollectObjects_loopIsNull" + curId.getAndIncrement()
    +    val loopVar = LambdaVariable(loopValue, loopIsNull, elementType)
    +    val builderValue = "CollectObjects_builderValue" + curId.getAndIncrement()
    --- End diff --
    
    all these 3 variable names can use the same curId


---
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