You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by lu...@apache.org on 2023/06/17 00:34:33 UTC
[doris] branch master updated: [Fix](Error) fix some typo error in code (#20612)
This is an automated email from the ASF dual-hosted git repository.
luzhijing 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 e5015b472e [Fix](Error) fix some typo error in code (#20612)
e5015b472e is described below
commit e5015b472e268996d062ca282dd5e469d73beca9
Author: GoGoWen <82...@users.noreply.github.com>
AuthorDate: Sat Jun 17 08:34:26 2023 +0800
[Fix](Error) fix some typo error in code (#20612)
---
.../java/org/apache/doris/analysis/SelectStmt.java | 78 +++++++++++-----------
.../org/apache/doris/analysis/StmtRewriter.java | 6 +-
.../org/apache/doris/plugin/LoadAuditEvent.java | 2 +-
.../main/java/org/apache/doris/qe/QueryDetail.java | 6 +-
4 files changed, 46 insertions(+), 46 deletions(-)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/SelectStmt.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/SelectStmt.java
index 6114d4c00a..238ed47040 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/SelectStmt.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/SelectStmt.java
@@ -113,7 +113,7 @@ public class SelectStmt extends QueryStmt {
// having clause which has been analyzed
// For example: select k1, sum(k2) a from t group by k1 having a>1;
// this parameter: sum(t.k2) > 1
- private Expr havingClauseAfterAnaylzed;
+ private Expr havingClauseAfterAnalyzed;
// END: Members that need to be reset()
// ///////////////////////////////////////
@@ -182,8 +182,8 @@ public class SelectStmt extends QueryStmt {
originalWhereClause = (other.originalWhereClause != null) ? other.originalWhereClause.clone() : null;
groupByClause = (other.groupByClause != null) ? other.groupByClause.clone() : null;
havingClause = (other.havingClause != null) ? other.havingClause.clone() : null;
- havingClauseAfterAnaylzed =
- other.havingClauseAfterAnaylzed != null ? other.havingClauseAfterAnaylzed.clone() : null;
+ havingClauseAfterAnalyzed =
+ other.havingClauseAfterAnalyzed != null ? other.havingClauseAfterAnalyzed.clone() : null;
colLabels = Lists.newArrayList(other.colLabels);
aggInfo = (other.aggInfo != null) ? other.aggInfo.clone() : null;
@@ -208,7 +208,7 @@ public class SelectStmt extends QueryStmt {
if (havingClause != null) {
havingClause.reset();
}
- havingClauseAfterAnaylzed = null;
+ havingClauseAfterAnalyzed = null;
havingPred = null;
aggInfo = null;
analyticInfo = null;
@@ -227,8 +227,8 @@ public class SelectStmt extends QueryStmt {
if (havingPred != null) {
exprs.add(havingPred);
}
- if (havingClauseAfterAnaylzed != null) {
- exprs.add(havingClauseAfterAnaylzed);
+ if (havingClauseAfterAnalyzed != null) {
+ exprs.add(havingClauseAfterAnalyzed);
}
if (orderByElementsAfterAnalyzed != null) {
exprs.addAll(orderByElementsAfterAnalyzed.stream().map(orderByElement -> orderByElement.getExpr())
@@ -295,8 +295,8 @@ public class SelectStmt extends QueryStmt {
return havingPred;
}
- public Expr getHavingClauseAfterAnaylzed() {
- return havingClauseAfterAnaylzed;
+ public Expr getHavingClauseAfterAnalyzed() {
+ return havingClauseAfterAnalyzed;
}
public List<TableRef> getTableRefs() {
@@ -838,8 +838,8 @@ public class SelectStmt extends QueryStmt {
if (whereClause != null) {
whereClause.getIds(result, null);
}
- if (havingClauseAfterAnaylzed != null) {
- havingClauseAfterAnaylzed.getIds(result, null);
+ if (havingClauseAfterAnalyzed != null) {
+ havingClauseAfterAnalyzed.getIds(result, null);
}
return result;
}
@@ -1252,48 +1252,48 @@ public class SelectStmt extends QueryStmt {
// according to case3, column name do not exist, keep alias name inside alias map
}
}
- havingClauseAfterAnaylzed = havingClause.substitute(excludeAliasSMap, analyzer, false);
+ havingClauseAfterAnalyzed = havingClause.substitute(excludeAliasSMap, analyzer, false);
} else {
// If user set force using alias, then having clauses prefer using alias rather than column name
- havingClauseAfterAnaylzed = havingClause.substitute(aliasSMap, analyzer, false);
+ havingClauseAfterAnalyzed = havingClause.substitute(aliasSMap, analyzer, false);
}
} else {
// according to mysql
// if there is no group by clause, the having clause should use alias
- havingClauseAfterAnaylzed = havingClause.substitute(aliasSMap, analyzer, false);
+ havingClauseAfterAnalyzed = havingClause.substitute(aliasSMap, analyzer, false);
}
- havingClauseAfterAnaylzed = rewriteQueryExprByMvColumnExpr(havingClauseAfterAnaylzed, analyzer);
- havingClauseAfterAnaylzed.checkReturnsBool("HAVING clause", true);
+ havingClauseAfterAnalyzed = rewriteQueryExprByMvColumnExpr(havingClauseAfterAnalyzed, analyzer);
+ havingClauseAfterAnalyzed.checkReturnsBool("HAVING clause", true);
if (groupingInfo != null) {
- groupingInfo.substituteGroupingFn(Arrays.asList(havingClauseAfterAnaylzed), analyzer);
+ groupingInfo.substituteGroupingFn(Arrays.asList(havingClauseAfterAnalyzed), analyzer);
}
// can't contain analytic exprs
- Expr analyticExpr = havingClauseAfterAnaylzed.findFirstOf(AnalyticExpr.class);
+ Expr analyticExpr = havingClauseAfterAnalyzed.findFirstOf(AnalyticExpr.class);
if (analyticExpr != null) {
throw new AnalysisException(
"HAVING clause must not contain analytic expressions: "
+ analyticExpr.toSql());
}
- if (isContainInBitmap(havingClauseAfterAnaylzed)) {
+ if (isContainInBitmap(havingClauseAfterAnalyzed)) {
throw new AnalysisException(
- "HAVING clause dose not support in bitmap syntax: " + havingClauseAfterAnaylzed.toSql());
+ "HAVING clause dose not support in bitmap syntax: " + havingClauseAfterAnalyzed.toSql());
}
}
if (groupByClause == null && !selectList.isDistinct()
&& !TreeNode.contains(resultExprs, Expr.isAggregatePredicate())
- && (havingClauseAfterAnaylzed == null || !havingClauseAfterAnaylzed.contains(
+ && (havingClauseAfterAnalyzed == null || !havingClauseAfterAnalyzed.contains(
Expr.isAggregatePredicate()))
&& (sortInfo == null || !TreeNode.contains(sortInfo.getOrderingExprs(),
Expr.isAggregatePredicate()))) {
// We're not computing aggregates but we still need to register the HAVING
// clause which could, e.g., contain a constant expression evaluating to false.
- if (havingClauseAfterAnaylzed != null) {
- if (havingClauseAfterAnaylzed.contains(Subquery.class)) {
+ if (havingClauseAfterAnalyzed != null) {
+ if (havingClauseAfterAnalyzed.contains(Subquery.class)) {
throw new AnalysisException("Only constant expr could be supported in having clause "
+ "when no aggregation in stmt");
}
- analyzer.registerConjuncts(havingClauseAfterAnaylzed, true);
+ analyzer.registerConjuncts(havingClauseAfterAnalyzed, true);
}
return;
}
@@ -1314,7 +1314,7 @@ public class SelectStmt extends QueryStmt {
if (selectList.isDistinct()
&& (groupByClause != null
|| TreeNode.contains(resultExprs, Expr.isAggregatePredicate())
- || (havingClauseAfterAnaylzed != null && havingClauseAfterAnaylzed.contains(
+ || (havingClauseAfterAnalyzed != null && havingClauseAfterAnalyzed.contains(
Expr.isAggregatePredicate())))) {
throw new AnalysisException("cannot combine SELECT DISTINCT with aggregate functions or GROUP BY");
}
@@ -1335,8 +1335,8 @@ public class SelectStmt extends QueryStmt {
// of this statement.
ArrayList<FunctionCallExpr> aggExprs = Lists.newArrayList();
TreeNode.collect(resultExprs, Expr.isAggregatePredicate(), aggExprs);
- if (havingClauseAfterAnaylzed != null) {
- havingClauseAfterAnaylzed.collect(Expr.isAggregatePredicate(), aggExprs);
+ if (havingClauseAfterAnalyzed != null) {
+ havingClauseAfterAnalyzed.collect(Expr.isAggregatePredicate(), aggExprs);
}
if (sortInfo != null) {
// TODO: Avoid evaluating aggs in ignored order-bys
@@ -1362,9 +1362,9 @@ public class SelectStmt extends QueryStmt {
// the resultExprs and havingClause must substitute in the same way as aggExprs
// then resultExprs and havingClause can be substitute correctly using combinedSmap
resultExprs = Expr.substituteList(resultExprs, countAllMap, analyzer, false);
- if (havingClauseAfterAnaylzed != null) {
- havingClauseAfterAnaylzed =
- havingClauseAfterAnaylzed.substitute(countAllMap, analyzer, false);
+ if (havingClauseAfterAnalyzed != null) {
+ havingClauseAfterAnalyzed =
+ havingClauseAfterAnalyzed.substitute(countAllMap, analyzer, false);
}
if (sortInfo != null) {
// the ordering exprs must substitute in the same way as resultExprs
@@ -1488,10 +1488,10 @@ public class SelectStmt extends QueryStmt {
LOG.debug("resultexprs: " + Expr.debugString(resultExprs));
}
- if (havingClauseAfterAnaylzed != null) {
+ if (havingClauseAfterAnalyzed != null) {
// forbidden correlated subquery in having clause
List<Subquery> subqueryInHaving = Lists.newArrayList();
- havingClauseAfterAnaylzed.collect(Subquery.class, subqueryInHaving);
+ havingClauseAfterAnalyzed.collect(Subquery.class, subqueryInHaving);
for (Subquery subquery : subqueryInHaving) {
if (subquery.isCorrelatedPredicate(getTableRefIds())) {
throw new AnalysisException("The correlated having clause is not supported");
@@ -1516,8 +1516,8 @@ public class SelectStmt extends QueryStmt {
if (LOG.isDebugEnabled()) {
LOG.debug("post-agg selectListExprs: " + Expr.debugString(resultExprs));
}
- if (havingClauseAfterAnaylzed != null) {
- havingPred = havingClauseAfterAnaylzed.substitute(combinedSmap, analyzer, false);
+ if (havingClauseAfterAnalyzed != null) {
+ havingPred = havingClauseAfterAnalyzed.substitute(combinedSmap, analyzer, false);
analyzer.registerConjuncts(havingPred, true, finalAggInfo.getOutputTupleId().asList());
if (LOG.isDebugEnabled()) {
LOG.debug("post-agg havingPred: " + havingPred.debugString());
@@ -1782,7 +1782,7 @@ public class SelectStmt extends QueryStmt {
}
if (havingClause != null) {
havingClause = rewriter.rewrite(havingClause, analyzer);
- havingClauseAfterAnaylzed.collect(Subquery.class, subqueryExprs);
+ havingClauseAfterAnalyzed.collect(Subquery.class, subqueryExprs);
}
for (Subquery subquery : subqueryExprs) {
subquery.getStatement().rewriteExprs(rewriter);
@@ -1876,9 +1876,9 @@ public class SelectStmt extends QueryStmt {
}
if (havingClause != null) {
- registerExprId(havingClauseAfterAnaylzed);
- exprMap.put(havingClauseAfterAnaylzed.getId().toString(), havingClauseAfterAnaylzed);
- havingClauseAfterAnaylzed.collect(Subquery.class, subqueryExprs);
+ registerExprId(havingClauseAfterAnalyzed);
+ exprMap.put(havingClauseAfterAnalyzed.getId().toString(), havingClauseAfterAnalyzed);
+ havingClauseAfterAnalyzed.collect(Subquery.class, subqueryExprs);
}
for (Subquery subquery : subqueryExprs) {
registerExprId(subquery);
@@ -1983,8 +1983,8 @@ public class SelectStmt extends QueryStmt {
whereClause.collect(Subquery.class, subqueryExprs);
}
if (havingClause != null) {
- havingClause = rewrittenExprMap.get(havingClauseAfterAnaylzed.getId().toString());
- havingClauseAfterAnaylzed.collect(Subquery.class, subqueryExprs);
+ havingClause = rewrittenExprMap.get(havingClauseAfterAnalyzed.getId().toString());
+ havingClauseAfterAnalyzed.collect(Subquery.class, subqueryExprs);
}
for (Subquery subquery : subqueryExprs) {
diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/StmtRewriter.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/StmtRewriter.java
index 23aa255d57..91fa888f92 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/StmtRewriter.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/StmtRewriter.java
@@ -121,8 +121,8 @@ public class StmtRewriter {
rewriteWhereClauseSubqueries(result, analyzer);
}
// Rewrite all subquery in the having clause
- if (result.getHavingClauseAfterAnaylzed() != null
- && result.getHavingClauseAfterAnaylzed().getSubquery() != null) {
+ if (result.getHavingClauseAfterAnalyzed() != null
+ && result.getHavingClauseAfterAnalyzed().getSubquery() != null) {
result = rewriteHavingClauseSubqueries(result, analyzer);
}
result.sqlString = null;
@@ -176,7 +176,7 @@ public class StmtRewriter {
// prepare parameters
SelectList selectList = stmt.getSelectList();
List<String> columnLabels = stmt.getColLabels();
- Expr havingClause = stmt.getHavingClauseAfterAnaylzed();
+ Expr havingClause = stmt.getHavingClauseAfterAnalyzed();
List<FunctionCallExpr> aggregateExprs = stmt.getAggInfo().getAggregateExprs();
Preconditions.checkState(havingClause != null);
Preconditions.checkState(havingClause.getSubquery() != null);
diff --git a/fe/fe-core/src/main/java/org/apache/doris/plugin/LoadAuditEvent.java b/fe/fe-core/src/main/java/org/apache/doris/plugin/LoadAuditEvent.java
index a79fa80fd4..704ec3ad03 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/plugin/LoadAuditEvent.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/plugin/LoadAuditEvent.java
@@ -31,7 +31,7 @@ public class LoadAuditEvent extends AuditEvent {
public String filePathList = "";
// for Baidu HDFS/AFS it is username
// for BOS, it is bos_accesskey
- // for Apache HDFS, it it username or kerberos_principal
+ // for Apache HDFS, it is username or kerberos_principal
// for Amazon S3, it is fs.s3a.access.key
@AuditField(value = "BrokerUser")
public String brokerUser = "";
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/QueryDetail.java b/fe/fe-core/src/main/java/org/apache/doris/qe/QueryDetail.java
index 0884782ba9..88c00b1853 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/QueryDetail.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/QueryDetail.java
@@ -31,9 +31,9 @@ public class QueryDetail {
// After query finished, endTime and latency will
// be set and state will be updated to be FINISHED/FAILED/CANCELLED
// according to the query execution results.
- // So, one query will be inserted into as a item and
- // be updated upon finished. To indicate the two event,
- // a extra field named eventTime is added.
+ // So, one query will be inserted into as an item and
+ // be updated upon finished. To indicate the two events,
+ // an extra field named eventTime is added.
private long eventTime;
private String queryId;
private long startTime;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org