Commit a182864
committed
[SPARK-52513] Add a streaming word count example with rolling event logs
### What changes were proposed in this pull request?
This PR aims to add a streaming word count example, `org.apache.spark.examples.streaming.HdfsWordCount`.
In addition, this example will show a event log rolling feature which is enabled by default in Apache Spark 4.0.0.
```yaml
spark.eventLog.enabled: "true"
spark.eventLog.dir: "s3a://spark-events/"
spark.eventLog.rolling.maxFileSize: "10m"
```
```
$ aws s3 --profile localstack ls s3://spark-events/ --recursive
2025-06-17 09:43:55 0 eventlog_v2_stream-word-count-0/
2025-06-17 09:43:55 0 eventlog_v2_stream-word-count-0/appstatus_stream-word-count-0.inprogress
2025-06-17 09:52:02 1957278 eventlog_v2_stream-word-count-0/events_1_stream-word-count-0.zstd
```
### Why are the changes needed?
To show a streaming example with event log.
### Does this PR introduce _any_ user-facing change?
No behavior change because this is an example.
### How was this patch tested?
Manual tests.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes apache#251 from dongjoon-hyun/SPARK-52513.
Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>1 parent 5f9b23f commit a182864
2 files changed
+41
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
0 commit comments