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

Add support for the Redshift HEADER option to the UNLOAD statement #73

Open
dschiavu opened this issue May 11, 2022 · 3 comments
Open

Comments

@dschiavu
Copy link

Hi,

Would it be possible to add support for the Redshift HEADER option to the UNLOAD statement?

The HEADER option adds a CSV header (the query column names) to the output CSV file.

Thanks,
Danijel

@dschiavu dschiavu changed the title Add support for the Redshift HEADER option Add support for the Redshift HEADER option to the UNLOAD statement May 11, 2022
@dschiavu
Copy link
Author

FYI, I'm working on this feature now, planning to raise a Pull Request soon.

dschiavu pushed a commit to dschiavu/redshift-fake-driver that referenced this issue Jul 1, 2022
…the IGNOREHEADER option in the COPY command

As per the official Redshift docs (https://docs.aws.amazon.com/redshift/latest/dg/r_UNLOAD.html), the
HEADER options enables Redshift to add the header (column names) to the CSV files produced by the
UNLOAD command.

Similarly, as per the official COPY command docs (https://docs.aws.amazon.com/redshift/latest/dg/r_COPY.html),
the IGNOREHEADER option enables Redshift to skip the first N lines in the input CSV file (ie. the CSV
header).
dschiavu pushed a commit to dschiavu/redshift-fake-driver that referenced this issue Jul 1, 2022
…e_HEADER_option_to_the_UNLOAD_statement' into opt-techGH-73-Add_support_for_the_HEADER_option_to_the_UNLOAD_statement
@dschiavu
Copy link
Author

dschiavu commented Jul 1, 2022

Done in Pull Request #76

@osloma
Copy link

osloma commented Jul 1, 2022

This feature is REALLY welcome and needed because in my Team we need to simulate the output of a query run containing headers, as is returned by real Redshift. It's an amazing addition to the driver. Thanks so much @dschiavu !!

dschiavu pushed a commit to dschiavu/redshift-fake-driver that referenced this issue Jul 11, 2022
dschiavu pushed a commit to dschiavu/redshift-fake-driver that referenced this issue Jul 11, 2022
…teger rather than a string literal

(as per the official AWS Redshift spec)
ocadaruma added a commit that referenced this issue Jul 14, 2022
…_option_to_the_UNLOAD_statement

[#73] Implement the HEADER option in the UNLOAD command, and the IGNOREHEADER option in the COPY command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants