This is an automated email from the ASF dual-hosted git repository.
dongjoon pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/orc.git
The following commit(s) were added to refs/heads/branch-2.1 by this push:
new e2381bd60 ORC-1913: Fix `TestColumnStatistics` to set `testFilePath`
with absolute path
e2381bd60 is described below
commit e2381bd60f90099db714861dc7708fe040c46587
Author: Dongjoon Hyun <[email protected]>
AuthorDate: Mon Jun 9 17:01:52 2025 -0700
ORC-1913: Fix `TestColumnStatistics` to set `testFilePath` with absolute
path
### What changes were proposed in this pull request?
This PR aims to fix `TestColumnStatistics` to set `testFilePath` with
absolute path.
### Why are the changes needed?
The test case is fragile because it depends on the assumption that new
FileSystem will be identical.
For example, it fails when we set `fs.file.impl.disable.cache=false`.
```
$ git diff
...
conf = new Configuration();
+ conf.set("fs.file.impl.disable.cache", "true");
fs = FileSystem.getLocal(conf);
$ mvn package --pl core -Dtest=TestColumnStatistics
...
[ERROR] Errors:
[ERROR] TestColumnStatistics.testDecimalMinMaxStatistics:695 ยป
FileNotFound File TestOrcFile.testDecimalMinMaxStatistics.orc does not exist
```
### How was this patch tested?
Pass the CIs with the updated code.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #2261 from dongjoon-hyun/ORC-1913.
Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
(cherry picked from commit ddc0c297a9e5d724aa25af644a4636a56eb88708)
Signed-off-by: Dongjoon Hyun <[email protected]>
---
java/core/src/test/org/apache/orc/TestColumnStatistics.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/java/core/src/test/org/apache/orc/TestColumnStatistics.java
b/java/core/src/test/org/apache/orc/TestColumnStatistics.java
index ddcbcdc1a..12dc152ed 100644
--- a/java/core/src/test/org/apache/orc/TestColumnStatistics.java
+++ b/java/core/src/test/org/apache/orc/TestColumnStatistics.java
@@ -753,9 +753,9 @@ public class TestColumnStatistics {
@BeforeEach
public void openFileSystem(TestInfo testInfo) throws Exception {
conf = new Configuration();
+ conf.set("fs.file.impl.disable.cache", "true");
fs = FileSystem.getLocal(conf);
- fs.setWorkingDirectory(workDir);
- testFilePath = new Path(
+ testFilePath = new Path(workDir + File.separator +
"TestOrcFile." + testInfo.getTestMethod().get().getName() + ".orc");
fs.delete(testFilePath, false);
}