liaoxin01 commented on code in PR #56316:
URL: https://github.com/apache/doris/pull/56316#discussion_r2384424074


##########
regression-test/suites/load_p0/tvf/test_tvf_lz4_compress.groovy:
##########
@@ -0,0 +1,237 @@
+// 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_tvf_lz4_compress") {
+    def s3BucketName = getS3BucketName()
+    def s3Endpoint = getS3Endpoint()
+    def s3Region = getS3Region()
+    def ak = getS3AK()
+    def sk = getS3SK()
+
+    // stream load test 'lz4' and 'lz4frame'
+    /* test_compress.csv.lz4
+        1,2
+        3,4
+        5,6
+        7,8
+        9,10
+        11,12
+        13,14
+        15,16
+        17,18
+        19,20
+    */
+    try {
+        sql """
+            CREATE TABLE IF NOT EXISTS test_table1 (
+                a INT,
+                b INT
+            ) ENGINE=OLAP
+            DUPLICATE KEY(a)
+            DISTRIBUTED BY RANDOM BUCKETS 10
+            PROPERTIES (
+                "replication_allocation" = "tag.location.default: 1"
+            );
+            """
+
+        // stream load use 'lz4'
+        streamLoad {
+            table "test_table1"
+            set 'format', 'csv'
+            set 'column_separator', ','
+            set 'columns', 'a,b'
+            set 'compress_type', 'lz4'
+            file '../stream_load/test_compress.csv.lz4'
+            time 10000
+
+            check { result, exception, startTime, endTime ->
+                if (exception != null) {
+                    throw exception
+                }
+                log.info("Stream load result: ${result}".toString())
+                def json = parseJson(result)
+                assertEquals("success", json.Status.toLowerCase())
+                assertEquals(json.NumberLoadedRows, 10)
+            }
+        }
+        sql """ truncate table test_table1; """
+        // stream load use 'lz4frame'
+        streamLoad {
+            table "test_table1"
+            set 'format', 'csv'
+            set 'column_separator', ','
+            set 'columns', 'a,b'
+            set 'compress_type', 'lz4frame'
+            file '../stream_load/test_compress.csv.lz4'
+            time 10000
+
+            check { result, exception, startTime, endTime ->
+                if (exception != null) {
+                    throw exception
+                }
+                log.info("Stream load result: ${result}".toString())
+                def json = parseJson(result)
+                assertEquals("success", json.Status.toLowerCase())
+                assertEquals(json.NumberLoadedRows, 10)
+            }
+        }
+    } finally {
+        try_sql("DROP TABLE IF EXISTS test_table1")
+    }
+
+    // oss://doris-regression-hk/load/tvf_compress.csv.lz4

Review Comment:
   delete this comment.



