Skip to content

Commit

Permalink
Add apache kylin conn type and kylin connection docs (#36413)
Browse files Browse the repository at this point in the history
* Add apache kylin conn type and kylin connection docs

* Change default kylin_conn_id to the default_conn_name variable
  • Loading branch information
shohamy7 authored Dec 25, 2023
1 parent 1ab7b08 commit 89aa437
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 1 deletion.
7 changes: 6 additions & 1 deletion airflow/providers/apache/kylin/hooks/kylin.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,14 @@ class KylinHook(BaseHook):
:param dsn: dsn
"""

conn_name_attr = "kylin_conn_id"
default_conn_name = "kylin_default"
conn_type = "kylin"
hook_name = "Apache Kylin"

def __init__(
self,
kylin_conn_id: str = "kylin_default",
kylin_conn_id: str = default_conn_name,
project: str | None = None,
dsn: str | None = None,
):
Expand Down
4 changes: 4 additions & 0 deletions airflow/providers/apache/kylin/provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,7 @@ hooks:
- integration-name: Apache Kylin
python-modules:
- airflow.providers.apache.kylin.hooks.kylin

connection-types:
- hook-class-name: airflow.providers.apache.kylin.hooks.kylin.KylinHook
connection-type: kylin
47 changes: 47 additions & 0 deletions docs/apache-airflow-providers-apache-kylin/connections.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.
Apache Kylin Connection
=======================

The Apache Kylin connection type enables connection to Apache Kylin.

Default Connection IDs
----------------------

Kylin Hook uses parameter ``kylin_conn_id`` for Connection IDs and the value of the
parameter as ``kylin_default`` by default.

Configuring the Connection
--------------------------
Host
The host of the Kylin cluster (should be without scheme).

Port
Specify the port to use for connecting the Kylin cluster.

Schema
The default Kylin project that will be used, if not specified.

Login
The user that will be used for authentication against the Kylin cluster.

Password
The password of the user that will be used for authentication against the Kylin cluster.

Extra (optional, connection parameters)
Specify the extra parameters (as json dictionary) that can be used in Kylin connection.
7 changes: 7 additions & 0 deletions docs/apache-airflow-providers-apache-kylin/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@
Changelog <changelog>
Security <security>

.. toctree::
:hidden:
:maxdepth: 1
:caption: Guides

Connection types <connections>

.. toctree::
:hidden:
:maxdepth: 1
Expand Down

0 comments on commit 89aa437

Please sign in to comment.