aglinxinyuan opened a new pull request, #8950:
URL: https://github.com/apache/texera/pull/8950
### What changes were proposed in this PR?
`FileResolver.isFileResolved` no longer counts a one-letter `java.net.URI`
scheme as "already a URI". A one-letter scheme is a Windows drive letter, so
`C:/Users/me/a.txt` now falls through to the local resolver and becomes
`file:///C:/Users/me/a.txt`.
**Root cause.** `isFileResolved` returned true for any non-empty scheme, and
`new URI("C:/Users/me/a.txt")` parses `C` as the scheme. `resolve` therefore
returned the path unchanged, and `DocumentFactory` rejected it with
`Unsupported URI scheme: C for creating the ReadonlyDocument`. File Scan hit
this in the worker; the CSV / JSONL / Arrow scans hit it at compilation, during
schema inference.
```
Before: "C:/data/a.txt" -> isFileResolved = true -> URI "C:/data/a.txt"
-> Unsupported URI scheme: C
After: "C:/data/a.txt" -> isFileResolved = false -> local resolver ->
"file:///C:/data/a.txt" -> read
```
Every scheme Texera produces or reads (`file`, `dataset`, `model`, `vfs`,
`s3`, `https`, ...) has more than one letter, so those are still treated as
resolved. The backslash form `C:\data\a.txt` was never affected: a backslash is
illegal in a URI.
### Any related issues, documentation, discussions?
Closes #8949
### How was this PR tested?
New cases in `FileResolverSpec`:
| Input | Pinned behavior |
| --- | --- |
| `C:/x/y.txt`, `c:/x/y.txt`, `C:\x\y.txt` | `isFileResolved` is false |
| `s3://`, `dataset:///`, `file:///C:/...`, `file:/tmp/...`, `vfs:///`,
`https://` | `isFileResolved` is true |
| an existing temp file's absolute path, written with `/` | `resolve`
returns that file's `file` URI |
| `C:/x/y.txt` (does not exist) | `resolve` throws `FileNotFoundException`
instead of returning `URI("C:/x/y.txt")` |
Before the fix, the `C:/x/y.txt` cases (`isFileResolved` and `resolve`)
failed on every OS. The temp-file case failed on Windows, where the path starts
with a drive letter.
```
sbt "WorkflowCore/testOnly *FileResolver*" # 26 passed
sbt scalafmtCheckAll "WorkflowCore/scalafixAll --check"
```
Callers that go through `resolve` / `fileResolved()` also pass locally:
`WorkflowCompiler/testOnly *LogicalPlanSpec *WorkflowCompilerSpec` (60 passed),
and `WorkflowOperator/testOnly *ScanSourceOpDescSpec *TestOperatorsSpec
*FileScanSourceOpDescSpec *CSVScanSourceOpDescSpec *JSONLScanSourceOpDescSpec
*FileScanOpExecSpec` (78 of 79 passed). The one failure is
`FileScanSourceOpDescSpec`'s UTF-16 test. On Windows it cannot delete its temp
file while the reader is still open, and it fails the same way without this
change.
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 5.5)
--
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]