Skip to content

Commit aac7119

Browse files
committed
Merge branch 'groupby-retain' of github.com:rxin/spark into groupby-retain
2 parents f6858f6 + 5f923c0 commit aac7119

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

R/pkg/R/group.R

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,7 @@ setMethod("agg",
102102
}
103103
}
104104
jcols <- lapply(cols, function(c) { c@jc })
105-
# the GroupedData.agg(col, cols*) API does not contain grouping Column
106-
sdf <- callJStatic("org.apache.spark.sql.api.r.SQLUtils", "aggWithGrouping",
107-
x@sgd, listToSeq(jcols))
105+
sdf <- callJMethod(x@sgd, "agg", jcols[[1]], listToSeq(jcols[-1]))
108106
} else {
109107
stop("agg can only support Column or character")
110108
}

sql/core/src/main/scala/org/apache/spark/sql/api/r/SQLUtils.scala

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,6 @@ private[r] object SQLUtils {
7272
sqlContext.createDataFrame(rowRDD, schema)
7373
}
7474

75-
// A helper to include grouping columns in Agg()
76-
def aggWithGrouping(gd: GroupedData, exprs: Column*): DataFrame = {
77-
val aggExprs = exprs.map { col =>
78-
col.expr match {
79-
case expr: NamedExpression => expr
80-
case expr: Expression => Alias(expr, expr.simpleString)()
81-
}
82-
}
83-
gd.toDF(aggExprs)
84-
}
85-
8675
def dfToRowRDD(df: DataFrame): JavaRDD[Array[Byte]] = {
8776
df.map(r => rowToRBytes(r))
8877
}

0 commit comments

Comments
 (0)