This is an automated email from the ASF dual-hosted git repository.
yiguolei 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 16230b5ebd3 [Enhance](multi-catalog) parse hive view ddl first to
avoid NPE. (#28067)
16230b5ebd3 is described below
commit 16230b5ebd38b47c3c6f656a2508662bbf9a44ff
Author: Xiangyu Wang <[email protected]>
AuthorDate: Fri Dec 8 13:54:50 2023 +0800
[Enhance](multi-catalog) parse hive view ddl first to avoid NPE. (#28067)
---
fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java
index 4e648bf1db5..8cd98760f73 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java
@@ -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());
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]