You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@linkis.apache.org by pe...@apache.org on 2022/08/03 09:12:30 UTC

[incubator-linkis] branch dev-1.2.0 updated: Optimize the read efficiency of the result set when the result set is output after the script is executed (#2550)

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

peacewong 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 6dc9d92ff Optimize the read efficiency of the result set when the result set is output after the script is executed (#2550)
6dc9d92ff is described below

commit 6dc9d92ffded48357ca4c25d7d9971c46e0763f5
Author: huiyuanjjjjuice <90...@users.noreply.github.com>
AuthorDate: Wed Aug 3 17:12:25 2022 +0800

    Optimize the read efficiency of the result set when the result set is output after the script is executed (#2550)
---
 .../scala/org/apache/linkis/storage/utils/StorageUtils.scala     | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

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 c209d74f0..f3dfe2b37 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,14 +187,7 @@ object StorageUtils extends Logging{
   }
 
   def readBytes(inputStream: InputStream, bytes: Array[Byte], len: Int): Int = {
-    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
+    inputStream.read(bytes, 0 , len)
   }
 
   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