Skip to content

Commit

Permalink
[SPARK-39394][DOCS][SS] Improve PySpark Structured Streaming page mor…
Browse files Browse the repository at this point in the history
…e readable

### What changes were proposed in this pull request?

This PR proposes to improve the PySpark Structured Streaming API reference page to be more readable,

So far, the PySpark Structured Streaming API reference page is not-well organized so it's a bit uncomfortable to be read as below:

![Screen Shot 2022-06-07 at 12 29 33 PM](https://user-images.githubusercontent.com/44108233/172289683-0c130b6a-7716-40a3-b22b-42e38febe8c7.png)

### Why are the changes needed?

The improvement of document readability will also improve the usability for PySpark Structured Streaming.

### Does this PR introduce _any_ user-facing change?

Yes, now the documentation is categorized by its class or their own purpose more clearly as below:

![Screen Shot 2022-06-07 at 12 30 01 PM](https://user-images.githubusercontent.com/44108233/172289737-bd6ebf0e-601c-4a80-a16a-cf885302e7b6.png)

### How was this patch tested?

The existing doc build in CI should cover.

Closes apache#36782 from itholic/SPARK-39394.

Authored-by: itholic <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
  • Loading branch information
itholic authored and HyukjinKwon committed Jun 7, 2022
1 parent 63f0f91 commit b30a080
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 49 deletions.
2 changes: 1 addition & 1 deletion python/docs/source/reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Pandas API on Spark follows the API specifications of latest pandas release.

pyspark.sql/index
pyspark.pandas/index
pyspark.ss
pyspark.ss/index
pyspark.ml
pyspark.streaming
pyspark.mllib
Expand Down
32 changes: 32 additions & 0 deletions python/docs/source/reference/pyspark.ss/core_classes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.. Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
.. http://www.apache.org/licenses/LICENSE-2.0
.. Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
============
Core Classes
============

.. currentmodule:: pyspark.sql.streaming

.. autosummary::
:toctree: api/

DataStreamReader
DataStreamWriter
StreamingQuery
StreamingQueryManager
StreamingQueryListener
30 changes: 30 additions & 0 deletions python/docs/source/reference/pyspark.ss/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.. Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
.. http://www.apache.org/licenses/LICENSE-2.0
.. Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
====================
Structured Streaming
====================

This page gives an overview of all public Structed Streaming API.

.. toctree::
:maxdepth: 2

core_classes
io
query_management
47 changes: 47 additions & 0 deletions python/docs/source/reference/pyspark.ss/io.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.. Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
.. http://www.apache.org/licenses/LICENSE-2.0
.. Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
============
Input/Output
============

.. currentmodule:: pyspark.sql.streaming

.. autosummary::
:toctree: api/

DataStreamReader.csv
DataStreamReader.format
DataStreamReader.json
DataStreamReader.load
DataStreamReader.option
DataStreamReader.options
DataStreamReader.orc
DataStreamReader.parquet
DataStreamReader.schema
DataStreamReader.text
DataStreamWriter.foreach
DataStreamWriter.foreachBatch
DataStreamWriter.format
DataStreamWriter.option
DataStreamWriter.options
DataStreamWriter.outputMode
DataStreamWriter.partitionBy
DataStreamWriter.queryName
DataStreamWriter.start
DataStreamWriter.trigger
Original file line number Diff line number Diff line change
Expand Up @@ -16,55 +16,9 @@
under the License.
====================
Structured Streaming
====================

Core Classes
------------

.. currentmodule:: pyspark.sql.streaming

.. autosummary::
:toctree: api/

DataStreamReader
DataStreamWriter
StreamingQuery
StreamingQueryManager
StreamingQueryListener

Input and Output
----------------

.. currentmodule:: pyspark.sql.streaming

.. autosummary::
:toctree: api/

DataStreamReader.csv
DataStreamReader.format
DataStreamReader.json
DataStreamReader.load
DataStreamReader.option
DataStreamReader.options
DataStreamReader.orc
DataStreamReader.parquet
DataStreamReader.schema
DataStreamReader.text
DataStreamWriter.foreach
DataStreamWriter.foreachBatch
DataStreamWriter.format
DataStreamWriter.option
DataStreamWriter.options
DataStreamWriter.outputMode
DataStreamWriter.partitionBy
DataStreamWriter.queryName
DataStreamWriter.start
DataStreamWriter.trigger

================
Query Management
----------------
================

.. currentmodule:: pyspark.sql.streaming

Expand Down

0 comments on commit b30a080

Please sign in to comment.