Skip to content

Commit

Permalink
[DOCS] Fix error: ambiguous reference to overloaded definition
Browse files Browse the repository at this point in the history
## What changes were proposed in this pull request?

`df.groupBy.count()` should be `df.groupBy().count()` , otherwise there is an error :

ambiguous reference to overloaded definition, both method groupBy in class Dataset of type (col1: String, cols: String*) and method groupBy in class Dataset of type (cols: org.apache.spark.sql.Column*)

## How was this patch tested?

```scala
val df = spark.readStream.schema(...).json(...)
val dfCounts = df.groupBy().count()
```

Author: Ziyue Huang <[email protected]>

Closes #18272 from ZiyueHuang/master.

(cherry picked from commit e6eb02d)
Signed-off-by: Sean Owen <[email protected]>
  • Loading branch information
ZiyueHuang authored and srowen committed Jun 12, 2017
1 parent 26003de commit a4d78e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/structured-streaming-programming-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ Some of them are as follows.

In addition, there are some Dataset methods that will not work on streaming Datasets. They are actions that will immediately run queries and return results, which does not make sense on a streaming Dataset. Rather, those functionalities can be done by explicitly starting a streaming query (see the next section regarding that).

- `count()` - Cannot return a single count from a streaming Dataset. Instead, use `ds.groupBy.count()` which returns a streaming Dataset containing a running count.
- `count()` - Cannot return a single count from a streaming Dataset. Instead, use `ds.groupBy().count()` which returns a streaming Dataset containing a running count.

- `foreach()` - Instead use `ds.writeStream.foreach(...)` (see next section).

Expand Down

0 comments on commit a4d78e4

Please sign in to comment.