diff --git a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSExternalTable.java b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSExternalTable.java index 38556682ee..e29bafd5dc 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSExternalTable.java +++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSExternalTable.java @@ -268,11 +268,11 @@ public class HMSExternalTable extends ExternalTable implements MTMVRelatedTableI private boolean supportedHiveTable() { // we will return false if null, which means that the table type maybe unsupported. if (remoteTable.getSd() == null) { - return false; + throw new NotSupportedException("remote table's storage descriptor is null"); } String inputFileFormat = remoteTable.getSd().getInputFormat(); if (inputFileFormat == null) { - return false; + throw new NotSupportedException("remote table's storage input format is null"); } boolean supportedFileFormat = SUPPORTED_HIVE_FILE_FORMATS.contains(inputFileFormat); if (!supportedFileFormat) { diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java index 031062fbd7..be328bb124 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java @@ -1110,6 +1110,9 @@ public class StmtExecutor { if (parsedStmt instanceof ShowStmt) { SelectStmt selectStmt = ((ShowStmt) parsedStmt).toSelectStmt(analyzer); if (selectStmt != null) { + // Need to set origin stmt for new "parsedStmt"(which is selectStmt here) + // Otherwise, the log printing may result in NPE + selectStmt.setOrigStmt(parsedStmt.getOrigStmt()); setParsedStmt(selectStmt); } }