aglinxinyuan opened a new issue, #8949:
URL: https://github.com/apache/texera/issues/8949

   ### What happened?
   
   On Windows, a File Scan given an absolute local path with forward slashes 
(`C:/Users/me/data/a.txt`) fails in the worker with:
   
   ```
   Unsupported URI scheme: C for creating the ReadonlyDocument
   ```
   
   **Root cause.** `FileResolver.resolve` first asks 
`isFileResolved(fileName)`, which returns true for any string whose 
`java.net.URI` scheme is non-empty. `new URI("C:/Users/me/data/a.txt")` parses 
the drive letter `C` as the scheme. So `resolve` returns the path unchanged 
instead of falling through to the local resolver, which would give 
`file:///C:/Users/me/data/a.txt`. `DocumentFactory` then has no handler for 
scheme `C`.
   
   ```
   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
   ```
   
   | Operator | Where it fails |
   | --- | --- |
   | File Scan | worker (`FileScanSourceOpExec`) |
   | File Scan From Input | worker, per tuple (`FileScanOpExec`) |
   | CSV / Parallel CSV / CSVOld / JSONL / Arrow File Scan | compilation, 
during schema inference |
   
   The backslash form (`C:\data\a.txt`) is not affected: a backslash is illegal 
in a URI, so it never parsed as one.
   
   **Fix.** Treat a one-letter scheme as a Windows drive letter, not a URI 
scheme, so such paths reach the local resolver. Real URIs (`file:`, `s3:`, 
`vfs:`, `dataset:`, `https:` ...) stay resolved.
   
   ### How to reproduce?
   
   On Windows, with a local stack running:
   
   1. Add a File Scan operator whose file is an absolute local path written 
with forward slashes, e.g. `C:/Users/me/data/a.txt`.
   2. Run the workflow.
   3. The worker fails with `Unsupported URI scheme: C for creating the 
ReadonlyDocument`. A CSV File Scan with the same path reports the error at 
compilation instead.
   
   Or directly: `FileResolver.isFileResolved("C:/x/y.txt")` returns `true`, and 
`FileResolver.resolve("C:/<existing file>")` returns a URI with scheme `C` 
instead of a `file` URI.
   
   ### Version/Branch
   
   1.4.0-incubating-SNAPSHOT (main), adc6a4ac4d
   


-- 
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]

Reply via email to