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

[FLINK-36761][docs] Add document about how to use SQL Gateway and SQL Client to deploy script #25784

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

Conversation

fsk119
Copy link
Member

@fsk119 fsk119 commented Dec 11, 2024

What is the purpose of the change

Add document about how to use sql client and sql gateway to deploy script.

@flinkbot
Copy link
Collaborator

flinkbot commented Dec 11, 2024

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@@ -116,6 +116,34 @@ $ curl --request GET http://localhost:8083/v1/sessions/${sessionHandle}/operatio

结果中的 `nextResultUri` 不是null时,用于获取下一批结果。

### Deploy Script

SQL Gateway supports to deploy a script in [Application Mode]({{< ref "docs/deployment/overview" >}}). In application mode, Job Master is responsible for the script compiling.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: to deploy -> deploying
what do we mean by Job Master, we should have a link - do you mean the JobManager?
the script compiling. -> compiling the script.

### Deploy Script

SQL Gateway supports to deploy a script in [Application Mode]({{< ref "docs/deployment/overview" >}}). In application mode, Job Master is responsible for the script compiling.
If you want to use custom resources in the script, e.g. Kafka Source, please use [ADD JAR]({{< ref "docs/dev/table/sql/jar">}}) command to download the required sources.
Copy link
Contributor

Choose a reason for hiding this comment

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

does this download or reference a downloaded jar?

SQL Gateway supports to deploy a script in [Application Mode]({{< ref "docs/deployment/overview" >}}). In application mode, Job Master is responsible for the script compiling.
If you want to use custom resources in the script, e.g. Kafka Source, please use [ADD JAR]({{< ref "docs/dev/table/sql/jar">}}) command to download the required sources.

Here is an example to deploy script to Flink native K8S Cluster with cluster id `CLUSTER_ID`.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:
deploy script -> deploy a script
to Flink native -> to a Flink native

}'
```

<span class="label label-info">Note</span> If you want to run script with PyFlink, please use an image with PyFlink installed. You can refer to
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:
run script -> run the script

@@ -663,6 +663,24 @@ This configuration:

<span class="label label-danger">Attention</span> Compared to the interactive mode, SQL Client will stop execution and exits when there are errors.

### Deploy SQL Files in an Application Cluster

SQL Client also supports to deploy a SQL script file to an application cluster with the `-f` option if you specify the deployment target in the config.yaml or startup options.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:
to deploy => deploying
comma before if

@@ -610,7 +610,7 @@ SQL Client will print success message if the statement is executed successfully.
By default, the error message only contains the error cause. In order to print the full exception stack for debugging, please set the
`sql-client.verbose` to true through command `SET 'sql-client.verbose' = 'true';`.

### Execute SQL Files
### Execute SQL Files in a Session Cluster

SQL Client supports to execute a SQL script file with the `-f` option. SQL Client will execute
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:
to execute - > executing

### Deploy SQL Files in an Application Cluster

SQL Client also supports to deploy a SQL script file to an application cluster with the `-f` option if you specify the deployment target in the config.yaml or startup options.
Here is an example to deploy script file in an application cluster.
Copy link
Contributor

@davidradl davidradl Dec 12, 2024

Choose a reason for hiding this comment

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

nit:
to deploy - deploying
comma before if
Application Cluster is sometimes capitalised and sometimes not - I suggest using the capitalised form consistently

After execution, SQL Client print the cluster id on the terminal. The script can contain any statement that is supported by Flink. But Application cluster only supports one job, please refer to the
[Application Mode]({{< ref "docs/deployment/overview#application-mode" >}}) for the limitations.

<span class="label label-danger">Attention</span> When deploying a script to the cluster, SQL Client only supports to run with `--jars` startup option, other options, e.g. `--init`
Copy link
Contributor

Choose a reason for hiding this comment

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

not:
to run -> running

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

Successfully merging this pull request may close these issues.

3 participants