Repository: apache/airflow

Issue:
Guide for Apache Druid operators 
**Description**

Hello,

A guide that describes how to use Apache Druid software operators would be useful.

Other guides are available:
https://airflow.readthedocs.io/en/latest/howto/operator/index.html

Are you wondering how to start contributing to this project? Start by reading our [contributor guide](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst)

Best regards,
Kamil

**Use case / motivation**

N/A

**Related Issues**

Missing guides for Apache operators:
Apache Cassandra: https://github.com/apache/airflow/issues/8189
Apache Druid: https://github.com/apache/airflow/issues/8199
Apache Hive: https://github.com/apache/airflow/issues/8191
Apache Livy: https://github.com/apache/airflow/issues/8192
Apache Pig: https://github.com/apache/airflow/issues/8193
Apache Pinot: https://github.com/apache/airflow/issues/8194
Apache Spark: https://github.com/apache/airflow/issues/8195
Apache Sqoop: https://github.com/apache/airflow/issues/8196
Hadoop Distributed File System (HDFS): https://github.com/apache/airflow/issues/8197
WebHDFS: https://github.com/apache/airflow/issues/8198




Discussion:
Hello, I would like to write this guide 😄 
@Jasonnor Please 🙂 

Resolving patch:
diff --git a/airflow/providers/apache/druid/example_dags/__init__.py b/airflow/providers/apache/druid/example_dags/__init__.py
new file mode 100644
--- /dev/null
+++ b/airflow/providers/apache/druid/example_dags/__init__.py
@@ -0,0 +1,17 @@
+#
+# 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.
diff --git a/airflow/providers/apache/druid/example_dags/example_druid_dag.py b/airflow/providers/apache/druid/example_dags/example_druid_dag.py
new file mode 100644
--- /dev/null
+++ b/airflow/providers/apache/druid/example_dags/example_druid_dag.py
@@ -0,0 +1,52 @@
+#
+# 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.
+
+"""
+Example Airflow DAG to submit Apache Druid json index file using `DruidOperator`
+"""
+from airflow.models import DAG
+from airflow.providers.apache.druid.operators.druid import DruidOperator
+from airflow.utils.dates import days_ago
+
+with DAG(
+    dag_id='example_druid_operator',
+    schedule_interval=None,
+    start_date=days_ago(2),
+    tags=['example'],
+) as dag:
+    # [START howto_operator_druid_submit]
+    submit_job = DruidOperator(
+        task_id='spark_submit_job',
+        json_index_file='json_index.json',
+        druid_ingest_conn_id='druid_ingest_default',
+    )
+    # Example content of json_index.json:
+    JSON_INDEX_STR = """
+        {
+            "type": "index_hadoop",
+            "datasource": "datasource_prd",
+            "spec": {
+                "dataSchema": {
+                    "granularitySpec": {
+                        "intervals": ["2021-09-01/2021-09-02"]
+                    }
+                }
+            }
+        }
+    """
+    # [END howto_operator_druid_submit]


Test patch: