xloya commented on code in PR #4592:
URL: https://github.com/apache/gravitino/pull/4592#discussion_r1728212383
##########
clients/filesystem-hadoop3/src/test/java/org/apache/gravitino/filesystem/hadoop/TestGvfsBase.java:
##########
@@ -607,4 +651,52 @@ public void testGetDefaultBlockSize() throws IOException {
assertEquals(32 * 1024 * 1024,
fs.getDefaultBlockSize(managedFilesetPath));
}
}
+
+ @Test
+ public void testConvertFileStatusPathPrefix() throws IOException {
+ try (GravitinoVirtualFileSystem fs =
+ (GravitinoVirtualFileSystem) managedFilesetPath.getFileSystem(conf)) {
+ FileStatus fileStatus =
+ new FileStatus(1024, false, 1, 32 * 1024 * 1024, 1024, new
Path("hdfs://hive:9000/test"));
+ // storage location end with "/"
+ String storageLocation = "hdfs://hive:9000/";
+ String virtualLocation = "gvfs://fileset/test_catalog/tmp/test_fileset";
Review Comment:
Yeah, we support this case. Because the virtual location we concat is in a
format similar to "gvfs://fileset/catalog/tmp/test_fileset", no matter whether
the virtual path actually accessed has a trailing slash or not, it can be
replaced correctly as long as the storage location is handled correctly.
Actually when we use `new
Path("gvfs://fileset/test_catalog/tmp/test_fileset/")`, the tailing slash will
be truncated by Hadoop path class.
--
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]