Github user rxin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15727#discussion_r86077607
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/expressions/Window.scala ---
    @@ -82,6 +82,29 @@ object Window {
        * "current row", while "-1" means the row before the current row, and 
"5" means the fifth row
        * after the current row.
        *
    +   * A row based boundary is based on the position of the row within the 
partition.
    +   * An offset indicates the number of rows above or below the current 
row, the frame for the
    +   * current row starts or ends. For instance, given a row based sliding 
frame with a lower bound
    +   * offset of -1 and a upper bound offset of +2. The frame for row with 
index 5 would range from
    +   * index 4 to index 6.
    +   *
    +   * {{{
    +   *   import org.apache.spark.sql.expressions.Window
    +   *   val df = Seq((1, "a"), (1, "a"), (2, "a"), (1, "b"), (2, "b"), (3, 
"b")).toDF("id", "category")
    +   *   df.withColumn("sum", sum('id) over 
Window.partitionBy('category).orderBy('id).rowsBetween(0,1)).show
    --- End diff --
    
    can you add () to show, i.e. `show()`


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to