Marc Prud'hommeaux created CALCITE-2034:
-------------------------------------------

             Summary: FileReaderTest fails with path containing spaces
                 Key: CALCITE-2034
                 URL: https://issues.apache.org/jira/browse/CALCITE-2034
             Project: Calcite
          Issue Type: Bug
    Affects Versions: 1.15.0
            Reporter: Marc Prud'hommeaux
            Assignee: Julian Hyde
            Priority: Minor


When a path has spaces in it, the FileReaderTest.java test fails with the error:

{{
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; 
support was removed in 8.0
Running org.apache.calcite.adapter.file.FileReaderTest
directory 
/home/jenkins/jenkins-slave/workspace/Calcite-Master/jdk/JDK%201.8%20(latest)/file/target/test-classes/sales-csv
 not found
Tests run: 13, Failures: 0, Errors: 1, Skipped: 2, Time elapsed: 3.364 sec <<< 
FAILURE! - in org.apache.calcite.adapter.file.FileReaderTest
testCsvFile(org.apache.calcite.adapter.file.FileReaderTest)  Time elapsed: 
0.027 sec  <<< ERROR!
java.sql.SQLException: Error while executing SQL "select * from FILES.DEPTS": 
From line 1, column 15 to line 1, column 25: Object 'DEPTS' not found within 
'FILES'
        at 
org.apache.calcite.adapter.file.FileReaderTest.testCsvFile(FileReaderTest.java:228)
Caused by: org.apache.calcite.runtime.CalciteContextException: From line 1, 
column 15 to line 1, column 25: Object 'DEPTS' not found within 'FILES'
        at 
org.apache.calcite.adapter.file.FileReaderTest.testCsvFile(FileReaderTest.java:228)
Caused by: org.apache.calcite.sql.validate.SqlValidatorException: Object 
'DEPTS' not found within 'FILES'
        at 
org.apache.calcite.adapter.file.FileReaderTest.testCsvFile(FileReaderTest.java:228)
}}

This can cause the Jenkins build to fail (e.g.: 
https://builds.apache.org/job/Calcite-Master/jdk=JDK%201.8%20(latest)/131/console).

The offending method is FileReaderTest.resourcePath, which creates a oath 
reference from URL.toString, but toString percent-encodes space characters. 
When it is subsequently turned into a file, it isn't found.

A solution might be to create the file reference with new File(url.toURI()).




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to