[Enhance](multi-catalog) parse hive view ddl first to avoid NPE. (#28067)
This commit is contained in:
@ -39,6 +39,7 @@ import org.apache.doris.common.ErrorCode;
|
||||
import org.apache.doris.common.ErrorReport;
|
||||
import org.apache.doris.common.IdGenerator;
|
||||
import org.apache.doris.common.Pair;
|
||||
import org.apache.doris.common.UserException;
|
||||
import org.apache.doris.common.util.TimeUtils;
|
||||
import org.apache.doris.planner.AggregationNode;
|
||||
import org.apache.doris.planner.AnalyticEvalNode;
|
||||
@ -852,6 +853,13 @@ public class Analyzer {
|
||||
View hmsView = new View(table.getId(), table.getName(), table.getFullSchema());
|
||||
hmsView.setInlineViewDefWithSqlMode(((HMSExternalTable) table).getViewText(),
|
||||
ConnectContext.get().getSessionVariable().getSqlMode());
|
||||
// for user experience consideration, parse hive view ddl first to avoid NPE
|
||||
// if legacy parser can not parse hive view ddl properly
|
||||
try {
|
||||
hmsView.init();
|
||||
} catch (UserException e) {
|
||||
throw new AnalysisException(e.getMessage(), e);
|
||||
}
|
||||
InlineViewRef inlineViewRef = new InlineViewRef(hmsView, tableRef);
|
||||
if (StringUtils.isNotEmpty(tableName.getCtl())) {
|
||||
inlineViewRef.setExternalCtl(tableName.getCtl());
|
||||
|
||||
Reference in New Issue
Block a user