You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (JIRA)" <ji...@apache.org> on 2019/05/21 04:34:45 UTC
[jira] [Resolved] (SPARK-13611) import Aggregator doesn't work in
Spark Shell
[ https://issues.apache.org/jira/browse/SPARK-13611?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hyukjin Kwon resolved SPARK-13611.
----------------------------------
Resolution: Incomplete
> import Aggregator doesn't work in Spark Shell
> ---------------------------------------------
>
> Key: SPARK-13611
> URL: https://issues.apache.org/jira/browse/SPARK-13611
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Reporter: Wenchen Fan
> Priority: Major
> Labels: bulk-closed
>
> {code}
> scala> import org.apache.spark.sql.expressions.Aggregator
> import org.apache.spark.sql.expressions.Aggregator
> scala> class SumOf[I, N : Numeric](f: I => N) extends Aggregator[I, N, N] with Serializable {
> | val numeric = implicitly[Numeric[N]]
> | override def zero: N = numeric.zero
> | override def reduce(b: N, a: I): N = numeric.plus(b, f(a))
> | override def merge(b1: N,b2: N): N = numeric.plus(b1, b2)
> | override def finish(reduction: N): N = reduction
> | }
> <console>:10: error: not found: type Aggregator
> class SumOf[I, N : Numeric](f: I => N) extends Aggregator[I, N, N] with Serializable {
> ^
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org