Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 18, 2025

What's Changed in this PR

Documents the new compression_type option for COPY TO and COPY FROM commands introduced in GreptimeTeam/greptimedb#7162.

Updated sections:

  • Added compression_type parameter to COPY TO WITH options table
  • Added compression_type parameter to COPY FROM WITH options table
  • Added compression_type parameter to COPY query results WITH options table
  • Added examples demonstrating gzip compression for table exports, imports, and query results
  • Added NOTE sections reminding users to use appropriate file extensions for each compression type
  • Polished all documentation text to read naturally in both English and Chinese while maintaining technical accuracy

Example usage:

-- Export table to compressed CSV
COPY tbl TO '/path/to/file.csv.gz' WITH (
  FORMAT = 'csv',
  compression_type = 'gzip'
);

-- Import table from compressed CSV
COPY tbl FROM '/path/to/file.csv.gz' WITH (
  FORMAT = 'csv',
  compression_type = 'gzip'
);

-- Export query results to compressed JSON
COPY (SELECT * FROM tbl WHERE host = 'host1') TO '/path/to/file.json.gz' WITH (
  FORMAT = 'json',
  compression_type = 'gzip'
);

Supported compression types:

  • gzip - Gzip compression (.gz extension)
  • zstd - Zstandard compression (.zst extension)
  • bzip2 - Bzip2 compression (.bz2 extension)
  • xz - XZ compression (.xz extension)

Important notes:

  • Only available for CSV and JSON formats
  • File extensions must match the compression type: .gz for gzip, .zst for zstd, .bz2 for bzip2, and .xz for xz

Checklist

Original prompt

This section details on the original issue you should resolve

<issue_title>Update docs for feat: implement compressed CSV/JSON export functionality</issue_title>
<issue_description>A document change request is generated from GreptimeTeam/greptimedb#7162</issue_description>

<agent_instructions>update nightly docs and Chinese version</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: WenyXu <32535939+WenyXu@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 18, 2025

Deploying greptime-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: b015eaa
Status: ✅  Deploy successful!
Preview URL: https://81f0695e.greptime-docs.pages.dev
Branch Preview URL: https://copilot-update-nightly-docs-ibvx.greptime-docs.pages.dev

View logs

Copilot AI changed the title [WIP] Update documentation for compressed CSV/JSON export functionality docs: add compression option for CSV/JSON exports Nov 18, 2025
Copilot AI requested a review from WenyXu November 18, 2025 06:49
Copilot finished work on behalf of WenyXu November 18, 2025 06:49
@WenyXu
Copy link
Member

WenyXu commented Nov 18, 2025

@copilot it supports following compression type

COPY test_csv_export TO '${SQLNESS_HOME}/import/test_csv_gzip.csv.gz' WITH (format='csv', compression_type='gzip');
COPY test_csv_export TO '${SQLNESS_HOME}/import/test_csv_zstd.csv.zst' WITH (format='csv', compression_type='zstd');
COPY test_csv_export TO '${SQLNESS_HOME}/import/test_csv_bzip2.csv.bz2' WITH (format='csv', compression_type='bzip2');
COPY test_csv_export TO '${SQLNESS_HOME}/import/test_csv_xz.csv.xz' WITH (format='csv', compression_type='xz');

…, bzip2, xz)

Co-authored-by: WenyXu <32535939+WenyXu@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 18, 2025

@copilot it supports following compression type

COPY test_csv_export TO '${SQLNESS_HOME}/import/test_csv_gzip.csv.gz' WITH (format='csv', compression_type='gzip');

...

Updated the documentation to include all supported compression types (gzip, zstd, bzip2, xz) and corrected the parameter name to compression_type. Changes made in commit a744743.

Copilot AI changed the title docs: add compression option for CSV/JSON exports docs: add compression_type option for CSV/JSON exports Nov 18, 2025
Copilot finished work on behalf of WenyXu November 18, 2025 07:00
@WenyXu WenyXu marked this pull request as ready for review November 18, 2025 07:05
@WenyXu
Copy link
Member

WenyXu commented Nov 18, 2025

@copilot Copy From also supports this feature, please take a look at the PR test context for reference.

COPY test_json_import_gzip FROM '${SQLNESS_HOME}/import/test_json_gzip.json.gz' WITH (format='json', compression_type='gzip');

Co-authored-by: WenyXu <32535939+WenyXu@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 18, 2025

@copilot Copy From also supports this feature, please take a look at the PR test context for reference.

...

Added compression_type support to the COPY FROM documentation with example showing how to import from compressed files. Changes made in commit 79518e6.

Copilot AI changed the title docs: add compression_type option for CSV/JSON exports docs: add compression_type option for CSV/JSON import/export Nov 18, 2025
Copilot finished work on behalf of WenyXu November 18, 2025 07:19
@WenyXu
Copy link
Member

WenyXu commented Nov 18, 2025

@copilot Polish all text while respecting its original style and tone. Ensure English reads like native English, and Chinese reads like native Chinese. Keep technical content, formatting, and structur...

Co-authored-by: WenyXu <32535939+WenyXu@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 18, 2025

@copilot Polish all text while respecting its original style and tone. Ensure English reads like native English, and Chinese reads like native Chinese. Keep technical content, formatting, and structu...

Polished all text to read more naturally in both English and Chinese while maintaining the technical content and formatting. Changes made in commit 87fea8d.

Copilot finished work on behalf of WenyXu November 18, 2025 07:43
Co-authored-by: jeremyhi <jiachun_feng@proton.me>
Co-authored-by: WenyXu <32535939+WenyXu@users.noreply.github.com>
Copilot AI requested a review from WenyXu November 18, 2025 08:06
Copilot finished work on behalf of WenyXu November 18, 2025 08:06
@WenyXu WenyXu merged commit c92bd41 into main Nov 18, 2025
5 checks passed
@WenyXu WenyXu deleted the copilot/update-nightly-docs-compressed-export branch November 18, 2025 08:49
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

Successfully merging this pull request may close these issues.

Update docs for feat: implement compressed CSV/JSON export functionality

4 participants