You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2023/12/14 09:27:12 UTC
(doris) branch branch-2.0 updated: [Enhance](multi-catalog) parse hive view ddl first to avoid NPE. (#28067) (#28400)
This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new c411ccc310f [Enhance](multi-catalog) parse hive view ddl first to avoid NPE. (#28067) (#28400)
c411ccc310f is described below
commit c411ccc310fe23fd82f1eeea08798e83c4de3e83
Author: Mingyu Chen <mo...@163.com>
AuthorDate: Thu Dec 14 17:27:05 2023 +0800
[Enhance](multi-catalog) parse hive view ddl first to avoid NPE. (#28067) (#28400)
Co-authored-by: Xiangyu Wang <du...@gmail.com>
---
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 4648da86abd..a5e2f904b18 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;
@@ -833,6 +834,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: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org