Repository: incubator-airflow
Updated Branches:
  refs/heads/master e5b914789 -> 4147d6b80


[AIRFLOW-1119] Fix unload query so headers are on first row[]

Closes #2245 from th11/airflow-1119-fix


Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/4147d6b8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/4147d6b8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/4147d6b8

Branch: refs/heads/master
Commit: 4147d6b8091309cbf373d8f24d40da2e4b549473
Parents: e5b9147
Author: Thomas Hofer <[email protected]>
Authored: Tue Apr 25 11:31:31 2017 +0200
Committer: Bolke de Bruin <[email protected]>
Committed: Tue Apr 25 11:31:31 2017 +0200

----------------------------------------------------------------------
 airflow/operators/redshift_to_s3_operator.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/4147d6b8/airflow/operators/redshift_to_s3_operator.py
----------------------------------------------------------------------
diff --git a/airflow/operators/redshift_to_s3_operator.py 
b/airflow/operators/redshift_to_s3_operator.py
index d9ef59d..fda88d9 100644
--- a/airflow/operators/redshift_to_s3_operator.py
+++ b/airflow/operators/redshift_to_s3_operator.py
@@ -93,7 +93,8 @@ class RedshiftToS3Transfer(BaseOperator):
         unload_query = """
                         UNLOAD ('SELECT {0}
                         UNION ALL
-                        SELECT {1} FROM {2}.{3}')
+                        SELECT {1} FROM {2}.{3}
+                        ORDER BY 1 DESC')
                         TO 's3://{4}/{5}/{3}_'
                         with
                         credentials 
'aws_access_key_id={6};aws_secret_access_key={7}'

Reply via email to