-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
Update pipeline.rst - Fix query in merge_data()
task
#29158
Conversation
The alias for the subquery was missing in the `merge_data()` function's query, so it just needed to be added. Otherwise, the `employees` table remains empty. I found the error in the postgres container logs: ``` 2023-01-25 08:00:03 2023-01-25 14:00:03.256 UTC [70428] ERROR: subquery in FROM must have an alias at character 74 2023-01-25 08:00:03 2023-01-25 14:00:03.256 UTC [70428] HINT: For example, FROM (SELECT ...) [AS] foo. 2023-01-25 08:00:03 2023-01-25 14:00:03.256 UTC [70428] STATEMENT: 2023-01-25 08:00:03 INSERT INTO employees 2023-01-25 08:00:03 SELECT * 2023-01-25 08:00:03 FROM ( 2023-01-25 08:00:03 SELECT DISTINCT * 2023-01-25 08:00:03 FROM employees_temp 2023-01-25 08:00:03 ) 2023-01-25 08:00:03 ON CONFLICT ("Serial Number") DO UPDATE 2023-01-25 08:00:03 SET "Serial Number" = excluded."Serial Number"; ``` Thank you!
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 Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue with the merge SQL looks to be fixed with the 2.5.1 tutorial. The example is not practical to begin with though. Better to change it.
Co-authored-by: Josh Fell <48934154+josh-fell@users.noreply.github.com>
Awesome work, congrats on your first merged pull request! |
@tsoud Congrats on your first contribution! 🎉 |
* Update pipeline.rst - Fix query in `merge_data()` task The alias for the subquery was missing in the `merge_data()` function's query, so it just needed to be added. Otherwise, the `employees` table remains empty. I found the error in the postgres container logs: ``` 2023-01-25 08:00:03 2023-01-25 14:00:03.256 UTC [70428] ERROR: subquery in FROM must have an alias at character 74 2023-01-25 08:00:03 2023-01-25 14:00:03.256 UTC [70428] HINT: For example, FROM (SELECT ...) [AS] foo. 2023-01-25 08:00:03 2023-01-25 14:00:03.256 UTC [70428] STATEMENT: 2023-01-25 08:00:03 INSERT INTO employees 2023-01-25 08:00:03 SELECT * 2023-01-25 08:00:03 FROM ( 2023-01-25 08:00:03 SELECT DISTINCT * 2023-01-25 08:00:03 FROM employees_temp 2023-01-25 08:00:03 ) 2023-01-25 08:00:03 ON CONFLICT ("Serial Number") DO UPDATE 2023-01-25 08:00:03 SET "Serial Number" = excluded."Serial Number"; ``` Thank you! * Update docs/apache-airflow/tutorial/pipeline.rst Co-authored-by: Josh Fell <48934154+josh-fell@users.noreply.github.com> --------- Co-authored-by: Josh Fell <48934154+josh-fell@users.noreply.github.com> (cherry picked from commit 0d3d0e2)
The alias for the subquery was missing in the
merge_data()
function's query, so it just needed to be added. Otherwise, theemployees
table remains empty. I found the error in the postgres container logs:Thank you!
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rst
or{issue_number}.significant.rst
, in newsfragments.