Skip to content

Commit

Permalink
[fix](multi-catalog)unsupported hive input format should throw an exc…
Browse files Browse the repository at this point in the history
…eption and remove useless method
  • Loading branch information
wsjz committed Dec 26, 2023
1 parent f371528 commit 982349f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1679,12 +1679,6 @@ public class Config extends ConfigBase {
@ConfField(mutable = true)
public static boolean enable_decimal_conversion = true;

/**
* List of S3 API compatible object storage systems.
*/
@ConfField
public static String s3_compatible_object_storages = "s3,oss,cos,bos";

/**
* Support complex data type ARRAY.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,19 @@ public boolean isHoodieCowTable() {
* Support managed_table and external_table.
*/
private boolean supportedHiveTable() {
if (remoteTable.getSd() == null) {
return false;
}
String inputFileFormat = remoteTable.getSd().getInputFormat();
if (inputFileFormat == null) {
return false;
}
boolean supportedFileFormat = SUPPORTED_HIVE_FILE_FORMATS.contains(inputFileFormat);
if (!supportedFileFormat) {
throw new NotSupportedException("Unsupported hive input format: " + inputFileFormat);
}
LOG.debug("hms table {} is {} with file format: {}", name, remoteTable.getTableType(), inputFileFormat);
return SUPPORTED_HIVE_FILE_FORMATS.contains(inputFileFormat);
return true;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,15 +513,6 @@ public static void prohibitExternalCatalog(String catalog, String msg) throws An
}
}

public static boolean isS3CompatibleStorageSchema(String schema) {
for (String objectStorage : Config.s3_compatible_object_storages.split(",")) {
if (objectStorage.equalsIgnoreCase(schema)) {
return true;
}
}
return false;
}

private static final char[] HEX_ARRAY = "0123456789ABCDEF".toCharArray();

public static String bytesToHex(byte[] bytes) {
Expand Down

0 comments on commit 982349f

Please sign in to comment.