morningman commented on code in PR #27231:
URL: https://github.com/apache/doris/pull/27231#discussion_r1413127339


##########
fe/fe-core/src/main/java/org/apache/doris/analysis/InlineViewRef.java:
##########
@@ -186,7 +189,13 @@ public void analyze(Analyzer analyzer) throws 
AnalysisException, UserException {
         }
 
         if (view == null && !hasExplicitAlias()) {
-            
ErrorReport.reportAnalysisException(ErrorCode.ERR_DERIVED_MUST_HAVE_ALIAS);
+            String dialect = 
ConnectContext.get().getSessionVariable().getSqlDialect();
+            ParseDialect.Dialect sqlDialect = 
ParseDialect.Dialect.getByName(dialect);
+            if (ParseDialect.Dialect.SPARK_SQL != sqlDialect) {
+                
ErrorReport.reportAnalysisException(ErrorCode.ERR_DERIVED_MUST_HAVE_ALIAS);
+            }
+            hasExplicitAlias = true;
+            aliases = new String[] { 
SparkSql3LogicalPlanBuilder.DEFAULT_TABLE_ALIAS };

Review Comment:
   `DEFAULT_TABLE_ALIAS` is a fixed name?
   What if there are 2 more inline views? Do they have same alias?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to