Github user HyukjinKwon commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16397#discussion_r93829539
  
    --- Diff: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveCommandSuite.scala
 ---
    @@ -221,7 +223,7 @@ class HiveCommandSuite extends QueryTest with 
SQLTestUtils with TestHiveSingleto
           // file://path/to/data/files/employee.dat
           //
           // TODO: need a similar test for non-local mode.
    -      if (local) {
    +      if (local && !Utils.isWindows) {
    --- End diff --
    
    This is being skipped because `incorrectUri` below becomes 
`file://path/to/data/files/employee.dat` (or 
`file://C:/path/to/data/files/employee.dat` on Windows).
    This seems checking if the file exists or not with `uri.getPath` assuming 
from 
[tables.scala#L223-L248](https://github.com/apache/spark/blob/5572ccf86b084eb5938fe62fd5d9973ec14d555d/sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala#L223-L248).
    
    In Linux/Mac, it seems `uri.getPath` becomes `/to/data/files/employee.dat` 
where as `/path/to/data/files/employee.dat` on Windows.
    
    The former path does not exists on Linux/Mac but the latter on Windows 
seems fine as the path seems correctly implicitly adding `C:`, meaning on 
Windows, these below seem fine:
    
    ```scala
    new File("/C:/a/b/c").exists
    new File("/a/b/c").exists
    ```
    
    Therefore, the test below: 
    
    ```
    intercept[AnalysisException] {
       sql(s"""LOAD DATA LOCAL INPATH "$incorrectUri" INTO TABLE 
non_part_table""")
    }
    ```
    
    dose not throw an exception on Windows because `incoorectURI` seems fine in 
this path. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to