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 2023/03/13 13:50:40 UTC

[linkis] branch dev-1.3.2-fix created (now 827e02f42)

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

casion pushed a change to branch dev-1.3.2-fix
in repository https://gitbox.apache.org/repos/asf/linkis.git


      at 827e02f42 fix export data charset not working

This branch includes the following new commits:

     new 827e02f42 fix export data charset not working

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



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


[linkis] 01/01: fix export data charset not working

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 827e02f42a703fec34bfaeafccb054c64e5e5117
Author: casionone <ca...@gmail.com>
AuthorDate: Wed Mar 8 17:50:54 2023 +0800

    fix export data charset not working
---
 .../apache/linkis/engineplugin/spark/imexport/CsvRelation.scala   | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/linkis-engineconn-plugins/spark/src/main/scala/org/apache/linkis/engineplugin/spark/imexport/CsvRelation.scala b/linkis-engineconn-plugins/spark/src/main/scala/org/apache/linkis/engineplugin/spark/imexport/CsvRelation.scala
index 4e033a524..c042b843a 100644
--- a/linkis-engineconn-plugins/spark/src/main/scala/org/apache/linkis/engineplugin/spark/imexport/CsvRelation.scala
+++ b/linkis-engineconn-plugins/spark/src/main/scala/org/apache/linkis/engineplugin/spark/imexport/CsvRelation.scala
@@ -217,7 +217,7 @@ class CsvRelation(@transient private val source: Map[String, Any]) extends Seria
         } else {
           new BufferedOutputStream(fs.append(filesystemPath))
         }
-        bufferedOutputStream.write("\n".getBytes())
+        bufferedOutputStream.write("\n".getBytes(encoding))
         bufferedOutputStream
       }
     } else {
@@ -233,17 +233,17 @@ class CsvRelation(@transient private val source: Map[String, Any]) extends Seria
         header ++= col.name ++ fieldDelimiter
       }
       if (hasHeader) {
-        out.write(header.substring(0, header.lastIndexOf(fieldDelimiter)).getBytes)
+        out.write(header.substring(0, header.lastIndexOf(fieldDelimiter)).getBytes(encoding))
       } else {
         if (iterator.hasNext) {
-          out.write(getLine(schema, iterator.next()).getBytes)
+          out.write(getLine(schema, iterator.next()).getBytes(encoding))
           index += 1
         }
       }
 
       while (index < Int.MaxValue && iterator.hasNext) {
         val msg = "\n" + getLine(schema, iterator.next())
-        out.write(msg.getBytes())
+        out.write(msg.getBytes(encoding))
         index += 1
       }
       // warn(s"Fetched ${df.columns.length} col(s) : ${index} row(s).")


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