new GroupedData()
- Source:
Methods
agg() → {module:eclairjs/sql.DataFrame}
Compute aggregates by specifying a series of aggregate columns. Note that this function by default retains the grouping columns in its output.
To not retain grouping columns, set spark.sql.retainGroupColumns to false.
The available aggregate methods are defined in functions.
Parameters:
Name | Type | Description |
---|---|---|
columnExpr,...columnExpr |
module:eclairjs/sql.Column | string | or columnName, ...columnName |
- Since:
- EclairJS 0.1 Spark 1.3.0
- Source:
Returns:
Example
df.groupBy("department").agg(max("age"), sum("expense"));
avg(cols) → {module:eclairjs/sql.DataFrame}
Compute the avg value for each numeric columns for each group.
Parameters:
Name | Type | Description |
---|---|---|
cols |
Array.<string> |
- Source:
Returns:
count() → {module:eclairjs/sql.DataFrame}
Count the number of rows for each group.
- Source:
Returns:
max(cols) → {module:eclairjs/sql.DataFrame}
Compute the max value for each numeric columns for each group.
Parameters:
Name | Type | Description |
---|---|---|
cols |
Array.<string> |
- Source:
Returns:
mean(cols) → {module:eclairjs/sql.DataFrame}
Compute the mean value for each numeric columns for each group.
Parameters:
Name | Type | Description |
---|---|---|
cols |
Array.<string> |
- Source:
Returns:
min(cols) → {module:eclairjs/sql.DataFrame}
Compute the min value for each numeric columns for each group.
Parameters:
Name | Type | Description |
---|---|---|
cols |
Array.<string> |
- Source:
Returns:
sum(cols) → {module:eclairjs/sql.DataFrame}
Compute the sum value for each numeric columns for each group.
Parameters:
Name | Type | Description |
---|---|---|
cols |
Array.<string> |
- Source: