This is an automated email from the ASF dual-hosted git repository. yiguolei pushed a commit to branch branch-2.1 in repository https://gitbox.apache.org/repos/asf/doris.git
commit 103987ebd8432a9995dae0086a366b9da674f6e6 Author: Mingyu Chen <morning...@163.com> AuthorDate: Wed Apr 24 21:44:07 2024 +0800 [fix](parse) set origin stmt for select stmt generated from show stmt (#34015) * [fix](parse) set origin stmt for select stmt generated from show stmt * 2 --- .../main/java/org/apache/doris/datasource/hive/HMSExternalTable.java | 4 ++-- fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) 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 38556682ee0..e29bafd5dc7 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 031062fbd76..be328bb1242 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); } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org