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

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


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new 9d1103927f3 branch-3.0: [fix](hive)Fixed the issue of reading hive 
table with empty lzo files #43979 (#44062)
9d1103927f3 is described below

commit 9d1103927f346fb7b374e1c3e8a96af5db7db371
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Nov 26 19:20:30 2024 +0800

    branch-3.0: [fix](hive)Fixed the issue of reading hive table with empty lzo 
files #43979 (#44062)
    
    Cherry-picked from #43979
    
    Co-authored-by: wuwenchi <[email protected]>
---
 be/src/exec/lzo_decompressor.cpp                   |   1 +
 .../user_empty_lzo/part-m-00000.lzo                | Bin 0 -> 42 bytes
 .../tvf/test_user_empty_lzo.groovy                 |  41 +++++++++++++++++++++
 3 files changed, 42 insertions(+)

diff --git a/be/src/exec/lzo_decompressor.cpp b/be/src/exec/lzo_decompressor.cpp
index b075509202b..b240e2995a0 100644
--- a/be/src/exec/lzo_decompressor.cpp
+++ b/be/src/exec/lzo_decompressor.cpp
@@ -103,6 +103,7 @@ Status LzopDecompressor::decompress(uint8_t* input, size_t 
input_len, size_t* in
     ptr = get_uint32(ptr, &uncompressed_size);
     left_input_len -= sizeof(uint32_t);
     if (uncompressed_size == 0) {
+        *input_bytes_read += sizeof(uint32_t);
         *stream_end = true;
         return Status::OK();
     }
diff --git 
a/docker/thirdparties/docker-compose/hive/scripts/preinstalled_data/user_empty_lzo/part-m-00000.lzo
 
b/docker/thirdparties/docker-compose/hive/scripts/preinstalled_data/user_empty_lzo/part-m-00000.lzo
new file mode 100644
index 00000000000..48aa4f9c93f
Binary files /dev/null and 
b/docker/thirdparties/docker-compose/hive/scripts/preinstalled_data/user_empty_lzo/part-m-00000.lzo
 differ
diff --git 
a/regression-test/suites/external_table_p0/tvf/test_user_empty_lzo.groovy 
b/regression-test/suites/external_table_p0/tvf/test_user_empty_lzo.groovy
new file mode 100644
index 00000000000..4da30630ee8
--- /dev/null
+++ b/regression-test/suites/external_table_p0/tvf/test_user_empty_lzo.groovy
@@ -0,0 +1,41 @@
+// 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_user_empty_lzo","external,hive,tvf,external_docker") {
+    String hdfs_port = context.config.otherConfigs.get("hive2HdfsPort")
+    String externalEnvIp = context.config.otherConfigs.get("externalEnvIp")
+
+    def hdfsUserName = "doris"
+    def defaultFS = "hdfs://${externalEnvIp}:${hdfs_port}"
+    def uri = ""
+
+    String enabled = context.config.otherConfigs.get("enableHiveTest")
+    if (enabled != null && enabled.equalsIgnoreCase("true")) {
+        try {
+            // it's a empty data file
+            uri = "${defaultFS}" + 
"/user/doris/preinstalled_data/user_empty_lzo/part-m-00000.lzo"
+            test {
+                sql """ select * from HDFS(
+                        "uri" = "${uri}",
+                        "hadoop.username" = "${hdfsUserName}",
+                        "format" = "csv"); """
+                exception """The first line is empty, can not parse column 
numbers"""
+            }
+        } finally {
+        }
+    }
+}


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

Reply via email to