apache-airflow-providers-clickhouse-fork
Provider allow connection from Apache Airflow to Yandex Clickhouse Database and perform query using ClickhouseOperator.
Installation
pip install airflow-providers-clickhouse-fork
Using
After installation, you can see provider in the Airflow providers list.
Now, you can add connection on the Airflow connection page.
Example
from datetime import datetime, timedelta
from airflow import DAG
from airflow.operators.dummy import DummyOperator
from apache.airflow.providers.clickhouse.operators.ClickhouseOperator import ClickhouseOperator
with DAG(
dag_id='example_clickhouse_operator',
start_date=datetime(2021, 1, 1),
dagrun_timeout=timedelta(minutes=60),
tags=['example','clickhouse'],
catchup=False,
template_searchpath='$AIRFLOW_HOME/include'
) as dag:
run_this_last = DummyOperator(task_id='run_this_last')
# load sql from file
select_data = ClickhouseOperator(
task_id='select_quit',
sql='query.sql',
click_conn_id='my_clickhouse_connection',
do_xcom_push=False
)
# set sql direct in the code section
select_push = ClickhouseOperator(
task_id='select_xcom',
sql='select * from TestTable;;',
click_conn_id='my_clickhouse_connection'
)
select_data >> select_push >> run_this_last
Get result of query
If property do_xcom_push equals False, no result pushed to XCom. Otherwise, result will be pushed to XCom.
Additional
This code based on clichouse driver.
Metadata
Release files for airflow-providers-clickhouse-fork 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| airflow-providers-clickhouse-fork-0.0.3.tar.gz | 8.8 kB | Without provenance | Details for airflow-providers-clickhouse-fork-0.0.3.tar.gz |
Release files / airflow-providers-clickhouse-fork-0.0.3.tar.gz
| Download URL | airflow-providers-clickhouse-fork-0.0.3.tar.gz |
|---|---|
| Size | 8.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1f2e42af3a80ea29ea261796ff33af8b5d403c2dc010ab1f55fd792e59f142da
|
|
BLAKE2b-256 checksum How to use checksums |
6ffc3601a0a4bb125b8e79822205b9dc49d6404a622dce3d7b0976c7b12972f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.11
|
Security for airflow-providers-clickhouse-fork 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.