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 (apache#29087)

introduce from: apache#28644
  • Loading branch information
wsjz authored and HappenLee committed Jan 12, 2024
1 parent 13acf57 commit beafb79
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 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,22 @@ public boolean isHoodieCowTable() {
* Support managed_table and external_table.
*/
private boolean supportedHiveTable() {
// we will return false if null, which means that the table type maybe unsupported.
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) {
// for easier debugging, need return error message if unsupported input format is used.
// NotSupportedException is required by some operation.
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
10 changes: 0 additions & 10 deletions fe/fe-core/src/main/java/org/apache/doris/common/util/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.apache.doris.catalog.Column;
import org.apache.doris.catalog.PrimitiveType;
import org.apache.doris.common.AnalysisException;
import org.apache.doris.common.Config;
import org.apache.doris.common.FeNameFormat;
import org.apache.doris.datasource.InternalCatalog;
import org.apache.doris.qe.ConnectContext;
Expand Down Expand Up @@ -513,15 +512,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 beafb79

Please sign in to comment.