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: [SPARK-12320][SQL] throw exception if the numb...
Date Tue, 15 Dec 2015 00:48:30 GMT
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/10293#discussion_r47582896
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/AttributeMap.scala
---
    @@ -26,13 +26,6 @@ object AttributeMap {
       def apply[A](kvs: Seq[(Attribute, A)]): AttributeMap[A] = {
         new AttributeMap(kvs.map(kv => (kv._1.exprId, kv)).toMap)
       }
    -
    -  /** Given a schema, constructs an [[AttributeMap]] from [[Attribute]] to ordinal */
    -  def byIndex(schema: Seq[Attribute]): AttributeMap[Int] = apply(schema.zipWithIndex)
    --- End diff --
    
    The `byIndex` is no longer needed after we removed `unbind` in `ExpressionEncoder`.
    
    The `toIndex` looks unnecessary, we can just access `Attribute` in `schema` by index,
instead of turning it into a map.


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