8000 Add support for `WRITE_EMPTY_FILE` option to `COPY` - which allows skipping of writing empty files by Mytherin · Pull Request #16737 · duckdb/duckdb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add support for WRITE_EMPTY_FILE option to COPY - which allows skipping of writing empty files #16737

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

Merged
merged 2 commits into from
Mar 20, 2025

Conversation

Mytherin
Copy link
Collaborator

By default, COPY writes an empty file when no rows are supplied. The new WRITE_EMPTY_FILE option allows this behavior to be controlled. If WRITE_EMPTY_FILE false is supplied - and no rows are submitted to the COPY command - nothing is written to disk.

For example:

D copy (select 42 limit 0) to 'file.parquet' (RETURN_FILES);
┌───────┬────────────────┐
│ Count │     Files      │
│ int64 │   varchar[]    │
├───────┼────────────────┤
│   0   │ [file.parquet] │
└───────┴────────────────┘
D copy (select 42 limit 0) to 'file.parquet' (RETURN_FILES, WRITE_EMPTY_FILE false);
┌───────┬───────────┐
│ Count │   Files   │
│ int64 │ varchar[] │
├───────┼───────────┤
│   0   │ []        │
└───────┴───────────┘

< 8000 div data-view-component="true" class="TimelineItem TimelineItem--condensed">
@Mytherin Mytherin merged commit 6e4e480 into duckdb:main Mar 20, 2025
48 checks passed
@Mytherin Mytherin deleted the skipemptyfilewrite branch April 2, 2025 09:23
krlmlr added a commit to duckdb/duckdb-r that referenced this pull request May 15, 2025
Add support for `WRITE_EMPTY_FILE` option to `COPY` - which allows skipping of writing empty files (duckdb/duckdb#16737)
krlmlr added a commit to duckdb/duckdb-r that referenced this pull request May 15, 2025
Add support for `WRITE_EMPTY_FILE` option to `COPY` - which allows skipping of writing empty files (duckdb/duckdb#16737)
krlmlr added a commit to duckdb/duckdb-r that referenced this pull request May 16, 2025
Add support for `WRITE_EMPTY_FILE` option to `COPY` - which allows skipping of writing empty files (duckdb/duckdb#16737)
krlmlr added a commit to duckdb/duckdb-r that referenced this pull request May 16, 2025
Add support for `WRITE_EMPTY_FILE` option to `COPY` - which allows skipping of writing empty files (duckdb/duckdb#16737)
krlmlr added a commit to duckdb/duckdb-r that referenced this pull request May 17, 2025
Add support for `WRITE_EMPTY_FILE` option to `COPY` - which allows skipping of writing empty files (duckdb/duckdb#16737)
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.

1 participant
0