mik-laj commented on a change in pull request #8305:
URL: https://github.com/apache/airflow/pull/8305#discussion_r419126976



##########
File path: docs/howto/operator/apache/spark.rst
##########
@@ -0,0 +1,102 @@
+ .. 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.
+
+
+Apache Spark Operators
+======================
+
+.. contents::
+  :depth: 1
+  :local:
+
+Prerequisite
+------------
+
+To use ``SparkJDBCOperator`` and ``SparkSubmitOperator``, you must configure a 
:doc:`Spark Connection <../../connection/spark>`. For ``SparkJDBCOperator``, 
you must also configure a :doc:`JDBC connection <../../connection/jdbc>`.
+
+``SparkSqlOperator`` gets all the configurations from operator parameters.
+
+.. _howto/operator:SparkJDBCOperator:
+
+SparkJDBCOperator
+-----------------
+
+Launches applications on a Apache Spark server, it uses 
``SparkSubmitOperator`` to perform data transfers to/from JDBC-based databases.
+
+For parameter definition take a look at 
:class:`~airflow.providers.apache.spark.operators.spark_jdbc.SparkJDBCOperator`.
+
+Using the operator
+""""""""""""""""""
+
+Using ``cmd_type`` parameter, is possible to transfer data from Spark to a 
database (``spark_to_jdbc``) or from a database to Spark (``jdbc_to_spark``), 
which will write the table using the Spark command ``saveAsTable``.
+
+.. exampleinclude:: 
../../../../airflow/providers/apache/spark/example_dags/example_spark_dag.py
+    :language: python
+    :dedent: 4
+    :start-after: [START howto_operator_spark_jdbc]
+    :end-before: [END howto_operator_spark_jdbc]
+
+
+Reference
+"""""""""
+
+For further information, look at `Apache Spark DataFrameWriter documentation 
<https://spark.apache.org/docs/2.4.5/api/scala/index.html#org.apache.spark.sql.DataFrameWriter>`_.
+
+.. _howto/operator:SparkSqlOperator:
+
+SparkSqlOperator
+----------------
+
+Launches applications on a Apache Spark server, it requires that the 
``spark-sql`` script is in the PATH.
+The operator will run the SQL query on Spark Hive metastore service, the 
``sql`` parameter can be templated and be a ``.sql`` or ``.hql`` file.

Review comment:
       Can you add a link to API reference?
   ```
   :class:`~airflow.providers.apache.spark.operators.spark_sql.SparkSqlOperator`
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to