18 lines
644 B
Python
18 lines
644 B
Python
from airflow import DAG
|
|
from airflow.providers.http.operators.http import SimpleHttpOperator
|
|
from datetime import datetime
|
|
with DAG(
|
|
dag_id="clickhouse_list_tables",
|
|
start_date=datetime(2025, 1, 1),
|
|
schedule_interval=None,
|
|
catchup=False,
|
|
) as dag:
|
|
list_tables = SimpleHttpOperator(
|
|
task_id="list_tables",
|
|
http_conn_id="clickhouse_http", # Connection в Airflow
|
|
endpoint="/",
|
|
method="POST",
|
|
data={"query": "SHOW TABLES"},
|
|
headers={"Content-Type": "application/x-www-form-urlencoded"},
|
|
log_response=True, # покажет результат в логах Airflow
|
|
) |