morrySnow commented on code in PR #24990:
URL: https://github.com/apache/doris/pull/24990#discussion_r1339754513
##########
fe/fe-core/src/main/java/org/apache/doris/analysis/Expr.java:
##########
@@ -333,6 +337,15 @@ public void setId(ExprId id) {
this.id = id;
}
+ // Name of expr, this is used by generating column name automatically when
there is no
+ // alias or is not slotRef
+ protected String getExprName() {
+ if (StringUtils.isEmpty(this.exprName)) {
+ return Expression.DEFAULT_COLUMN_NAME;
Review Comment:
ditto
##########
fe/fe-core/src/main/java/org/apache/doris/analysis/AnalyticExpr.java:
##########
@@ -144,6 +145,11 @@ public AnalyticWindow getWindow() {
return window;
}
+ @Override
+ protected String getExprName() {
+ return Expression.normalizeColumnName(getFnCall().getExprName());
Review Comment:
this function should in `org.apache.doris.catalog.Column` or under
org.apache.doris.common package
##########
fe/fe-core/src/main/java/org/apache/doris/analysis/SelectListItem.java:
##########
@@ -132,6 +134,22 @@ public String toColumnLabel() {
return expr.toColumnLabel();
}
+ /**
+ * Return a column label for the select list item. Support to generate
+ * column label automatically when can not get the column label exactly.
+ * Need the position of selectListItem to generate column label
+ */
+ public String toColumnLabel(int position) {
+ Preconditions.checkState(!isStar());
Review Comment:
add check msg
--
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]