You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "Jefffrey (via GitHub)" <gi...@apache.org> on 2026/01/31 05:22:30 UTC
Re: [I] DataFrame write api should accept Overwrite option when the file already exist [datafusion]
Jefffrey commented on issue #4986:
URL: https://github.com/apache/datafusion/issues/4986#issuecomment-3827541246
The existing API is a bit confusing on what it really does; given this example program:
```rust
let df = ctx.sql("select 1 as a").await?;
df.write_csv(
"test.csv",
DataFrameWriteOptions::default().with_insert_operation(InsertOp::Append),
None,
)
.await?;
```
- `Append` is already the default, just setting here to be explicit
Each time we run this, it will seemingly overwrite the CSV file, even though it is an append operation. If we replace `Append` with `Overwrite` or `Replace` it'll throw an error about it not being implemented.
I don't know what the target state should look like and what these APIs should do, so some research/analysis would be good, but I can say as it is the API does seem a bit confusing. I haven't tested `write_parquet` or `write_json` but it's worth reviewing those too.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org