You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by ji...@apache.org on 2023/01/18 08:41:49 UTC

[doris] branch master updated: [regression-test](spark-connector) Add the regression case of the spark doris connector (#14877)

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

jiafengzheng 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 94628f09e9 [regression-test](spark-connector) Add the regression case of the spark doris connector (#14877)
94628f09e9 is described below

commit 94628f09e96d9af5721174aad834dadb489f69db
Author: Hong Liu <84...@qq.com>
AuthorDate: Wed Jan 18 16:41:41 2023 +0800

    [regression-test](spark-connector) Add the regression case of the spark doris connector (#14877)
    
    * [regression-test](spark-connector) Add the regression case of the spark doris connector
---
 .../spark_connector/spark_connector.out            |  6 ++++
 .../connector_p0/spark_connector/ddl/create.sql    | 12 ++++++++
 .../spark_connector/spark_connector.groovy         | 34 ++++++++++++++++++++++
 3 files changed, 52 insertions(+)

diff --git a/regression-test/data/connector_p0/spark_connector/spark_connector.out b/regression-test/data/connector_p0/spark_connector/spark_connector.out
new file mode 100644
index 0000000000..45d8739d4d
--- /dev/null
+++ b/regression-test/data/connector_p0/spark_connector/spark_connector.out
@@ -0,0 +1,6 @@
+-- This file is automatically generated. You should know what you did if you want to edit this
+-- !select --
+1	100	待付款
+2	200	待发货
+3	300	已收货
+
diff --git a/regression-test/suites/connector_p0/spark_connector/ddl/create.sql b/regression-test/suites/connector_p0/spark_connector/ddl/create.sql
new file mode 100644
index 0000000000..d5f5c1dbb1
--- /dev/null
+++ b/regression-test/suites/connector_p0/spark_connector/ddl/create.sql
@@ -0,0 +1,12 @@
+CREATE TABLE `spark_connector`
+(
+    `order_id`     varchar(30) NULL,
+    `order_amount` int(11) NULL,
+    `order_status` varchar(30) NULL
+) ENGINE=OLAP
+DUPLICATE KEY(`order_id`)
+COMMENT 'OLAP'
+DISTRIBUTED BY HASH(`order_id`) BUCKETS 10
+PROPERTIES (
+  "replication_num" = "1"
+);
diff --git a/regression-test/suites/connector_p0/spark_connector/spark_connector.groovy b/regression-test/suites/connector_p0/spark_connector/spark_connector.groovy
new file mode 100644
index 0000000000..ecd4e6dfc1
--- /dev/null
+++ b/regression-test/suites/connector_p0/spark_connector/spark_connector.groovy
@@ -0,0 +1,34 @@
+// 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("spark_connector", "connector") {
+
+    def tableName = "spark_connector"
+    sql """DROP TABLE IF EXISTS ${tableName}"""
+    sql new File("""${context.file.parent}/ddl/create.sql""").text
+    logger.info("start delete local spark doris demo jar...")
+    def delete_local_spark_jar = "rm -rf spark-doris-demo.jar".execute()
+    logger.info("start download spark doris demo ...")
+    logger.info("getS3Url ==== ${getS3Url()}")
+    def download_spark_jar = "/usr/bin/curl ${getS3Url()}/regression/spark-doris-connector-demo-jar-with-dependencies.jar --output spark-doris-demo.jar".execute().getText()
+    logger.info("finish download spark doris demo ...")
+    def run_cmd = "java -jar spark-doris-demo.jar $context.config.feHttpAddress $context.config.feHttpUser regression_test_connector_p0_spark_connector.$tableName"
+    logger.info("run_cmd : $run_cmd")
+    def run_spark_jar = run_cmd.execute().getText()
+    logger.info("result: $run_spark_jar")
+    qt_select """ select * from $tableName order by order_id"""
+}


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