Skip to content

feat(to): re-add to parquet subcommand powered by Polars#3674

Merged
jqnatividad merged 9 commits intomasterfrom
to-parquet-polars-powered
Apr 3, 2026
Merged

feat(to): re-add to parquet subcommand powered by Polars#3674
jqnatividad merged 9 commits intomasterfrom
to-parquet-polars-powered

Conversation

@jqnatividad
Copy link
Copy Markdown
Collaborator

The to parquet subcommand was removed in 16.0.0 due to a heavy dependency on an old arrow crate. This re-adds it using Polars directly (requires the polars feature), supporting compression codecs (zstd/gzip/snappy/lz4raw/uncompressed) and all existing input modes (files, directories, infile-lists, stdin).

The `to parquet` subcommand was removed in 16.0.0 due to a heavy
dependency on an old arrow crate. This re-adds it using Polars directly
(requires the `polars` feature), supporting compression codecs
(zstd/gzip/snappy/lz4raw/uncompressed) and all existing input modes
(files, directories, infile-lists, stdin).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codacy-production
Copy link
Copy Markdown

codacy-production bot commented Apr 3, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 35 complexity

Metric Results
Complexity 35

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Re-introduces the qsv to parquet subcommand (previously removed) by implementing Parquet writing via Polars, including compression options and support for the existing “many inputs” modes (files/dirs/infile-lists/stdin).

Changes:

  • Add to parquet subcommand plumbing, CLI help text, and Polars-based Parquet writer implementation (with compression flags).
  • Update top-level command listing to mention Parquet under to.
  • Add integration tests for basic parquet generation, multiple inputs, compression flag, custom --table name, and directory inputs.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 9 comments.

File Description
src/cmd/to.rs Adds parquet subcommand docs/args and implements CSV→Parquet conversion using Polars.
src/main.rs Updates the to command description in the command list to include Parquet.
tests/test_to.rs Adds #[cfg(feature = "polars")] tests exercising the new to parquet behavior.

Fix XOR bug (768^2→768*768), add Windows-safe --table validation,
fix empty-stdin error message, implement --all-strings support,
add output collision detection, clarify usage placeholder and help text,
conditionally show Parquet in main help, and improve test assertions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

jqnatividad and others added 3 commits April 3, 2026 12:35
Revert <parquet_dir> back to <parquet> — docopt couldn't map the
underscore placeholder to the struct field. Fix scan_parquet call
to use PlRefPath as required by Polars API.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Validate gzip compression level (1-9) before casting to u8,
use IncorrectUsage error for invalid --compression values,
and enhance snappy compression test to verify parquet contents.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add range validation (1-22) for zstd compression level to match the
existing gzip validation pattern, producing a friendly error message
instead of an opaque library error.

Add tests for: invalid compression codec, out-of-range gzip level,
and out-of-range zstd level.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

jqnatividad and others added 4 commits April 3, 2026 12:59
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…p description

- Change "table/sheet/filename name" to "table/sheet/file name" in --table option docs
- Restore missing Parquet hyperlink in sqlp description in README for consistency

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jqnatividad jqnatividad merged commit 104cbf2 into master Apr 3, 2026
14 of 16 checks passed
@jqnatividad jqnatividad deleted the to-parquet-polars-powered branch April 3, 2026 17:16
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.

2 participants