Skip to content

add compression for INTO OUTFILE#27134

Merged
kitaisreal merged 5 commits intoClickHouse:masterfrom
FArthur-cmd:compress_output_3473
Aug 5, 2021
Merged

add compression for INTO OUTFILE#27134
kitaisreal merged 5 commits intoClickHouse:masterfrom
FArthur-cmd:compress_output_3473

Conversation

@FArthur-cmd
Copy link
Copy Markdown
Contributor

@FArthur-cmd FArthur-cmd commented Aug 3, 2021

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Add compression for INTO OUTFILE that automatically choose compression algorithm. Closes #3473.

Detailed description / Documentation draft:
Solution of #3473. Now files will be compressed with algorithm which is chosen be filename ending.

Example
SELECT * FROM (SELECT 'Hello world!') INTO OUTFILE 'hello.gz'

This query will create file with gzip compression.

@robot-clickhouse robot-clickhouse added the pr-improvement Pull request with some product improvements label Aug 3, 2021
@FArthur-cmd FArthur-cmd marked this pull request as draft August 3, 2021 12:33
@FArthur-cmd FArthur-cmd marked this pull request as ready for review August 3, 2021 12:33
@kitaisreal kitaisreal self-assigned this Aug 3, 2021

${CLICKHOUSE_LOCAL} --query "SELECT * FROM (SELECT 'Hello, World! From local.') INTO OUTFILE '${CLICKHOUSE_TMP}/test_compression_of_output_file_from_local.gz'"
gunzip ${CLICKHOUSE_TMP}/test_compression_of_output_file_from_local.gz
cat ${CLICKHOUSE_TMP}/test_compression_of_output_file_from_local No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FArthur-cmd fix new line at end of file.

@FArthur-cmd
Copy link
Copy Markdown
Contributor Author

There are errors in performance, but they are not related to changes.

@kitaisreal kitaisreal merged commit 71e5cfe into ClickHouse:master Aug 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-improvement Pull request with some product improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

compressed output formats

4 participants