spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mn-mikke <...@git.apache.org>
Subject [GitHub] spark pull request #21121: [SPARK-24042][SQL] Collection function: zip_with_...
Date Sun, 22 Apr 2018 22:01:27 GMT
Github user mn-mikke commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21121#discussion_r183253226
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala
---
    @@ -883,3 +884,140 @@ case class Concat(children: Seq[Expression]) extends Expression
{
     
       override def sql: String = s"concat(${children.map(_.sql).mkString(", ")})"
     }
    +
    +/**
    + * Returns the maximum value in the array.
    + */
    +// scalastyle:off line.size.limit
    +@ExpressionDescription(
    +  usage = "_FUNC_(array[, indexFirst]) - Transforms the input array by encapsulating
elements into pairs with indexes indicating the order.",
    --- End diff --
    
    That's really good question! The newly added functions `element_at` and `array_position`
are 1-based. But on the other handed, the `getItem` from the `Column` class is 0-based. What
about adding one extra parameter and let users decide whether the array will indexed from
0 or 1. 


---

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


Mime
View raw message