From 50dba711bae3a57c6825df1c9f028f7797c6d2b3 Mon Sep 17 00:00:00 2001 From: slothever <18522955+wsjz@users.noreply.github.com> Date: Thu, 28 Dec 2023 22:38:45 +0800 Subject: [PATCH] [fix](multi-catalog)unsupported hive input format should throw an exception and remove useless method. (#29228) from: #29087 --- .../doris/catalog/external/HMSExternalTable.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/external/HMSExternalTable.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/external/HMSExternalTable.java index 6937ba944f5c69..bbadac6ecbf7b1 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/catalog/external/HMSExternalTable.java +++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/external/HMSExternalTable.java @@ -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; } /**