This is an automated email from the ASF dual-hosted git repository.
lihaopeng 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 5e3a4e8bcbd [fix](arrow-flight-sql) Open
regression-test/pipeline/p0/arrow_flight_sql (#36854)
5e3a4e8bcbd is described below
commit 5e3a4e8bcbd77a5e571a05e197c0cfbaff36ef97
Author: Xinyi Zou <[email protected]>
AuthorDate: Fri Jul 12 19:31:29 2024 +0800
[fix](arrow-flight-sql) Open regression-test/pipeline/p0/arrow_flight_sql
(#36854)
1. Fix `enableParallelResultSink` is true, ADBC client use QueryId to
fetch result, else use FinstId.
2. Add arrow flight sql conf in
regression-test/pipeline/p0/conf/regression-conf.groovy.
3. Add regression-test/suites/arrow_flight_sql_p0/test_select.groovy
---
.../arrowflight/DorisFlightSqlProducer.java | 11 +++++---
regression-test/conf/regression-conf.groovy | 2 +-
.../data/arrow_flight_sql_p0/test_select.out | 4 +++
regression-test/pipeline/p0/conf/fe.conf | 4 +--
.../pipeline/p0/conf/regression-conf.groovy | 6 +++++
.../suites/arrow_flight_sql_p0/test_select.groovy | 31 ++++++++++++++++++++++
6 files changed, 52 insertions(+), 6 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/DorisFlightSqlProducer.java
b/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/DorisFlightSqlProducer.java
index af6d85c954e..16195469af9 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/DorisFlightSqlProducer.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/DorisFlightSqlProducer.java
@@ -90,7 +90,7 @@ import java.util.concurrent.Executors;
/**
* Implementation of Arrow Flight SQL service
- *
+ * <p>
* All methods must catch all possible Exceptions, print and throw CallStatus,
* otherwise error message will be discarded.
*/
@@ -224,8 +224,13 @@ public class DorisFlightSqlProducer implements
FlightSqlProducer, AutoCloseable
}
} else {
// Now only query stmt will pull results from BE.
- final ByteString handle = ByteString.copyFromUtf8(
- DebugUtil.printId(connectContext.queryId()) + ":" +
query);
+ final ByteString handle;
+ if
(connectContext.getSessionVariable().enableParallelResultSink()) {
+ handle =
ByteString.copyFromUtf8(DebugUtil.printId(connectContext.queryId()) + ":" +
query);
+ } else {
+ // only one instance
+ handle =
ByteString.copyFromUtf8(DebugUtil.printId(connectContext.getFinstId()) + ":" +
query);
+ }
Schema schema =
flightSQLConnectProcessor.fetchArrowFlightSchema(5000);
if (schema == null) {
throw CallStatus.INTERNAL.withDescription("fetch arrow
flight schema is null").toRuntimeException();
diff --git a/regression-test/conf/regression-conf.groovy
b/regression-test/conf/regression-conf.groovy
index 6d4d9156339..527b0231394 100644
--- a/regression-test/conf/regression-conf.groovy
+++ b/regression-test/conf/regression-conf.groovy
@@ -200,7 +200,7 @@ s3Region = "ap-hongkong"
//arrow flight sql test config
extArrowFlightSqlHost = "127.0.0.1"
-extArrowFlightSqlPort = 9090
+extArrowFlightSqlPort = 8080
extArrowFlightSqlUser = "root"
extArrowFlightSqlPassword= ""
diff --git a/regression-test/data/arrow_flight_sql_p0/test_select.out
b/regression-test/data/arrow_flight_sql_p0/test_select.out
new file mode 100644
index 00000000000..d643597bbaf
--- /dev/null
+++ b/regression-test/data/arrow_flight_sql_p0/test_select.out
@@ -0,0 +1,4 @@
+-- This file is automatically generated. You should know what you did if you
want to edit this
+-- !arrow_flight_sql --
+777 4
+
diff --git a/regression-test/pipeline/p0/conf/fe.conf
b/regression-test/pipeline/p0/conf/fe.conf
index ae5a97e2ba4..24853b0a0c6 100644
--- a/regression-test/pipeline/p0/conf/fe.conf
+++ b/regression-test/pipeline/p0/conf/fe.conf
@@ -30,11 +30,11 @@ LOG_DIR = ${DORIS_HOME}/log
JAVA_OPTS="-Djavax.security.auth.useSubjectCredsOnly=false -Xss4m -Xmx4096m
-XX:+HeapDumpOnOutOfMemoryError -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC
-XX:MaxGCPauseMillis=200 -XX:+PrintGCDateStamps -XX:+PrintGCDetails
-Xloggc:$DORIS_HOME/log/fe.gc.log.$CUR_DATE -XX:+UseGCLogFileRotation
-XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=50M
-Dlog4j2.formatMsgNoLookups=true
-Dcom.mysql.cj.disableAbandonedConnectionCleanup=true"
# For jdk 17, this JAVA_OPTS will be used as default JVM options
-JAVA_OPTS_FOR_JDK_17="-Djavax.security.auth.useSubjectCredsOnly=false
-Xmx8192m -Xms8192m -XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=$DORIS_HOME/log/
-Xlog:gc*:$DORIS_HOME/log/fe.gc.log.$CUR_DATE:time,uptime:filecount=10,filesize=50M
-Dcom.mysql.cj.disableAbandonedConnectionCleanup=true"
+JAVA_OPTS_FOR_JDK_17="-Djavax.security.auth.useSubjectCredsOnly=false
-Xmx8192m -Xms8192m -XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=$DORIS_HOME/log/
-Xlog:gc*:$DORIS_HOME/log/fe.gc.log.$CUR_DATE:time,uptime:filecount=10,filesize=50M
-Dcom.mysql.cj.disableAbandonedConnectionCleanup=true
--add-opens=java.base/java.nio=ALL-UNNAMED --add-opens
java.base/jdk.internal.ref=ALL-UNNAMED"
sys_log_level = INFO
sys_log_mode = NORMAL
-arrow_flight_sql_port = 8080
+arrow_flight_sql_port = 8081
catalog_trash_expire_second=1
#enable ssl for test
enable_ssl = true
diff --git a/regression-test/pipeline/p0/conf/regression-conf.groovy
b/regression-test/pipeline/p0/conf/regression-conf.groovy
index d449a4b5b8b..1c2fb4d08b6 100644
--- a/regression-test/pipeline/p0/conf/regression-conf.groovy
+++ b/regression-test/pipeline/p0/conf/regression-conf.groovy
@@ -141,6 +141,12 @@ s3BucketName = "doris-build-hk-1308700295"
s3Region = "ap-hongkong"
s3Provider = "COS"
+//arrow flight sql test config
+extArrowFlightSqlHost = "127.0.0.1"
+extArrowFlightSqlPort = 8081
+extArrowFlightSqlUser = "root"
+extArrowFlightSqlPassword= ""
+
max_failure_num=50
externalEnvIp="127.0.0.1"
diff --git a/regression-test/suites/arrow_flight_sql_p0/test_select.groovy
b/regression-test/suites/arrow_flight_sql_p0/test_select.groovy
new file mode 100644
index 00000000000..55b3c301e24
--- /dev/null
+++ b/regression-test/suites/arrow_flight_sql_p0/test_select.groovy
@@ -0,0 +1,31 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+suite("test_select", "arrow_flight_sql") {
+ def tableName = "test_select"
+ sql "DROP TABLE IF EXISTS ${tableName}"
+ sql """
+ create table ${tableName} (id int, name varchar(20)) DUPLICATE
key(`id`) distributed by hash (`id`) buckets 4
+ properties ("replication_num"="1");
+ """
+ sql """INSERT INTO ${tableName} VALUES(111, "plsql111")"""
+ sql """INSERT INTO ${tableName} VALUES(222, "plsql222")"""
+ sql """INSERT INTO ${tableName} VALUES(333, "plsql333")"""
+ sql """INSERT INTO ${tableName} VALUES(111, "plsql333")"""
+
+ qt_arrow_flight_sql "select sum(id) as a, count(1) as b from ${tableName}"
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]