This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 3ead073905355d9fc3627c3f12b243540fee9a5d
Author: Xinyi Zou <zouxiny...@gmail.com>
AuthorDate: Wed May 15 12:24:44 2024 +0800

    [fix](arrow-flight-sql) Fix Arrow Flight bind wrong Host in Fqdn #34850
---
 .../trees/plans/commands/insert/BatchInsertIntoTableCommand.java       | 3 ++-
 .../nereids/trees/plans/commands/insert/InsertIntoTableCommand.java    | 3 ++-
 .../trees/plans/commands/insert/InsertOverwriteTableCommand.java       | 3 ++-
 .../org/apache/doris/service/arrowflight/DorisFlightSqlService.java    | 3 +--
 4 files changed, 7 insertions(+), 5 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/BatchInsertIntoTableCommand.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/BatchInsertIntoTableCommand.java
index 74d9fd6df35..6d4431eec27 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/BatchInsertIntoTableCommand.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/BatchInsertIntoTableCommand.java
@@ -41,6 +41,7 @@ import 
org.apache.doris.nereids.trees.plans.physical.PhysicalOneRowRelation;
 import org.apache.doris.nereids.trees.plans.physical.PhysicalUnion;
 import org.apache.doris.nereids.trees.plans.visitor.PlanVisitor;
 import org.apache.doris.qe.ConnectContext;
+import org.apache.doris.qe.ConnectContext.ConnectType;
 import org.apache.doris.qe.StmtExecutor;
 
 import com.google.common.base.Preconditions;
@@ -105,7 +106,7 @@ public class BatchInsertIntoTableCommand extends Command 
implements ForwardWithS
             NereidsPlanner planner = new 
NereidsPlanner(ctx.getStatementContext());
             planner.plan(logicalPlanAdapter, 
ctx.getSessionVariable().toThrift());
             executor.checkBlockRules();
-            if (ctx.getMysqlChannel() != null) {
+            if (ctx.getConnectType() == ConnectType.MYSQL && 
ctx.getMysqlChannel() != null) {
                 ctx.getMysqlChannel().reset();
             }
 
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertIntoTableCommand.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertIntoTableCommand.java
index 7f326cf2212..7c9ea67860c 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertIntoTableCommand.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertIntoTableCommand.java
@@ -42,6 +42,7 @@ import 
org.apache.doris.nereids.trees.plans.physical.PhysicalSink;
 import org.apache.doris.nereids.trees.plans.visitor.PlanVisitor;
 import org.apache.doris.planner.DataSink;
 import org.apache.doris.qe.ConnectContext;
+import org.apache.doris.qe.ConnectContext.ConnectType;
 import org.apache.doris.qe.StmtExecutor;
 
 import com.google.common.base.Preconditions;
@@ -144,7 +145,7 @@ public class InsertIntoTableCommand extends Command 
implements ForwardWithSync,
             planner.plan(logicalPlanAdapter, 
ctx.getSessionVariable().toThrift());
             executor.setPlanner(planner);
             executor.checkBlockRules();
-            if (ctx.getMysqlChannel() != null) {
+            if (ctx.getConnectType() == ConnectType.MYSQL && 
ctx.getMysqlChannel() != null) {
                 ctx.getMysqlChannel().reset();
             }
             Optional<PhysicalSink<?>> plan = (planner.getPhysicalPlan()
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertOverwriteTableCommand.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertOverwriteTableCommand.java
index ff3727a979f..d9047dcfc7d 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertOverwriteTableCommand.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertOverwriteTableCommand.java
@@ -45,6 +45,7 @@ import 
org.apache.doris.nereids.trees.plans.physical.PhysicalOlapTableSink;
 import org.apache.doris.nereids.trees.plans.physical.PhysicalTableSink;
 import org.apache.doris.nereids.trees.plans.visitor.PlanVisitor;
 import org.apache.doris.qe.ConnectContext;
+import org.apache.doris.qe.ConnectContext.ConnectType;
 import org.apache.doris.qe.QueryState.MysqlStateType;
 import org.apache.doris.qe.StmtExecutor;
 
@@ -116,7 +117,7 @@ public class InsertOverwriteTableCommand extends Command 
implements ForwardWithS
         NereidsPlanner planner = new NereidsPlanner(ctx.getStatementContext());
         planner.plan(logicalPlanAdapter, ctx.getSessionVariable().toThrift());
         executor.checkBlockRules();
-        if (ctx.getMysqlChannel() != null) {
+        if (ctx.getConnectType() == ConnectType.MYSQL && ctx.getMysqlChannel() 
!= null) {
             ctx.getMysqlChannel().reset();
         }
 
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/DorisFlightSqlService.java
 
b/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/DorisFlightSqlService.java
index a8ad9a05c93..85377788097 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/DorisFlightSqlService.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/DorisFlightSqlService.java
@@ -18,7 +18,6 @@
 package org.apache.doris.service.arrowflight;
 
 import org.apache.doris.common.Config;
-import org.apache.doris.service.FrontendOptions;
 import 
org.apache.doris.service.arrowflight.auth2.FlightBearerTokenAuthenticator;
 import org.apache.doris.service.arrowflight.sessions.FlightSessionsManager;
 import 
org.apache.doris.service.arrowflight.sessions.FlightSessionsWithTokenManager;
@@ -46,7 +45,7 @@ public class DorisFlightSqlService {
 
     public DorisFlightSqlService(int port) {
         BufferAllocator allocator = new RootAllocator();
-        Location location = 
Location.forGrpcInsecure(FrontendOptions.getLocalHostAddress(), port);
+        Location location = Location.forGrpcInsecure("0.0.0.0", port);
         // arrow_flight_token_cache_size less than qe_max_connection to avoid 
`Reach limit of connections`.
         // arrow flight sql is a stateless protocol, connection is usually not 
actively disconnected.
         // bearer token is evict from the cache will unregister ConnectContext.


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to