You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@linkis.apache.org by GitBox <gi...@apache.org> on 2022/03/31 03:22:36 UTC

[GitHub] [incubator-linkis] CCweixiao opened a new pull request #1840: 下载csv格式数据时,字段值有json格式,可以指定列限定符

CCweixiao opened a new pull request #1840:
URL: https://github.com/apache/incubator-linkis/pull/1840


   https://github.com/apache/incubator-linkis/issues/1832
   
   下载csv/excel格式数据时,字段值为json数据格式,会被英文逗号切割 错乱,数据在下载时,是否可以指定一个默认选项,让用户选择是否把每个字段的数据值用""包裹。
   
   When downloading data in csv/excel format, the field value is in json data format, which will be divided by English commas. When downloading the data, can you specify a default option to let the user choose whether to wrap the data value of each field with ""?
   
   数据下载接口resultsetToExcel 增加额外选项,quoteRetouch,默认false,如果为true会对结果集的数据进行英文双引号修饰,作为列识别符号。
   如:原始数据
   1,2,3,{"a": 1, "b": 2}
   会被转变为
   "1","2","3","{a: 1, b: 2}"
   
   这样用户直接用Excel打开下载的csv文件时,不会出现列错乱切割的现象,最好对应DSS的下载前端,增加是否加双引号列限定符的配置。
   
   <img width="555" alt="image" src="https://user-images.githubusercontent.com/27730211/160797357-3db48886-af09-4a4b-821a-3a291085e8e5.png">
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-linkis] CCweixiao commented on a change in pull request #1840: When downloading data in csv format, the field value is in json format, and the column qualifier can be specified

Posted by GitBox <gi...@apache.org>.
CCweixiao commented on a change in pull request #1840:
URL: https://github.com/apache/incubator-linkis/pull/1840#discussion_r839488878



##########
File path: linkis-commons/linkis-storage/src/main/scala/org/apache/linkis/storage/csv/CSVFsWriter.scala
##########
@@ -25,9 +25,10 @@ import org.apache.linkis.common.io.FsWriter
 abstract class CSVFsWriter extends FsWriter {
   val charset: String
   val separator: String
+  val quoteRetouchValue: Boolean

Review comment:
       Done! It's more reasonable




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-linkis] peacewong commented on a change in pull request #1840: 下载csv格式数据时,字段值有json格式,可以指定列限定符

Posted by GitBox <gi...@apache.org>.
peacewong commented on a change in pull request #1840:
URL: https://github.com/apache/incubator-linkis/pull/1840#discussion_r839437462



##########
File path: linkis-commons/linkis-storage/src/main/scala/org/apache/linkis/storage/csv/CSVFsWriter.scala
##########
@@ -25,9 +25,10 @@ import org.apache.linkis.common.io.FsWriter
 abstract class CSVFsWriter extends FsWriter {
   val charset: String
   val separator: String
+  val quoteRetouchValue: Boolean

Review comment:
       Is quoteRetouchEnable better

##########
File path: linkis-commons/linkis-storage/src/main/scala/org/apache/linkis/storage/csv/CSVFsWriter.scala
##########
@@ -25,9 +25,10 @@ import org.apache.linkis.common.io.FsWriter
 abstract class CSVFsWriter extends FsWriter {
   val charset: String
   val separator: String
+  val quoteRetouchValue: Boolean
 }
 
 object CSVFsWriter {
-  def getCSVFSWriter(charset: String, separator: String, outputStream: OutputStream): CSVFsWriter = new StorageCSVWriter(charset, separator, outputStream)
+  def getCSVFSWriter(charset: String, separator: String, quoteRetouchValue: Boolean, outputStream: OutputStream): CSVFsWriter = new StorageCSVWriter(charset, separator, quoteRetouchValue, outputStream)

Review comment:
       otherParams: Is Map better, so it is convenient to add subsequent parameters?
   otherParams:Map是否更好,这样方便加后续的参数?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-linkis] casionone merged pull request #1840: When downloading data in csv format, the field value is in json format, and the column qualifier can be specified

Posted by GitBox <gi...@apache.org>.
casionone merged pull request #1840:
URL: https://github.com/apache/incubator-linkis/pull/1840


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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