org.apache.spark.sql.expressions
Class Window

Object
  extended by org.apache.spark.sql.expressions.Window

public class Window
extends Object

:: Experimental :: Utility functions for defining window in DataFrames.


   // PARTITION BY country ORDER BY date ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
   Window.partitionBy("country").orderBy("date").rowsBetween(Long.MinValue, 0)

   // PARTITION BY country ORDER BY date ROWS BETWEEN 3 PRECEDING AND 3 FOLLOWING
   Window.partitionBy("country").orderBy("date").rowsBetween(-3, 3)
 

Since:
1.4.0

Method Summary
static WindowSpec orderBy(Column... cols)
          Creates a WindowSpec with the ordering defined.
static WindowSpec orderBy(scala.collection.Seq<Column> cols)
          Creates a WindowSpec with the ordering defined.
static WindowSpec orderBy(String colName, scala.collection.Seq<String> colNames)
          Creates a WindowSpec with the ordering defined.
static WindowSpec orderBy(String colName, String... colNames)
          Creates a WindowSpec with the ordering defined.
static WindowSpec partitionBy(Column... cols)
          Creates a WindowSpec with the partitioning defined.
static WindowSpec partitionBy(scala.collection.Seq<Column> cols)
          Creates a WindowSpec with the partitioning defined.
static WindowSpec partitionBy(String colName, scala.collection.Seq<String> colNames)
          Creates a WindowSpec with the partitioning defined.
static WindowSpec partitionBy(String colName, String... colNames)
          Creates a WindowSpec with the partitioning defined.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

partitionBy

public static WindowSpec partitionBy(String colName,
                                     String... colNames)
Creates a WindowSpec with the partitioning defined.

Parameters:
colName - (undocumented)
colNames - (undocumented)
Returns:
(undocumented)
Since:
1.4.0

partitionBy

public static WindowSpec partitionBy(Column... cols)
Creates a WindowSpec with the partitioning defined.

Parameters:
cols - (undocumented)
Returns:
(undocumented)
Since:
1.4.0

orderBy

public static WindowSpec orderBy(String colName,
                                 String... colNames)
Creates a WindowSpec with the ordering defined.

Parameters:
colName - (undocumented)
colNames - (undocumented)
Returns:
(undocumented)
Since:
1.4.0

orderBy

public static WindowSpec orderBy(Column... cols)
Creates a WindowSpec with the ordering defined.

Parameters:
cols - (undocumented)
Returns:
(undocumented)
Since:
1.4.0

partitionBy

public static WindowSpec partitionBy(String colName,
                                     scala.collection.Seq<String> colNames)
Creates a WindowSpec with the partitioning defined.

Parameters:
colName - (undocumented)
colNames - (undocumented)
Returns:
(undocumented)
Since:
1.4.0

partitionBy

public static WindowSpec partitionBy(scala.collection.Seq<Column> cols)
Creates a WindowSpec with the partitioning defined.

Parameters:
cols - (undocumented)
Returns:
(undocumented)
Since:
1.4.0

orderBy

public static WindowSpec orderBy(String colName,
                                 scala.collection.Seq<String> colNames)
Creates a WindowSpec with the ordering defined.

Parameters:
colName - (undocumented)
colNames - (undocumented)
Returns:
(undocumented)
Since:
1.4.0

orderBy

public static WindowSpec orderBy(scala.collection.Seq<Column> cols)
Creates a WindowSpec with the ordering defined.

Parameters:
cols - (undocumented)
Returns:
(undocumented)
Since:
1.4.0