Closed baitian77 closed 1 week ago
@baitian77 Hi, I think your example and the error message do not exactly match. In your example the fileset virtual path is gvfs://fileset/catalog/schema/hdfs_fileset_1/jstack-21727
, this will parse the file catalog name to the catalog
, which not the user
in the exception.
According to the exception, I think you do not create the user
fileset catalog firstly.
Besides, rm
command deleting to trash should be the default logic of hadoop delete shell command. If you do not need to delete it to trash, you can add a parameter: -skipTrash
like hadoop dfs -rm -skipTrash gvfs://fileset/{catalog}/{schema}/{fileset_name}/sub_dir
.
Besides,
rm
command deleting to trash should be the default logic of hadoop delete shell command. If you do not need to delete it to trash, you can add a parameter:-skipTrash
likehadoop dfs -rm -skipTrash gvfs://fileset/{catalog}/{schema}/{fileset_name}/sub_dir
.
@xloya To ensure data security, the-skipTrash
option has been forcibly disabled, so deleted data will first go to the trash to prevent accidental deletion. How can fileset be compatible with the hadoop fs -rm
command? thanks
Besides,
rm
command deleting to trash should be the default logic of hadoop delete shell command. If you do not need to delete it to trash, you can add a parameter:-skipTrash
likehadoop dfs -rm -skipTrash gvfs://fileset/{catalog}/{schema}/{fileset_name}/sub_dir
.@xloya To ensure data security, the
-skipTrash
option has been forcibly disabled, so deleted data will first go to the trash to prevent accidental deletion. How can fileset be compatible with thehadoop fs -rm
command? thanks
Hi, if you could not use -skipTrash
option, I think there may not have a way to delete directly unless you modified the hadoop source code about rm
command.
Another option is to use Hadoop FileSystem to delete in Java / Scala code. I think this will delete the directory or file directly instead of deleting it to trash:
import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
public class Test {
public static void main(String[] args) throws IOException {
Path filesetPath = new Path("gvfs://fileset/{your_catalog}/{your_schema}/{your_fileset}/sub_path");
try (FileSystem fs = filesetPath.getFileSystem(new Configuration())) {
fs.delete(filesetPath, true);
}
}
}
Besides,
rm
command deleting to trash should be the default logic of hadoop delete shell command. If you do not need to delete it to trash, you can add a parameter:-skipTrash
likehadoop dfs -rm -skipTrash gvfs://fileset/{catalog}/{schema}/{fileset_name}/sub_dir
.@xloya To ensure data security, the
-skipTrash
option has been forcibly disabled, so deleted data will first go to the trash to prevent accidental deletion. How can fileset be compatible with thehadoop fs -rm
command? thanksHi, if you could not use
-skipTrash
option, I think there may not have a way to delete directly unless you modified the hadoop source code aboutrm
command. Another option is to use Hadoop FileSystem to delete in Java / Scala code. I think this will delete the directory or file directly instead of deleting it to trash:import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; public class Test { public static void main(String[] args) throws IOException { Path filesetPath = new Path("gvfs://fileset/{your_catalog}/{your_schema}/{your_fileset}/sub_path"); try (FileSystem fs = filesetPath.getFileSystem(new Configuration())) { fs.delete(filesetPath, true); } } }
Sure, thank you for your response.
Version
0.6.0
Describe what's wrong
Error message and/or stacktrace
-rm: Fatal internal error
java.lang.RuntimeException: Cannot load fileset: metalake_stg01.user.root..Trash from the server. exception: Failed to operate catalog(s) [user] operation [LOAD] under metalake [metalake_stg01], reason [Catalog metalake_stg01.user does not exist]
How to reproduce
Additional context
No response