The GitHub Actions job "Running Copilot Code Review" on texera.git/main has 
failed.
Run started by GitHub user Copilot (triggered by Copilot).

Head commit for run:
74264313370d747ac748300f0bbbb780297d7e65 / Xinyuan Lin <[email protected]>
fix(workflow-core): resolve Windows drive paths as local files (#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)

Report URL: https://github.com/apache/texera/actions/runs/38758556946

With regards,
GitHub Actions via GitBox

Reply via email to