##########
regression-test/suites/load_p0/tvf/test_tvf_lz4_compress.groovy:
##########
@@ -0,0 +1,237 @@
+// 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_tvf_lz4_compress") {
+    def s3BucketName = getS3BucketName()
+    def s3Endpoint = getS3Endpoint()
+    def s3Region = getS3Region()
+    def ak = getS3AK()
+    def sk = getS3SK()
+
+    // stream load test 'lz4' and 'lz4frame'
+    /* test_compress.csv.lz4
+        1,2
+        3,4
+        5,6
+        7,8
+        9,10
+        11,12
+        13,14
+        15,16
+        17,18
+        19,20
+    */
+    try {
+        sql """
+            CREATE TABLE IF NOT EXISTS test_table1 (
+                a INT,
+                b INT
+            ) ENGINE=OLAP
+            DUPLICATE KEY(a)
+            DISTRIBUTED BY RANDOM BUCKETS 10
+            PROPERTIES (
+                "replication_allocation" = "tag.location.default: 1"
+            );
+            """
+
+        // stream load use 'lz4'
+        streamLoad {
+            table "test_table1"
+            set 'format', 'csv'
+            set 'column_separator', ','
+            set 'columns', 'a,b'
+            set 'compress_type', 'lz4'
+            file '../stream_load/test_compress.csv.lz4'
+            time 10000
+
+            check { result, exception, startTime, endTime ->
+                if (exception != null) {
+                    throw exception
+                }
+                log.info("Stream load result: ${result}".toString())
+                def json = parseJson(result)
+                assertEquals("success", json.Status.toLowerCase())
+                assertEquals(json.NumberLoadedRows, 10)
+            }
+        }
+        sql """ truncate table test_table1; """
+        // stream load use 'lz4frame'
+        streamLoad {
+            table "test_table1"
+            set 'format', 'csv'
+            set 'column_separator', ','
+            set 'columns', 'a,b'
+            set 'compress_type', 'lz4frame'
+            file '../stream_load/test_compress.csv.lz4'
+            time 10000
+
+            check { result, exception, startTime, endTime ->
+                if (exception != null) {
+                    throw exception
+                }
+                log.info("Stream load result: ${result}".toString())
+                def json = parseJson(result)
+                assertEquals("success", json.Status.toLowerCase())
+                assertEquals(json.NumberLoadedRows, 10)
+            }
+        }
+    } finally {
+        try_sql("DROP TABLE IF EXISTS test_table1")
+    }
+
+    // oss://doris-regression-hk/load/tvf_compress.csv.lz4
+
+    // with S3 load test
+    try {
+        sql """
+            CREATE TABLE IF NOT EXISTS test_table2 (
+                a INT,
+                b INT
+            ) ENGINE=OLAP
+            DUPLICATE KEY(a)
+            DISTRIBUTED BY RANDOM BUCKETS 10
+            PROPERTIES (
+                "replication_allocation" = "tag.location.default: 1"
+            );
+            """
+
+        // S3 load use 'lz4'
+        def label1 = "test_s3_load_lz4_" + System.currentTimeMillis()
+        sql """
+            LOAD LABEL ${label1} (
+                DATA INFILE("s3://${s3BucketName}/load/tvf_compress.csv.lz4")
+                INTO TABLE test_table2
+                COLUMNS TERMINATED BY ","
+                FORMAT AS "csv"
+                (a, b)
+            )
+            WITH S3 (
+                "AWS_ACCESS_KEY" = "${ak}",
+                "AWS_SECRET_KEY" = "${sk}",
+                "AWS_ENDPOINT" = "${s3Endpoint}",
+                "AWS_REGION" = "${s3Region}",
+                "compress_type" = "lz4"
+            )
+            """
+
+        // 等待加载完成并检查数据

Review Comment:
   use English.



##########
regression-test/suites/load_p0/tvf/test_tvf_lz4_compress.groovy:
##########
@@ -0,0 +1,237 @@
+// 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_tvf_lz4_compress") {
+    def s3BucketName = getS3BucketName()
+    def s3Endpoint = getS3Endpoint()
+    def s3Region = getS3Region()
+    def ak = getS3AK()
+    def sk = getS3SK()
+
+    // stream load test 'lz4' and 'lz4frame'
+    /* test_compress.csv.lz4
+        1,2
+        3,4
+        5,6
+        7,8
+        9,10
+        11,12
+        13,14
+        15,16
+        17,18
+        19,20
+    */
+    try {
+        sql """
+            CREATE TABLE IF NOT EXISTS test_table1 (
+                a INT,
+                b INT
+            ) ENGINE=OLAP
+            DUPLICATE KEY(a)
+            DISTRIBUTED BY RANDOM BUCKETS 10
+            PROPERTIES (
+                "replication_allocation" = "tag.location.default: 1"
+            );
+            """
+
+        // stream load use 'lz4'
+        streamLoad {
+            table "test_table1"
+            set 'format', 'csv'
+            set 'column_separator', ','
+            set 'columns', 'a,b'
+            set 'compress_type', 'lz4'
+            file '../stream_load/test_compress.csv.lz4'
+            time 10000
+
+            check { result, exception, startTime, endTime ->
+                if (exception != null) {
+                    throw exception
+                }
+                log.info("Stream load result: ${result}".toString())
+                def json = parseJson(result)
+                assertEquals("success", json.Status.toLowerCase())
+                assertEquals(json.NumberLoadedRows, 10)
+            }
+        }
+        sql """ truncate table test_table1; """
+        // stream load use 'lz4frame'
+        streamLoad {
+            table "test_table1"
+            set 'format', 'csv'
+            set 'column_separator', ','
+            set 'columns', 'a,b'
+            set 'compress_type', 'lz4frame'
+            file '../stream_load/test_compress.csv.lz4'
+            time 10000
+
+            check { result, exception, startTime, endTime ->
+                if (exception != null) {
+                    throw exception
+                }
+                log.info("Stream load result: ${result}".toString())
+                def json = parseJson(result)
+                assertEquals("success", json.Status.toLowerCase())
+                assertEquals(json.NumberLoadedRows, 10)
+            }
+        }
+    } finally {
+        try_sql("DROP TABLE IF EXISTS test_table1")
+    }
+
+    // oss://doris-regression-hk/load/tvf_compress.csv.lz4
+
+    // with S3 load test
+    try {
+        sql """
+            CREATE TABLE IF NOT EXISTS test_table2 (
+                a INT,
+                b INT
+            ) ENGINE=OLAP
+            DUPLICATE KEY(a)
+            DISTRIBUTED BY RANDOM BUCKETS 10
+            PROPERTIES (
+                "replication_allocation" = "tag.location.default: 1"
+            );
+            """
+
+        // S3 load use 'lz4'
+        def label1 = "test_s3_load_lz4_" + System.currentTimeMillis()
+        sql """
+            LOAD LABEL ${label1} (
+                DATA INFILE("s3://${s3BucketName}/load/tvf_compress.csv.lz4")
+                INTO TABLE test_table2
+                COLUMNS TERMINATED BY ","
+                FORMAT AS "csv"
+                (a, b)
+            )
+            WITH S3 (
+                "AWS_ACCESS_KEY" = "${ak}",
+                "AWS_SECRET_KEY" = "${sk}",
+                "AWS_ENDPOINT" = "${s3Endpoint}",
+                "AWS_REGION" = "${s3Region}",
+                "compress_type" = "lz4"
+            )
+            """
+
+        // 等待加载完成并检查数据
+        def max_try_milli_secs = 60000
+        while (max_try_milli_secs > 0) {
+            def count = sql """ select * from test_table2; """
+            if (count.size() == 10) {
+                break
+            }
+            Thread.sleep(1000)
+            max_try_milli_secs -= 1000
+            if (max_try_milli_secs <= 0) {
+                assertTrue(false, "S3 load timeout: ${label1}")
+            }
+        }
+
+        sql """ truncate table test_table2; """
+
+        // S3 load use 'lz4frame'
+        def label2 = "test_s3_load_lz4frame_" + System.currentTimeMillis()
+        sql """
+            LOAD LABEL ${label2} (
+                DATA INFILE("s3://${s3BucketName}/load/tvf_compress.csv.lz4")
+                INTO TABLE test_table2
+                COLUMNS TERMINATED BY ","
+                FORMAT AS "csv"
+                (a, b)
+            )
+            WITH S3 (
+                "AWS_ACCESS_KEY" = "${ak}",
+                "AWS_SECRET_KEY" = "${sk}",
+                "AWS_ENDPOINT" = "${s3Endpoint}",
+                "AWS_REGION" = "${s3Region}",
+                "compress_type" = "lz4frame"
+            )
+            """
+
+        // 等待加载完成并检查数据

Review Comment:
   use English.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to