This is an automated email from the ASF dual-hosted git repository.

morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 26e332c6084 [fix](multi-catalog)add exception for unsupported hive 
input format (#25490)
26e332c6084 is described below

commit 26e332c6084f685b827ca93eca3fac19301800ef
Author: slothever <18522955+w...@users.noreply.github.com>
AuthorDate: Tue Oct 17 22:53:53 2023 +0800

    [fix](multi-catalog)add exception for unsupported hive input format (#25490)
    
    add exception for unsupported hive input format
---
 .../org/apache/doris/catalog/external/HMSExternalTable.java    | 10 ++++++++--
 .../external_table_p2/hive/test_external_catalog_hive.groovy   |  7 +++++++
 2 files changed, 15 insertions(+), 2 deletions(-)

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 1f98ebad131..361d278f8ac 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
@@ -198,9 +198,15 @@ public class HMSExternalTable extends ExternalTable {
      */
     private boolean supportedHiveTable() {
         String inputFileFormat = remoteTable.getSd().getInputFormat();
-        boolean supportedFileFormat = inputFileFormat != null && 
SUPPORTED_HIVE_FILE_FORMATS.contains(inputFileFormat);
+        if (inputFileFormat == null) {
+            return false;
+        }
+        boolean supportedFileFormat = 
SUPPORTED_HIVE_FILE_FORMATS.contains(inputFileFormat);
+        if (!supportedFileFormat) {
+            throw new IllegalArgumentException("Unsupported hive input format: 
" + inputFileFormat);
+        }
         LOG.debug("hms table {} is {} with file format: {}", name, 
remoteTable.getTableType(), inputFileFormat);
-        return supportedFileFormat;
+        return true;
     }
 
     /**
diff --git 
a/regression-test/suites/external_table_p2/hive/test_external_catalog_hive.groovy
 
b/regression-test/suites/external_table_p2/hive/test_external_catalog_hive.groovy
index e02de026287..855f17f7505 100644
--- 
a/regression-test/suites/external_table_p2/hive/test_external_catalog_hive.groovy
+++ 
b/regression-test/suites/external_table_p2/hive/test_external_catalog_hive.groovy
@@ -109,6 +109,13 @@ suite("test_external_catalog_hive", 
"p2,external,hive,external_remote,external_r
         qt_par_fields_in_file_orc5 """ select * from 
multi_catalog.par_fields_in_file_orc where month = 8 and year = 2022 order by 
id; """
         qt_par_fields_in_file_parquet5 """ select * from 
multi_catalog.par_fields_in_file_parquet where month = 8 and year = 2022 order 
by id; """
 
+        // test unsupported input format query
+        try {
+            sql """ select * from 
multi_catalog.unsupported_input_format_empty; """
+        } catch (Exception e) {
+            assertTrue(e.getMessage().contains("Unsupported hive input format: 
com.hadoop.mapred.DeprecatedLzoTextInputFormat"))
+        }
+
         // test remember last used database after switch / rename catalog
         sql """switch ${catalog_name};"""
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to