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

BZIP2 format not supported with COPY #110

Closed
rectalogic opened this Issue Jan 25, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@rectalogic
Contributor

rectalogic commented Jan 25, 2017

We use BZIP2 compression on our s3 files, it doesn't seem possible to specify this with the CopyCommand.
http://docs.aws.amazon.com/redshift/latest/dg/copy-parameters-data-format.html#copy-bzip2

>>> import sqlalchemy as sa
>>> from redshift_sqlalchemy.dialect import CopyCommand
>>> table = sa.table("foo")
>>> CopyCommand(table, "s3://bucket/data/", "XXXYYYZZZXXXYYYZZZ11", "XXXYYYZZZXXXYYYZZZ11XXXYYYZZZXXXYYYZZZ11", format="BZIP2")
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/virtualenv/local/lib/python2.7/site-packages/sqlalchemy_redshift/commands.py", line 362, in __init__
    self.formats)
ValueError: "format" parameter must be one of ['CSV', 'JSON', 'AVRO', None]
>>> CopyCommand(table, "s3://bucket/data/", "XXXYYYZZZXXXYYYZZZ11", "XXXYYYZZZXXXYYYZZZ11XXXYYYZZZXXXYYYZZZ11", compression="BZIP2")
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/virtualenv/local/lib/python2.7/site-packages/sqlalchemy_redshift/commands.py", line 368, in __init__
    self.compression_types
ValueError: "compression" parameter must be one of ['GZIP', 'LZOP']
@graingert

This comment has been minimized.

Show comment
Hide comment
@graingert

graingert Jan 25, 2017

Collaborator

@rectalogic should be a very easy PR.

Collaborator

graingert commented Jan 25, 2017

@rectalogic should be a very easy PR.

rectalogic added a commit to rectalogic/sqlalchemy-redshift that referenced this issue Jan 25, 2017

@rectalogic rectalogic referenced this issue Jan 25, 2017

Merged

Support BZIP2 compression in COPY. #111

4 of 4 tasks complete

rectalogic added a commit to rectalogic/sqlalchemy-redshift that referenced this issue Jan 25, 2017

rectalogic added a commit to rectalogic/sqlalchemy-redshift that referenced this issue Jan 25, 2017

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