This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
The following commit(s) were added to refs/heads/master by this push:
new d2c1cdd [Bug-fix] Avoid using 'QueryDetail' in planning stage (#6018)
d2c1cdd is described below
commit d2c1cddd552c4c8fb0137727961e8aa99449971a
Author: EmmyMiao87 <[email protected]>
AuthorDate: Wed Jun 16 09:40:53 2021 +0800
[Bug-fix] Avoid using 'QueryDetail' in planning stage (#6018)
QueryDetail is used to statistic the current query details.
This property will only be set when the query starts to execute.
So in the query planning stage, using this attribute in the first query
will cause 'NullPointerException'.
After that, this attribute retains the value of the previous query
until it is updated by the subsequent process.
Because code of 'colocateagg' uses this attribute incorrectly in its
planning,
it causes 'NullPointerException' when clients like pymysql connect to doris
and send the first query.
Fixed #6017
---
.../src/main/java/org/apache/doris/planner/DistributedPlanner.java | 2 +-
fe/fe-core/src/main/java/org/apache/doris/qe/ConnectContext.java | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/planner/DistributedPlanner.java
b/fe/fe-core/src/main/java/org/apache/doris/planner/DistributedPlanner.java
index b0126bc..f03a5e2 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/planner/DistributedPlanner.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/planner/DistributedPlanner.java
@@ -988,7 +988,7 @@ public class DistributedPlanner {
private boolean canColocateAgg(AggregateInfo aggregateInfo,
List<DataPartition> childFragmentDataPartition) {
// Condition1
if (ConnectContext.get().getSessionVariable().isDisableColocatePlan())
{
- LOG.debug("Agg node is not colocate in:" +
ConnectContext.get().getQueryDetail().getQueryId()
+ LOG.debug("Agg node is not colocate in:" +
ConnectContext.get().queryId()
+ ", reason:" +
DistributedPlanColocateRule.SESSION_DISABLED);
return false;
}
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/ConnectContext.java
b/fe/fe-core/src/main/java/org/apache/doris/qe/ConnectContext.java
index 98c104e..727e333 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/ConnectContext.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/ConnectContext.java
@@ -98,6 +98,9 @@ public class ConnectContext {
protected String remoteIP;
+ // This is used to statistic the current query details.
+ // This property will only be set when the query starts to execute.
+ // So in the query planning stage, do not use any value in this attribute.
protected QueryDetail queryDetail;
public static ConnectContext get() {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]