Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-50382][CONNECT] Add documentation for general information on application development with/extending Spark Connect #48922

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

vicennial
Copy link
Contributor

@vicennial vicennial commented Nov 21, 2024

What changes were proposed in this pull request?

Adds a new page, app-dev-spark-connect.md, which is hyperlinked from the Use Spark Connect in standalone applications section in spark-connect-overview.

Why are the changes needed?

There is a lack of documentation in the area of application development (with Spark Connect) especially so on extending Spark Connect with custom logic/libraries/plugins.

Does this PR introduce any user-facing change?

Yes, new page titled "Application Development with Spark Connect"

Render screenshot:
image

How was this patch tested?

Local rendering

Was this patch authored or co-authored using generative AI tooling?

No

@github-actions github-actions bot added the DOCS label Nov 21, 2024
# Internal class that satisfies the interface by the Python client
# of Spark Connect to generate the protobuf representation from
# an instance of the expression.
class ExampleExpression(Expression):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit but indentation would have to use 4 spaces instead of tabs

<img src="img/extending-spark-connect-labelled.png" title="Figure 2: Labelled Architecture" alt="Extending Spark
Connect Diagram - Labelled Steps" />
</p>
#### (1) Spark Connect Protocol Extension
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a space above and below of those ####. They aren't properly rendered in some markdown editors (as technically it's the standard to put spaces around them)


<p style="text-align: center;">
<img src="img/extending-spark-connect.png" title="Figure 1: Architecture" alt="Extending Spark
Connect Diagram" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Connect Diagram" />
Connect Diagram"/>

A Spark Server Library consists of the following components, illustrated in Fig. 2:

1. The Spark Connect protocol extension (blue box _Proto_ API)
2. A Spark Connect Plugin…
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is a typo? or incomplete? Below too.

Application, alongside PySpark or the Scala Spark Client.
<p style="text-align: center;">
<img src="img/extending-spark-connect-labelled.png" title="Figure 2: Labelled Architecture" alt="Extending Spark
Connect Diagram - Labelled Steps" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Connect Diagram - Labelled Steps" />
Connect Diagram - Labelled Steps"/>

Comment on lines +215 to +217
from pyspark.sql.connect.column import Expression
from myxample.proto import ExamplePluginExpression
import pyspark.sql.connect.proto as proto
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
from pyspark.sql.connect.column import Expression
from myxample.proto import ExamplePluginExpression
import pyspark.sql.connect.proto as proto
from pyspark.sql.connect.column import Expression
import pyspark.sql.connect.proto as proto
from myxample.proto import ExamplePluginExpression

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

per PEP8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants