spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ueshin <...@git.apache.org>
Subject [GitHub] spark pull request #22013: [SPARK-23939][SQL] Add transform_keys function
Date Thu, 09 Aug 2018 06:09:49 GMT
Github user ueshin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22013#discussion_r208811179
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/higherOrderFunctions.scala
---
    @@ -442,3 +442,65 @@ case class ArrayAggregate(
     
       override def prettyName: String = "aggregate"
     }
    +
    +/**
    + * Transform Keys for every entry of the map by applying the transform_keys function.
    + * Returns map with transformed key entries
    + */
    +@ExpressionDescription(
    +  usage = "_FUNC_(expr, func) - Transforms elements in a map using the function.",
    +  examples = """
    +    Examples:
    +      > SELECT _FUNC_(map(array(1, 2, 3), array(1, 2, 3), (k, v) -> k + 1);
    +       map(array(2, 3, 4), array(1, 2, 3))
    +      > SELECT _FUNC_(map(array(1, 2, 3), array(1, 2, 3), (k, v) -> k + v);
    --- End diff --
    
    ditto.


---

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


Mime
View raw message