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/10 09:53:14 UTC

[incubator-linkis] branch dev-1.2.1 updated: There is a bug of dropping rows, roll back (#2669)

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

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


The following commit(s) were added to refs/heads/dev-1.2.1 by this push:
     new 98e2a11bb There is a bug of dropping rows, roll back (#2669)
98e2a11bb is described below

commit 98e2a11bba02afb5df5b544f7053475000ccc68b
Author: peacewong <wp...@gmail.com>
AuthorDate: Wed Aug 10 17:53:06 2022 +0800

    There is a bug of dropping rows, roll back (#2669)
---
 .../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..c209d74f0 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
+    while (count < len) {
+      val value = inputStream.read()
+      if(value == -1 && inputStream.available() < 1) return count
+      bytes(count) = value.toByte
+      count += 1
+    }
+    count
   }
 
   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