You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/06/10 08:12:43 UTC

[GitHub] [spark] HyukjinKwon commented on a change in pull request #28685: [SPARK-27951][SQL] Support ANSI SQL NTH_VALUE window function

HyukjinKwon commented on a change in pull request #28685:
URL: https://github.com/apache/spark/pull/28685#discussion_r437941258



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/functions.scala
##########
@@ -993,6 +993,30 @@ object functions {
     Lead(e.expr, Literal(offset), Literal(defaultValue))
   }
 
+  /**
+   * Window function: returns the value that is the `offset`th row of the window frame
+   * (counting from 1), and `null` if the size of window frame is less than `offset` rows.
+   *
+   * This is equivalent to the nth_value function in SQL.
+   *
+   * @group window_funcs
+   * @since 3.0.0
+   */
+  def nth_value(columnName: String, offset: Int): Column = {

Review comment:
       @beliefer, how is it different from `leg`?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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