Unsubscribe

2020-03-22 Thread Duan,Bing
Hi: 
 Plz  Unsubscribe me.

Thanks!

-
To unsubscribe e-mail: dev-unsubscr...@spark.apache.org



Re: How to implement a "saveAsBinaryFile" function?

2020-01-17 Thread Duan,Bing
Hi Fokko, Maxim, Long:

Thanks!

This reading has been occurred in a custom datasource as below:

override def createRelation(…) {
…
blocks.map(block => (block.bytes)).saveAsTextFile(parameters("path”))
...
}

I am a new Sparker,  will try the those methods you guys provides.

Best!

Bing.

On Jan 17, 2020, at 4:28 AM, Maxim Gekk 
mailto:maxim.g...@databricks.com>> wrote:

Hi Bing,

You can try Text datasource. It shouldn't modify strings:
scala> 
Seq(""""20192_1",1,24,0,2,”S66.000x001”""").toDS.write.text("tmp/text.txt")
$ cat tmp/text.txt/part-0-256d960f-9f85-47fe-8edd-8428276eb3c6-c000.txt
"20192_1",1,24,0,2,”S66.000x001”

Maxim Gekk
Software Engineer
Databricks B. V. 
[http://go.databricks.com/hubfs/emails/Databricks-logo-bug.png] 
<http://databricks.com/>


On Thu, Jan 16, 2020 at 10:02 PM Long, Andrew 
mailto:loand...@amazon.com.invalid>> wrote:
Hey Bing,

There’s a couple different approaches you could take.  The quickest and easiest 
would be to use the existing APIs

val bytes = spark.range(1000

bytes.foreachPartition(bytes =>{
  //W ARNING anything used in here will need to be serializable.
  // There's some magic to serializing the hadoop conf. see the hadoop wrapper 
class in the source
  val writer = FileSystem.get(null).create(new Path("s3://..."))
  bytes.foreach(b => writer.write(b))
  writer.close()
})

The more complicated but pretty approach would be to either implement a custom 
datasource.

From: "Duan,Bing" mailto:duanb...@baidu.com>>
Date: Thursday, January 16, 2020 at 12:35 AM
To: "dev@spark.apache.org<mailto:dev@spark.apache.org>" 
mailto:dev@spark.apache.org>>
Subject: How to implement a "saveAsBinaryFile" function?

Hi all:

I read binary data(protobuf format) from filesystem by binaryFiles function to 
a RDD[Array[Byte]]   it works fine. But when I save the it to filesystem by 
saveAsTextFile, the quotation mark was be escaped like this:
"\"20192_1\"",1,24,0,2,"\"S66.000x001\””,which  should be 
"20192_1",1,24,0,2,”S66.000x001”.

Anyone could give me some tip to implement a function like saveAsBinaryFile to 
persist the RDD[Array[Byte]]?

Bests!

Bing



How to implement a "saveAsBinaryFile" function?

2020-01-16 Thread Duan,Bing
Hi all:

I read binary data(protobuf format) from filesystem by binaryFiles function to 
a RDD[Array[Byte]]   it works fine. But when I save the it to filesystem by 
saveAsTextFile, the quotation mark was be escaped like this:
"\"20192_1\"",1,24,0,2,"\"S66.000x001\””,which  should be 
"20192_1",1,24,0,2,”S66.000x001”.

Anyone could give me some tip to implement a function like saveAsBinaryFile to 
persist the RDD[Array[Byte]]?

Bests!

Bing


unsubscribe

2019-09-09 Thread Duan,Bing
Unsubscribe.



发自我的小米手机
在 2019年9月10日 上午8:32,Matei Zaharia 写道:
Hi all,

The Spark PMC recently voted to add several new committers and one PMC member. 
Join me in welcoming them to their new roles!

New PMC member: Dongjoon Hyun

New committers: Ryan Blue, Liang-Chi Hsieh, Gengliang Wang, Yuming Wang, 
Weichen Xu, Ruifeng Zheng

The new committers cover lots of important areas including ML, SQL, and data 
sources, so it’s great to have them here. All the best,

Matei and the Spark PMC


-
To unsubscribe e-mail: dev-unsubscr...@spark.apache.org



unsubscribe

2019-08-05 Thread Duan,Bing
unsubscribe.

-
To unsubscribe e-mail: dev-unsubscr...@spark.apache.org



Re: unsubscribe

2019-08-01 Thread Duan,Bing
unsubscribe

On Aug 1, 2019, at 6:36 PM, abel palaty 
mailto:palatya...@gmail.com>> wrote: