Jefffrey commented on issue #7877:
URL:
https://github.com/apache/arrow-datafusion/issues/7877#issuecomment-1786818871
Minimum example:
```rust
use datafusion::error::Result;
use datafusion::prelude::*;
#[tokio::main]
async fn main() -> Result<()> {
let ctx = SessionContext::new();
ctx.read_csv(
"/home/jeffrey/tmp%123/test.csv",
CsvReadOptions::new(),
)
.await?
.show()
.await?;
Ok(())
}
```
Running this throws error:
```
Error: ObjectStore(NotFound { path: "/home/jeffrey/tmp%25123/test.csv",
source: Os { code: 2, kind: NotFound, message: "No such file or directory" } })
```
This can be avoided by specifying the `file://` scheme:
```rust
use datafusion::error::Result;
use datafusion::prelude::*;
#[tokio::main]
async fn main() -> Result<()> {
let ctx = SessionContext::new();
ctx.read_csv(
"file:///home/jeffrey/tmp%123/test.csv", // <-- here
CsvReadOptions::new(),
)
.await?
.show()
.await?;
Ok(())
}
```
(This can be reproduced for parquet as well)
Cause seems to be here:
https://github.com/apache/arrow-datafusion/blob/d8e413c0b92b86593ed9801a034bd62bdb9ddc0b/datafusion/core/src/datasource/listing/url.rs#L80-L93
Specifically, if `Self::parse_path(...)` is called then it will URL encode
the input path (`%25` is url encode of `%`).
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]