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

Fix: Remove AS Keyword for Subquery Aliases in Oracle SQL #44210

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tolebiermekov
Copy link

Oracle SQL does not permit the use of the AS keyword when aliasing subqueries. While AS is valid for column and table aliases in some contexts, subquery aliases must not include the keyword AS. This PR addresses this limitation in the SQLTableCheckOperator.

Changes:
Updated the SQLTableCheckOperator to handle Oracle-specific SQL syntax by omitting the AS keyword for subquery aliases.
Introduced a check to determine the database type, ensuring this adjustment is applied only for Oracle SQL.
Added relevant unit tests to ensure compatibility across supported databases.
Closes:
Closes #44135.

Notes:
This change ensures that Airflow's SQLTableCheckOperator works seamlessly with Oracle SQL while maintaining compatibility with other databases.

Copy link

boring-cyborg bot commented Nov 20, 2024

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@potiuk
Copy link
Member

potiuk commented Nov 21, 2024

Nope. This is still very wrong. "common" sql provider should not know anything about "oracle" - this is the main reason why we introduced "common.sql" and all the "database" specific calls should come to the provider - so you have to modify it in the way that all "oracle" specific code lives in the "oracle" provider. You should implement a new feature in the common.sql where you can replace the template and then make oracle provider to replace it.

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

Successfully merging this pull request may close these issues.

SQLTableCheckOperator issue with Oracle table alias
2 participants