[Feature](multi-catalog) Support hadoop viewfs. (#24168)
### Feature Support hadoop viewfs. ### Test - Regression tests: - hive viewfs test. - tvf viewfs test. - Broker load with broker and with hdfs tests manually.
This commit is contained in:
@ -50,6 +50,7 @@ public class StorageBackend implements ParseNode {
|
||||
if (!schema.equalsIgnoreCase("bos")
|
||||
&& !schema.equalsIgnoreCase("afs")
|
||||
&& !schema.equalsIgnoreCase("hdfs")
|
||||
&& !schema.equalsIgnoreCase("viewfs")
|
||||
&& !schema.equalsIgnoreCase("ofs")
|
||||
&& !schema.equalsIgnoreCase("obs")
|
||||
&& !schema.equalsIgnoreCase("oss")
|
||||
@ -58,8 +59,9 @@ public class StorageBackend implements ParseNode {
|
||||
&& !schema.equalsIgnoreCase("gfs")
|
||||
&& !schema.equalsIgnoreCase("jfs")
|
||||
&& !schema.equalsIgnoreCase("gs")) {
|
||||
throw new AnalysisException("Invalid broker path. please use valid 'hdfs://', 'afs://' , 'bos://',"
|
||||
+ " 'ofs://', 'obs://', 'oss://', 's3a://', 'cosn://', 'gfs://', 'gs://' or 'jfs://' path.");
|
||||
throw new AnalysisException("Invalid broker path. please use valid 'hdfs://', 'viewfs://', 'afs://',"
|
||||
+ " 'bos://', 'ofs://', 'obs://', 'oss://', 's3a://', 'cosn://', 'gfs://', 'gs://'"
|
||||
+ " or 'jfs://' path.");
|
||||
}
|
||||
} else if (type == StorageBackend.StorageType.S3 && !schema.equalsIgnoreCase("s3")) {
|
||||
throw new AnalysisException("Invalid export path. please use valid 's3://' path.");
|
||||
|
||||
@ -88,6 +88,7 @@ public class FeConstants {
|
||||
public static String FS_PREFIX_GFS = "gfs";
|
||||
public static String FS_PREFIX_JFS = "jfs";
|
||||
public static String FS_PREFIX_HDFS = "hdfs";
|
||||
public static String FS_PREFIX_VIEWFS = "viewfs";
|
||||
public static String FS_PREFIX_FILE = "file";
|
||||
public static final String INTERNAL_DB_NAME = "__internal_schema";
|
||||
public static String TEMP_MATERIZLIZE_DVIEW_PREFIX = "internal_tmp_materialized_view_";
|
||||
|
||||
@ -65,7 +65,8 @@ public class FileSystemFactory {
|
||||
} else {
|
||||
fsType = FileSystemType.S3;
|
||||
}
|
||||
} else if (location.startsWith(FeConstants.FS_PREFIX_HDFS) || location.startsWith(FeConstants.FS_PREFIX_GFS)) {
|
||||
} else if (location.startsWith(FeConstants.FS_PREFIX_HDFS) || location.startsWith(FeConstants.FS_PREFIX_GFS)
|
||||
|| location.startsWith(FeConstants.FS_PREFIX_VIEWFS)) {
|
||||
fsType = FileSystemType.DFS;
|
||||
} else if (location.startsWith(FeConstants.FS_PREFIX_OFS) || location.startsWith(FeConstants.FS_PREFIX_COSN)) {
|
||||
// ofs:// and cosn:// use the same underlying file system: Tencent Cloud HDFS, aka CHDFS)) {
|
||||
|
||||
@ -484,6 +484,8 @@ public abstract class FileQueryScanNode extends FileScanNode {
|
||||
return Optional.of(TFileType.FILE_S3);
|
||||
} else if (location.startsWith(FeConstants.FS_PREFIX_HDFS)) {
|
||||
return Optional.of(TFileType.FILE_HDFS);
|
||||
} else if (location.startsWith(FeConstants.FS_PREFIX_VIEWFS)) {
|
||||
return Optional.of(TFileType.FILE_HDFS);
|
||||
} else if (location.startsWith(FeConstants.FS_PREFIX_COSN)) {
|
||||
return Optional.of(TFileType.FILE_HDFS);
|
||||
} else if (location.startsWith(FeConstants.FS_PREFIX_FILE)) {
|
||||
|
||||
Reference in New Issue
Block a user