From 3c300e7e04852def4e7e3a13aad5175e7844dc19 Mon Sep 17 00:00:00 2001 From: Benji Lampel Date: Thu, 21 Jul 2022 09:54:57 -0400 Subject: [PATCH] Add table alias to SQLTableCheckOperator query Without a table alias, the query does not run on Postgres and other databases. The alias is arbitrary and used only for proper query execution. --- airflow/providers/common/sql/operators/sql.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airflow/providers/common/sql/operators/sql.py b/airflow/providers/common/sql/operators/sql.py index 6788d9720cfe5..411f540f76808 100644 --- a/airflow/providers/common/sql/operators/sql.py +++ b/airflow/providers/common/sql/operators/sql.py @@ -269,7 +269,7 @@ class SQLTableCheckOperator(BaseSQLOperator): sql_check_template = """ SELECT '_check_name' AS check_name, MIN(_check_name) AS check_result - FROM(SELECT CASE WHEN check_statement THEN 1 ELSE 0 END AS _check_name FROM table) + FROM(SELECT CASE WHEN check_statement THEN 1 ELSE 0 END AS _check_name FROM table) AS check_table """ def __init__(