Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLTableCheckOperator issue with Oracle table alias #44135

Open
2 tasks done
igvog opened this issue Nov 18, 2024 · 3 comments · May be fixed by #44182 or #44210
Open
2 tasks done

SQLTableCheckOperator issue with Oracle table alias #44135

igvog opened this issue Nov 18, 2024 · 3 comments · May be fixed by #44182 or #44210

Comments

@igvog
Copy link

igvog commented Nov 18, 2024

Apache Airflow version

2.10.0

If "Other Airflow 2 version" selected, which one?

2

What happened?

SQLTableCheckOperator operator generate SQL with table "AS" alias and table alias with "AS" not working in Oracle database.
Needs to fix sql_check_template depends on connection type remove "AS".

What you think should happen instead?

No response

How to reproduce

from airflow.providers.common.sql.operators.sql import SQLTableCheckOperator

SQLTableCheckOperator(
        task_id="your_task",
        table="yout_table",
        checks={
            "row_count_check": {"check_statement": "COUNT(*) = 1000"}        },
        partition_clause="BALANCE_DATE = to_date('2024-11-11','yyyy-mm-dd')",
        conn_id=connection_should_be_oracle_db
    )

Operating System

ubuntu

Versions of Apache Airflow Providers

apache-airflow-providers-common-sql==1.7.2

Deployment

Official Apache Airflow Helm Chart

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@igvog igvog added area:core kind:bug This is a clearly a bug needs-triage label for new issues that we didn't triage yet labels Nov 18, 2024
Copy link

boring-cyborg bot commented Nov 18, 2024

Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.

@igvog igvog changed the title SQLTableCheckOperator issue with Oracle SQLTableCheckOperator issue with Oracle table alias Nov 18, 2024
@tolebiermekov
Copy link

I came across a similar issue...

@Lee-W Lee-W removed the needs-triage label for new issues that we didn't triage yet label Nov 18, 2024
@tolebiermekov
Copy link

In Oracle SQL, the AS keyword is not allowed when assigning an alias to a subquery. While AS can be used for column aliases or table aliases in some contexts, Oracle does not permit its use when aliasing subqueries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment