You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by pi...@apache.org on 2023/01/11 22:43:09 UTC

[airflow] branch v2-5-test updated: After running the DAG the employees table is empty. (#28353)

This is an automated email from the ASF dual-hosted git repository.

pierrejeambrun pushed a commit to branch v2-5-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v2-5-test by this push:
     new 4f8e3f1a50 After running the DAG the employees table is empty. (#28353)
4f8e3f1a50 is described below

commit 4f8e3f1a50882793d476583aa3f047c5927ae912
Author: Alex Vicol <vm...@gmail.com>
AuthorDate: Wed Jan 11 13:33:12 2023 -0800

    After running the DAG the employees table is empty. (#28353)
    
    The reason is the sql syntax error:
    
    ERROR: subquery in FROM must have an alias
    LINE 3: FROM (
    ^
    HINT: For example, FROM (SELECT ...) [AS] foo.
    SQL state: 42601
    Character: 37
    
    The change fixes the sql syntax in merge_data.
    
    (cherry picked from commit 53893f13b2391c005eacf33115e5e50fd558a396)
---
 docs/apache-airflow/tutorial/pipeline.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/docs/apache-airflow/tutorial/pipeline.rst b/docs/apache-airflow/tutorial/pipeline.rst
index 26bbfb83e3..5fa854d048 100644
--- a/docs/apache-airflow/tutorial/pipeline.rst
+++ b/docs/apache-airflow/tutorial/pipeline.rst
@@ -168,7 +168,7 @@ Here we select completely unique records from the retrieved data, then we check
           FROM (
               SELECT DISTINCT *
               FROM employees_temp
-          )
+          ) t
           ON CONFLICT ("Serial Number") DO UPDATE
           SET "Serial Number" = excluded."Serial Number";
       """
@@ -283,7 +283,7 @@ Putting all of the pieces together, we have our completed DAG.
               FROM (
                   SELECT DISTINCT *
                   FROM employees_temp
-              )
+              ) t
               ON CONFLICT ("Serial Number") DO UPDATE
               SET "Serial Number" = excluded."Serial Number";
           """