[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
This commit is contained in:
@ -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) {
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user