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. (#29228)

from: #29087
  • Loading branch information
wsjz authored Dec 28, 2023
1 parent 1aec800 commit 50dba71
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,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

0 comments on commit 50dba71

Please sign in to comment.