You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@linkis.apache.org by ca...@apache.org on 2022/08/17 06:14:27 UTC

[incubator-linkis] branch dev-1.2.0 updated: Fixed the problem that some rows might be lost when reading the result set (#2756) (#2829)

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

casion pushed a commit to branch dev-1.2.0
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git


The following commit(s) were added to refs/heads/dev-1.2.0 by this push:
     new cf349ec9c Fixed the problem that some rows might be lost when reading the result set (#2756) (#2829)
cf349ec9c is described below

commit cf349ec9cc6df677fd621429c374c6c21d7f3e83
Author: aiceflower <ki...@sina.com>
AuthorDate: Wed Aug 17 14:14:22 2022 +0800

    Fixed the problem that some rows might be lost when reading the result set (#2756) (#2829)
    
    Co-authored-by: huiyuanjjjjuice <90...@users.noreply.github.com>
---
 .../scala/org/apache/linkis/storage/utils/StorageUtils.scala     | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/linkis-commons/linkis-storage/src/main/scala/org/apache/linkis/storage/utils/StorageUtils.scala b/linkis-commons/linkis-storage/src/main/scala/org/apache/linkis/storage/utils/StorageUtils.scala
index f3dfe2b37..57fd8cfeb 100644
--- a/linkis-commons/linkis-storage/src/main/scala/org/apache/linkis/storage/utils/StorageUtils.scala
+++ b/linkis-commons/linkis-storage/src/main/scala/org/apache/linkis/storage/utils/StorageUtils.scala
@@ -187,7 +187,14 @@ object StorageUtils extends Logging{
   }
 
   def readBytes(inputStream: InputStream, bytes: Array[Byte], len: Int): Int = {
-    inputStream.read(bytes, 0 , len)
+    var count = 0
+    var readLen = 0
+    while (readLen < len) {
+      count = inputStream.read(bytes, readLen, len - readLen)
+      if (count == -1 && inputStream.available() < 1) return readLen
+      readLen += count
+    }
+    readLen
   }
 
   def colToString(col: Any, nullValue: String = "NULL"): String = {


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